Connecting 2 asterisk servers (pjsip)

Hello everyone, So I’m very new to asterisk servers and I have a beginner question please.
I have 2 asterisk servers each one has its pjsip extensions and i would like to connect both servers so extension 1 from server 1 can call and receive calls from extension 2 in server 2.
I read so many articles about pjsip trunks, pjsip channels IAX and i’m totally lost, i tried some solutions but i was not able to connect the 2 servers. For more information about my network, both servers are in a local network and have a static IP, IP-Server1=192.168.1.X , IP-Server2=192.168.1.Y

Thank you


;[mytrunk]
;type=endpoint
;transport=transport-udp
;context=from-external
;disallow=all
;allow=ulaw
;aors=mytrunk
;                   ;A few NAT relevant options that may come in handy.
;force_rport=yes    ;It's a good idea to read the configuration help for each
;direct_media=no    ;of these options.
;ice_support=yes

;[mytrunk]
;type=aor
;contact=sip:198.51.100.1:5060

;[mytrunk]
;type=identify
;endpoint=mytrunk
;match=198.51.100.1

Hello, thanks for your reply, those configuration should be made on both ends? what i meaning to say is should i create the same thing on both servers and only change the IPs?

add the configuration on both server change the IP on the identify section and aor section and also the context name of the endpoint section

I’m sorry for posing simple questions but those configuration are only to make the trunk connection?
and if so, regarding the contact number and extension what should i do?

I was expecting you will be able to create a simple dial plan for inbound and outbound calls on /etc/asterisk/extensions.conf, If this is not the case http://www.asteriskdocs.org/

what i meant my friend is that the [mytrunk] while replace a normal extension?
what i have now in pjsip.conf is:

[Joe]
type=endpoint
context=from-internal
disallow=all
allow=ulaw
allow=alaw
transport=SimpleTrans
auth=JoeAUTH
aors=Joe
[JoeAUTH]
type=auth
auth_type=userpass
username=Joe
password=password
[Joe]
Type = aor
max_contacts = 1

and in extension.conf:

[internal]

exten => 1000,1,Dial(PJSIP/Joe)
exten => 1000,n,Hangup()

You need to provide the contact address in the AOR section, so it knows where Joe is. I pointed out the right part of the sample configuration file, for an example, only yesterday.

For a trunk, you would normally dial ${EXTEN}@Joe.

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