Cant connect two Asterisk Servers

Hello community,

I have asterisk servers in the same local network.

I am trying to make a call between two servers but i cant.

My first server IP : 192.168.0.234 with “George” registered

sip.conf file :
[general]
transport=udp
nat=force_rport,comedia
directmedia=no

friends_internal
type=friend
context=from-internal
host=dynamic
disallow=all
allow=ulaw

George
secret=1234

Renia
secret=1234

pjsip.conf file:
[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0

endpoint_internal
type=endpoint
context=from-internal
disallow=all
allow=ulaw

auth_userpass
type=auth
auth_type=userpass

aor_dynamic
type=aor
max_contacts=1

George
auth=George
aors=George
George
password=1234
username=George
George

Renia
auth=Renia
aors=Renia
Renia
password=1234
username=Renia
Renia

extensions.conf file:
[from-internal]
exten=> _2XX,1,Dial(SIP/$EXTEN:1},15)

exten=> _2XX,n,Hangup()

exten=> i,1,Congestion

exten=> _1XX,1,Dial,(IAX2/George/${EXTEN:1},30,r)

exten=> _1XX,n,Hangup()

exten=> i,2,Congestion

iax.conf file:
[general]
register => Renia:1234@192.168.0.108

[George]
type=friend
host=dynamic
secret=1234
context=from-internal
peercontext=from-internal
qualify=yes

My second server IP : 192.168.0.108 with “Renia” registered

The sip and pjsip are exaclty the same with the First server.

iax.conf file:

[general]
register => George:1234@192.168.0.234

[Renia]
type=friend
host=dynamic
secret=1234
context=from-internal
peercontext=from-internal
qualify=yes

extensions.conf file:

exten=> _1XX,1,Dial(SIP/$EXTEN:1},15)

exten=> _1XX,n,Hangup()

exten=> i,1,Congestion

exten=> _2XX,1,Dial(IAX2/Renia/${EXTEN:1},30,r)

exten=> _2XX,n,Hangup()

exten=> i,2,Congestion

No errors come up when i type iax2 reload.

Now when i try to make a call from server 1 to 2, i get this output from asterisk console

When i try to make a call from server 2 to 1, i get this output

Could you please help me with the configurations?

I am really so so confused about how to connect the two servers.

Any help is appriciated.

Thank you all in advance.
Notice: When i use only 1 server and i register Renia and George, i can make the call between of them.

System #1

peer(1XX) ---- Asterisk1 — Peer(2XX)

at this system, dialplan will be …
exten=> _XXX,1,Dial(SIP/$EXTEN},15)

System #2

as you described, maybe this is your system!

peer(1XX) ---- Asterisk1 <----------> Asterisk2 ---- Peer(2XX)

maybe dialplan will be…
exten=> _XXX,1,Dial(SIP/$EXTEN}@Asterisk1,15)
or
exten=> _XXX,1,Dial(SIP/$EXTEN}@Asterisk2,15)

Hello hsunryou,

Thank you very much for your reply.

So i have to change in server 1 this line
exten=> _2XX,1,Dial(SIP/$EXTEN:1},15)

to this one exten=> _XXX,1,Dial(SIP/$EXTEN}@Asterisk1,15)

and in server two this line
exten=> _1XX,1,Dial(SIP/$EXTEN:1},15)

to this one
exten=> _XXX,1,Dial(SIP/$EXTEN}@Asterisk1,15)
or
exten=> _XXX,1,Dial(SIP/$EXTEN}@Asterisk2,15)

Thanks in advance.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.