Inbound calls using outbound proxy in sip.conf

All of my inbound calls are coming in using the settings for my outbound proxy/trunk. I keep seeing this after the initial invite:

Using INVITE request as basis request - PHXMGC0120080506041557046103@209.244.63.36 Found peer 'bandwidth_outbound'

Here is my sip.conf

[code][bandwidth_inbound]
host=216.82.224.202
type=peer
context=incoming_calls
dtmfmode=rfc2833
disallow=all
allow=ulaw
allow=g729
canreinvite=no
reinvite=no
nat=no
insecure=invite
deny=0.0.0.0/0
permit=216.82.224.202

[bandwidth_outbound]
host=216.82.224.202
port=5060
type=peer
disallow=all
allow=ulaw
allow=g729
dtmfmode=rfc2833
nat=no
reinvite=no
canreinvite=no[/code]

The outbound has no context, so inbound calls fail when they try to setup using it. I can add in “context=incoming_calls” to fix it, but it seems like that totally defeats the purpose of having an inbound and outbound trunk setup.

Could it be that Asterisk sees a different IP address in the contact field and that’s why it’s not picking the correct trunk?

I have had this issue with asterisk. My "Fix was to set the settings that you want for it in the general section. When you register with your ITSP point it to a specific extension in the general context and move it from there.

in sip.conf

Register => 1234:5678@123.123.123.123/5555

The some_extension at the end of the register statement tells asterisk to send the call to extension 5555 in the default context (that you set under the general section of sip.conf) in extensions.conf. Then in the default context in extensions.conf move it to the context that you want it to go to like:

[default]
Exten => 555,1,Goto(some_contest,s,1)

Dovid, thanks for the reply, but Bandwidth.com doesn’t use registration.

So they have send the call to a specific uri like 5555@your_IP_Address and keep the 5555 in your default context in extensions.conf