External peer's position in sip.conf

Hi all,

Can someone please explain why the channel position in sip.conf makes a difference?

As per http://lists.digium.com/pipermail/asterisk-users/2008-March/207705.html I need to disable INVITE authentication in order to receive incoming calls, but I need to leave it in to make outgoing calls.

I’ve consequently created two peers in sip.conf, one for incoming and one for outgoing. If the entry for outgoing is first, everything works OK. If the entry for incoming is first, neither works.

[code]register => 123456:mypass@sip.gradwell.net/02392123123

[gradwell_out]
type=peer
insecure=very
host=sip.gradwell.net
username=123456
secret=mypass
fromuser=123456
fromdomain=sip.gradwell.net
canreinvite=no
dtmfmode=rfc2833
context=outgoing_calls

[gradwell_in]
type=peer
host=sip.gradwell.net
canreinvite=no
dtmfmode=rfc2833
context=incoming_calls[/code]
Why would this be …?

Thanks
Matt