I have a problem creating a SIP trunk.
I want to connect to a SER which is owned and maintained by an external provider. That provider switches my calls to the “normal” phone network.
To get inbound access I placed the following in sip.conf:
register => user1:pass@domain.tld:5060
register => user2:pass@domain.tld:5060
That works perfect. I can call the normal phone number that belongs to that SIP user and my asterisk box picks it up nicely.
Step 2: Outbound access to the PSTN network. To get that I put the following in sip.conf:
[outbound1]
type=peer
secret=pass
username=user1
host=domain.tld
nat=yes
fromuser=user1
fromdomain=domain.tld
context=maincontext
disallow=all
allow=alaw
[outbound2]
type=peer
secret=pass
username=user2
host=domain.tld
nat=yes
fromuser=user2
fromdomain=domain.tld
context=maincontext
disallow=all
allow=alaw
And that works OK too. I test this by using the following in
extensions.conf:
exten => _9.,1,Dial(SIP/${EXTEN:1}@outbound1,30,r)
exten => _8.,1,Dial(SIP/${EXTEN:1}@outbound2,30,r)
No problem there. But when I activate the outbound stuff I described in step 2, my inbound traffic doesn’t work anymore. I get the following error message:
Nov 18 11:51:36 NOTICE[12741]: chan_sip.c:9386 handle_request_invite: Failed to authenticate user “0656843325” sip:0656843325@121.92.147.18:5065;tag=as7c82636b
where “0656843325” is the cellphone number I use to test this.
Now why does Asterisk want to authenticate this? I don’t get it. When I remove the outbound sip clients, everything works perfectly. Any ideas where this comes from?
I use Asterisk 1.2.0 Beta1 on a Gentoo 2.6.12 box. I have no PSTN, ISDN or other zap/capi interfaces, just SIP.