Troubles trying to connect two asterisk

Hello, I hope you can help me.

I’m trying to connect two asterisk. both servers are already connected. I can see them registered in CLI.

I’m following the next tutorial http://www.asteriskdocs.org/en/2nd_Edition/asterisk-book-html-chunk/connecting_two_asterisk.html

Extensions are already registered in both servers but when I’m trying to call to the other extension asterisk show me the next error.

This is an error trying to call from USA to MEX.

== Using SIP RTP CoS mark 5 -- Executing [1001@phones:1] NoOp("SIP/1000-00000012", "") in new stack -- Executing [1001@phones:2] Dial("SIP/1000-00000012", "SIP/MEX/1001") in new stack == Using SIP RTP CoS mark 5 [Mar 4 10:06:47] ERROR[16452]: netsock2.c:263 ast_sockaddr_resolve: getaddrinfo("MEX", "(null)", ...): No address associated with hostname [Mar 4 10:06:47] WARNING[16452]: chan_sip.c:5483 create_addr: No such host: MEX [Mar 4 10:06:47] WARNING[16452]: app_dial.c:2218 dial_exec_full: Unable to create channel of type 'SIP' (cause 20 - Unknown) == Everyone is busy/congested at this time (1:0/0/1) -- Executing [1001@phones:3] Hangup("SIP/1000-00000012", "") in new stack == Spawn extension (phones, 1001, 3) exited non-zero on 'SIP/1000-00000012'

This is an Error trying to call from MEX to USA.

== Using SIP RTP CoS mark 5 -- Executing [1000@phones:1] NoOp("SIP/1001-000000dc", "") in new stack -- Executing [1000@phones:2] Dial("SIP/1001-000000dc", "SIP/USA/1000") in new stack == Using SIP RTP CoS mark 5 [Mar 4 10:11:11] ERROR[7488][C-0000005e]: netsock2.c:269 ast_sockaddr_resolve: getaddrinfo("USA", "(null)", ...): Name or service not known [Mar 4 10:11:11] WARNING[7488][C-0000005e]: chan_sip.c:6205 create_addr: No such host: USA [Mar 4 10:11:11] WARNING[7488][C-0000005e]: app_dial.c:2437 dial_exec_full: Unable to create channel of type 'SIP' (cause 20 - Subscriber absent) == Everyone is busy/congested at this time (1:0/0/1) -- Executing [1000@phones:3] Hangup("SIP/1001-000000dc", "") in new stack == Spawn extension (phones, 1000, 3) exited non-zero on 'SIP/1001-000000dc'

What can I do ?
Thank you.

Your Asterisk is telling You that he neither know a SIP-Peer named MEX nor one named USA - thus the call-attempts fail.
To dig into this: Assuming the interconnection between the servers is SIP: Check Your sip.conf for the correct peer-name of the opposite server and adopt Your dialplan accordingly.

Hello abq1oim
Thank you for answer :smiley:

Both server are seeing each other, just look.

USA SERVER

[code]register => MEX:123456789@201.102.125.165

[USA]
type=friend
secret=123456789
context=phones
qualify=yes
host=dynamic
disallow=all
allow=gsm
allow=ulaw
allow=alaw[/code]

[code]CLI> sip show peers
USA/s 201.102.125.165 D N 5060 OK (77 ms)

CLI> sip show registry
201.102.125.165:5060 N MEX 105 Registered Wed, 04 Mar 2015 10:58:35
1 SIP registrations.[/code]

MEX SERVER

[code]register => USA:123456789@209.126.101.144

[MEX]
type=friend
secret=123456789
context=phones
qualify=yes
host=dynamic
disallow=all
allow=gsm
allow=ulaw
allow=alaw
[/code]

[code]CLI> sip show peers
MEX/s 209.126.101.144 D Yes Yes 5060 OK (79 ms)

CLI>sip show registry
Host dnsmgr Username Refresh State Reg.Time
209.126.101.144:5060 N USA 105 Registered Wed, 04 Mar 2015 11:03:13
1 SIP registrations.
[/code]

What am I doing bad?
Thank you.

Ah, found the culprit:

Lets just look on the USA-server:

would mean, that You’re registering to the Server at IP 201.102.125.165 as User MEX with password 123456789.

If this was Your intention, than the other part of Your sip.conf on the USA-side should be:

[MEX] 
type=friend
defaultuser=MEX
secret=123456789
context=phones
qualify=yes
host=201.102.125.165
disallow=all
allow=gsm
allow=ulaw
allow=alaw

Then an extension at the Mexico-server should be reaachabnle from the USA-server by dialing SIP/MEX/.

For the Mexico server just adaopt the changes as for the USA-server accordingly.

There is no point in using register when you known static addresses. You should use type=peer and host=.

You appear to have the sip.conf section names on the wrong machines. They should appear on the opposite machine to the one that has that name.

Thank you very much for your help guys.
I really appreciate your help. :smiley:

It seems to work although I can not call to other extensions.
I think it works because I can see error’s in both servers when I’m trying to call to other extension in MEX server.

When I try to call to 1001 I got this message.

USA Serv.

== Using SIP RTP CoS mark 5 -- Executing [1001@phones:1] NoOp("SIP/1000-0000000a", "") in new stack -- Executing [1001@phones:2] Dial("SIP/1000-0000000a", "SIP/MEX/1001") in new stack == Using SIP RTP CoS mark 5 -- Called SIP/MEX/1001 [Mar 5 09:45:09] WARNING[2756]: chan_sip.c:20245 handle_response_invite: Received response: "Forbidden" from '"1000" <sip:1000@209.126.101.144>;tag=as0db0e5ee' == Everyone is busy/congested at this time (1:0/1/0) -- Executing [1001@phones:3] Hangup("SIP/1000-0000000a", "") in new stack == Spawn extension (phones, 1001, 3) exited non-zero on 'SIP/1000-0000000a'

MEX Serv.

[Mar 5 09:54:52] WARNING[2486][C-0000006d]: chan_sip.c:16491 check_auth: username mismatch, have <USA>, digest has <MEX> [Mar 5 09:54:52] NOTICE[2486][C-0000006d]: chan_sip.c:25611 handle_request_invite: Failed to authenticate device "1000" <sip:1000@209.126.101.144>;tag=as6ea88129

In that case 1000 and 1001 are already registered. but I can not call to 1000 ----> <---- 1001.

Sometimes just to try I tried to call to 9999 it suppose to be music on MEX sever and I just got this.

Yesterday I move my did number to be redirected to USA server, to be redirected to Mex server, I mean.

DID -> USA server -> Mex Extension or 9999 "music"
And When I call to the did number I just got the same Error.

What does “== Using SIP RTP CoS mark 5” mean ? I stopped fqil2ban and nothing change.

What can I do ? :confused:

Regards.