Asterisk to Asterisk connectivity


#1

hi,

I have two Asterisk servers (Ast-1 and Ast-2) and user agent (using Xlite) registered to each server as
4001 registered to Ast-1
4002 registered to Ast-2

Now i want 4001 to be able to call 4002 and vice versa.
Here is what i did in extensions.conf on Ast-1

[mycontext]

4002 => s,1,Dial(SIP/4002@Ast-2’sIP:5060)

and similarly on Ast-2 for 4001

4001 => s,1,Dial(SIP/4001@Ast-1’sIP:5060)

but when 4001 dials 4002 i get the following message on Asterisk CLI

===============================================
– Executing Dial(“SIP/4001-ae6e”, “SIP/4002@10.0.80.74:5060”) in new stack
– Called 4002@10.0.80.74:5060
– SIP/10.0.80.74:5060-aaa0 is circuit-busy
== Everyone is busy/congested at this time (1:0/1/0)
== Auto fallthrough, channel ‘SIP/4001-ae6e’ status is ‘CONGESTION’

and Xlite shows “503 Service Unavailable”

Is this the correct way?
Please help me out.

Thanks


#2

If you are doing Asterisk to Asterisk communications you should think about useing IAX. While it’s possible to use SIP, IAX is just much better at it.

In either case you’ll probably need to make some changes to you sip.conf or iax.conf file. Typically you setup all of your endpoints (phones) in the sip.conf file, and then setup your trunks (* to *) in the iax.conf (or if you really want to sip.conf).

sip.conf box a
[4001]
type=friend
password=secret
context=default
callerid=“Name” <4001>
host=dynamic

sip.conf box b
[4002]
type=friend
password=secret
context=default
callerid=“Name” <4002>
host=dynamic

iax.conf box a
[box-b]
type=friend
host=boxbipordns
auth=plaintext
context=default
trunk=yes
notransfer=yes

iax.conf box b
[box-a]
type=friend
host=boxaipordns
auth=plaintext
context=default
trunk=yes
notransfer=yes

Then when you dial from box-a,

Dial(IAX2/box-b/4002, 20)

It will go through box-b to call extension 4002. The reverse is also true.

On box-b use

Dial(IAX2/box-a/4001,20)

It will go through box-a to call extension 4001.

Please note that there are many other settings you may need / want to set in both sip.conf and iax.conf. This should give you an idea of how it works though.

Good Luck,
Dan