I have an existing openwrt gateway that works well with asterisk, I have an elderly relative that needs to be able to call me so I have set up a second openwrt gateway with asterisk with him.
Both have a wireguard tunnel connecting them.
I have successfully registered both boxes with each other. But can not get the phones to dial each other.
I have read ‘Connecting Two Asterisk Boxes Together via SIP’ in the document ‘Asterisk_ The Future of Telephony’ but I still cant get it to work.
I tried to make Server A (ME) dial 555 to call Server B (John) and Server B call 666 to call Server A.
‘Home’ is used to connect my gateway device (touch tone phone) to asterisk. Home is registered to asterisk as it is used for the other external sip providers.
I get the following errors when I try to make a call from Server A using 555-
== Using SIP RTP CoS mark 5
-- Executing [555@phones:1] Dial("SIP/home-00000016", "SIP/John") in new stack
== Using SIP RTP CoS mark 5
-- Called SIP/John
[Feb 19 18:16:01] WARNING[14914][C-0000000d]: chan_sip.c:24127 handle_response_invite: Received response: "Forbidden" from '"home" <sip:home@172.23.14.1>;tag=as1b9d452f'
== Everyone is busy/congested at this time (1:0/0/1)
-- Executing [555@phones:2] Hangup("SIP/home-00000016", "") in new stack
== Spawn extension (phones, 555, 2) exited non-zero on 'SIP/home-00000016'
-- Unregistered SIP 'home'
-- Registered SIP 'home' at xxx.xxx.xxx.x:5065
[Feb 19 18:16:02] NOTICE[14914]: chan_sip.c:28519 handle_request_subscribe: Received SIP subscribe for peer without mailbox: home
and Server B shows-
[Feb 19 17:13:53] WARNING[14914][C-0000000c]: chan_sip.c:17332 check_auth: username mismatch, have <home>, digest has <John>
[Feb 19 17:13:53] NOTICE[14914][C-0000000c]: chan_sip.c:26418 handle_request_invite: Failed to authenticate device "home" <sip:home@172.23.14.2>;tag=as752658ba
[Feb 19 17:15:17] NOTICE[14914]: chan_sip.c:28519 handle_request_subscribe: Received SIP subscribe for peer without mailbox: home
Calling from Server B to Server A dose the same thing.
Below are Server A and Server B’s sip.conf and extensions.conf
(I had to remove password form sip.conf for the connection as it was giving errors).
Server A-
sip.conf
register => ME:@172.23.14.2/John
; # Phones #
[home]
type=friend
context=phones
allow=ulaw,alaw
secret=secrethome
host=dynamic
[mobile-home]
type=friend
context=phones
allow=ulaw,alaw
secret=secretmhome
host=dynamic
[John]
type=friend
context=John
allow=ulaw,alaw
secret=
host=dynamic
insecure=invite
defaultuser=John
; # Sip Providers details #
[Provider1]
type=friend
context=P1
allow=ulaw,alaw
secret=xxxxxxx
host=voice.service.com
nat=force_rport,comedia
insecure=invite
fromdomain=voice.service.com
defaultuser=xxxxxxxxxx
[Provider2]
type=friend
context=P2
allow=ulaw,alaw
secret=yyyyyyyyy
host=sip.serv.com
nat=force_rport,comedia
insecure=invite
fromdomain=sip.serv.com
defaultuser=xxxxxxxxxxxx
extensions.conf
; # Incoming #
[P1]
exten => xxxxxxx,1,Goto(phones,333,1)
[John]
exten => 666,1,Goto(phones,333,1)
; # Internal Devices #
[phones]
exten => 111,1,Dial(SIP/home)
same => n,Hangup
exten => 222,1,Dial(SIP/mobile-home)
same => n,Hangup
exten => 555,1,Dial(SIP/John)
same => n,Hangup
; # Block caller list #
exten => 333,1,NoOp(${CALLERID(num)})
same => n,GotoIf($["${DB(blockcaller/${CALLERID(num)})}" != "1"]?allowed)
same => n,Playback(Number_not_avaliable)
same => n,Hangup()
same => n(allowed),Ringing ;caller hears ringing tone
same => n,Queue(home) ;call Queue
same => n,Hangup()
; # Outgoing Dials #
; # Dial Extension Provider2 #
exten => _2X.,1,Goto(outgoing,${EXTEN:1},1) ;press 2 for P2
; # Dial Extension Provider1 #
exten => _X.,1,NoOp(${CALLERID(num)})
same => n,Set(CALLERID(num)=xxxxxxxxx)
same => n,Goto(outgoing,${EXTEN},2)
; # Outgoing Providers #
[outgoing]
exten => _X.,1,Dial(SIP/P2/${EXTEN})
exten => _X.,2,Dial(SIP/P1/${EXTEN})
Server B-
sip.conf
register => John:@172.23.14.1/ME
[home]
type=friend
context=phones
allow=ulaw,alaw
secret=secrethome
host=dynamic
[ME]
type=friend
context=John
allow=ulaw,alaw
secret=
host=dynamic
insecure=invite
defaultuser=ME
extensions.conf
; # Incoming #
[ME]
exten => 555,1,Goto(phones,333,1)
; # Internal Devices #
[phones]
exten => 111,1,Dial(SIP/home)
same => n,Hangup
exten => 222,1,Dial(SIP/mobile-home)
same => n,Hangup
exten => 666,1,Dial(SIP/ME)
same => n,Hangup
exten => 333,1,NoOp()
same => n,Ringing ;caller hears ringing tone
same => n,Hangup()
Can someone tell me what I am doing wrong? Please