Peer Call from Local Asterisk Server To Remote Asterisk Serv

Hai All,

I have two asterisk servers one placed in our Office another one located in remote location
second one able to connect through Public Ip…

I want to call from my Local server to this remote server…then what will be sip,extension configuration,please help me…

I tried myself but its channel is not availables…
please check configurration…

=========LocalServer=192.168.1.199====Sip.conf

[general]
port=5060

rtptimeout=0

bindaddr=0.0.0.0

tos=0x184

register =>402:1234@117.253.140.26/204

[204]
username=204
secret=1234
type=Friend
callerid=204
host=Dynamic
canreinvite=yes
NAT=yes
qualify=yes
insecure=port,invite
auth=Md5
dtmfmode=auto
canreinvite=no
disallow=all
allow=ulaw
allow=alaw
allow=gsm
context=local
======================Remote==Server==sip.conf====
[general]
port=5060

rtptimeout=0

bindaddr=0.0.0.0

tos=0x184

register =>204:4321@192.168.1.199/402

;###################################################################################

[402]
username=402
type=friend
secret=4321
context=msk_incoming
host=dynamic
qualify=yes
tmfmode=rfc2833
disallow=all
allow=ulaw

;###################################################################################

[201]
username=201
secret=201
type=Friend
callerid=201
host=Dynamic
canreinvite=yes
nat=no
qualify=yes
insecure=port,invite
auth=Md5
dtmfmode=auto
canreinvite=no
disallow=all
allow=ulaw
allow=alaw
allow=gsm
context=local

=====DialPlan===extension.conf==in==Local Server====
[local]
exten=>_XX.,1,Dial(SIP/${EXTEN}@117.253.140.26,30,tT)

Please help me to solve this issue

How does the second one know how to route to the 192.168 address?

As a general principle, having two host=dynamic pointing at each other is not a good idea. Use static addresses instead.

insecure=invite is unnecessarily insecure; use the same secret for both, or, with the latest version, use secret and remotesecret, with one secret matching the other remotesecret. Once you go static, insecure=invite will totally negate secret.

Do you really need insecure=port?

canreinvite is deprecated in the older supported versions and, I think unrecognized in the latest ones.

nat=yes is deprecated in the latest supported version. That’s probably because it is overused. You should specify the individual NAT workrounds you actually need.

Specifying two conflicting values is not well defined. For sip.conf, the later one will prevail.

type=peer is generally better than type=friend for most SIP cases, including this one.

I think username is deprecated, and even its replacement is likely to frustrate caller ID.

And this is a discussion forum, the support forum is Asterisk Support.