Asterisk PJSIP - VoIP.ms Wiki

Check out our YouTube channel to watch our simple tutorials that will help you set up most of our features.

Asterisk PJSIP

From VoIP.ms Wiki

(Difference between revisions)
Jump to: navigation, search
[checked revision][quality revision]
(Created page with "==Asterisk (SIP)== ===sip.conf=== <nowiki> [general] register => 100000:[email protected]:5060 [voipms] canreinvite=no context=mycontext host=atla...")
(pjsip.conf)
(8 intermediate revisions not shown)
Line 1: Line 1:
-
==Asterisk (SIP)==
+
==Asterisk (PJSIP)==
-
===sip.conf===
+
===pjsip.conf===
  <nowiki>
  <nowiki>
-
[general]              
+
[transport-udp]
-
register => 100000:johnspassword@atlanta.voip.ms:5060
+
type = transport
 +
protocol = udp
 +
bind = 0.0.0.0
[voipms]
[voipms]
-
canreinvite=no
+
type = registration
-
context=mycontext
+
transport = transport-udp
-
host=atlanta.voip.ms (one of our multiple servers, you can choose the one closer to your location)
+
outbound_auth = voipms
-
secret=johnspassword ;your password
+
client_uri = sip:100000@atlanta.voip.ms:5060    ; (one of our multiple servers, you can choose the one closer to your location)
-
type=peer
+
server_uri = sip:atlanta.voip.ms:5060            ; (one of our multiple servers, you can choose the one closer to your location)
-
username=100000 (Replace with your 6 digit Main SIP Account User ID or Sub Account username, i.e. 123456 or 123456_sub)
+
-
disallow=all
+
-
allow=ulaw
+
-
; allow=g729 ; Uncomment if you support G729
+
-
fromuser=100000 (Replace with your 6 digit Main SIP Account User ID or Sub Account username, i.e. 123456 or 123456_sub)
+
-
trustrpid=yes
+
-
sendrpid=yes
+
-
insecure=invite
+
-
nat=yes
+
-
</nowiki>
+
-
*Note: As of FreePBX/Asterisk version 2.9.0.7 if ;comments are placed after the config entries as above it may prevent outgoing call's with the end points getting "All circuits are busy". Remove the ;comments and the trunk will send the calls with no errors.
+
[voipms]
 +
type = auth
 +
auth_type = userpass
 +
username = 100000            ; (Replace with your 6 digit Main SIP Account User ID or Sub Account username, i.e. 123456 or 123456_sub)
 +
password = johnspassword    ; your password
 +
 
 +
[voipms]
 +
type = aor
 +
contact = sip:100000@atlanta.voip.ms            ; (one of our multiple servers, you can choose the one closer to your location)
 +
 
 +
[voipms]
 +
type = endpoint
 +
transport = transport-udp
 +
context = mycontext
 +
disallow = all
 +
allow = ulaw
 +
; allow=g729                ; uncomment if you support g729
 +
from_user = 100000          ; (Replace with your 6 digit Main SIP Account User ID or Sub Account username, i.e. 123456 or 123456_sub)
 +
auth = voipms
 +
outbound_auth = voipms
 +
aors = voipms
 +
; NAT parameters:
 +
rtp_symmetric = yes
 +
rewrite_contact = yes
 +
send_rpid = yes
 +
 
 +
[voipms]
 +
type = identify
 +
endpoint = voipms
 +
match = atlanta.voip.ms      ; (one of our multiple servers, you can choose the one closer to your location)
 +
</nowiki>
===extensions.conf===
===extensions.conf===
Line 34: Line 56:
[voipms-outbound]
[voipms-outbound]
-
exten => _1NXXNXXXXXX,1,Dial(SIP/${EXTEN}@voipms)
+
exten => _1NXXNXXXXXX,1,Dial(PJSIP/${EXTEN}@voipms)
exten => _1NXXNXXXXXX,n,Hangup()
exten => _1NXXNXXXXXX,n,Hangup()
-
exten => _NXXNXXXXXX,1,Dial(SIP/1${EXTEN}@voipms)
+
exten => _NXXNXXXXXX,1,Dial(PJSIP/1${EXTEN}@voipms)
exten => _NXXNXXXXXX,n,Hangup()
exten => _NXXNXXXXXX,n,Hangup()
-
exten => _011.,1,Dial(SIP/${EXTEN}@voipms)
+
exten => _011.,1,Dial(PJSIP/${EXTEN}@voipms)
exten => _011.,n,Hangup()
exten => _011.,n,Hangup()
-
exten => _00.,1,Dial(SIP/${EXTEN}@voipms)
+
exten => _00.,1,Dial(PJSIP/${EXTEN}@voipms)
exten => _00.,n,Hangup()
exten => _00.,n,Hangup()
Line 50: Line 72:
<br><br><br><br><br>
<br><br><br><br><br>
-
==Asterisk IP Auth. (SIP)==
+
==Asterisk IP Auth. (PJSIP)==
-
===sip.conf===
+
===pjsip.conf===
Note: You'll need to create a sub account to use IP Auth
Note: You'll need to create a sub account to use IP Auth
  <nowiki>
  <nowiki>
 +
[transport-udp]
 +
type = transport
 +
protocol = udp
 +
bind = 0.0.0.0
 +
[voipms]
[voipms]
-
canreinvite=nonat
+
type = aor
-
context=mycontext
+
contact = sip:100000@atlanta.voip.ms             ; (one of our multiple servers, you can choose the one closer to your location)
-
host=atlanta.voip.ms (one of our multiple servers, you can choose the one closer to your location)
+
-
type=peer
+
-
disallow=all
+
-
allow=ulaw
+
-
; allow=g729 ; uncomment if you support g729
+
-
nat=yes
+
-
</nowiki>
+
 +
[voipms]
 +
type = endpoint
 +
transport = transport-udp
 +
context = mycontext
 +
disallow = all
 +
allow = ulaw
 +
; allow=g729                ; uncomment if you support g729
 +
from_user = 100000          ; (Replace with your 6 digit Main SIP Account User ID or Sub Account username, i.e. 123456 or 123456_sub)
 +
aors = voipms
 +
; NAT parameters:
 +
rtp_symmetric = yes
 +
rewrite_contact = yes
 +
send_rpid = yes
 +
 +
[voipms]
 +
type = identify
 +
endpoint = voipms
 +
match = atlanta.voip.ms      ; (one of our multiple servers, you can choose the one closer to your location)
 +
</nowiki>
===extensions.conf===
===extensions.conf===
Line 77: Line 116:
[voipms-outbound]
[voipms-outbound]
-
exten => _1NXXNXXXXXX,1,Dial(SIP/${EXTEN}@voipms)
+
exten => _1NXXNXXXXXX,1,Dial(PJSIP/${EXTEN}@voipms)
exten => _1NXXNXXXXXX,n,Hangup()
exten => _1NXXNXXXXXX,n,Hangup()
-
exten => _NXXNXXXXXX,1,Dial(SIP/1${EXTEN}@voipms)
+
exten => _NXXNXXXXXX,1,Dial(PJSIP/1${EXTEN}@voipms)
exten => _NXXNXXXXXX,n,Hangup()
exten => _NXXNXXXXXX,n,Hangup()
-
exten => _011.,1,Dial(SIP/${EXTEN}@voipms)
+
exten => _011.,1,Dial(PJSIP/${EXTEN}@voipms)
exten => _011.,n,Hangup()
exten => _011.,n,Hangup()
-
exten => _00.,1,Dial(SIP/${EXTEN}@voipms)
+
exten => _00.,1,Dial(PJSIP/${EXTEN}@voipms)
exten => _00.,n,Hangup()
exten => _00.,n,Hangup()

Revision as of 13:40, 11 June 2015

Contents

Asterisk (PJSIP)

pjsip.conf

[transport-udp]
type = transport
protocol = udp
bind = 0.0.0.0

[voipms]
type = registration
transport = transport-udp
outbound_auth = voipms
client_uri = sip:[email protected]:5060     ; (one of our multiple servers, you can choose the one closer to your location)
server_uri = sip:atlanta.voip.ms:5060            ; (one of our multiple servers, you can choose the one closer to your location)

[voipms]
type = auth
auth_type = userpass
username = 100000            ; (Replace with your 6 digit Main SIP Account User ID or Sub Account username, i.e. 123456 or 123456_sub)
password = johnspassword     ; your password

[voipms]
type = aor
contact = sip:[email protected]             ; (one of our multiple servers, you can choose the one closer to your location)

[voipms]
type = endpoint
transport = transport-udp
context = mycontext
disallow = all
allow = ulaw
; allow=g729                 ; uncomment if you support g729
from_user = 100000           ; (Replace with your 6 digit Main SIP Account User ID or Sub Account username, i.e. 123456 or 123456_sub)
auth = voipms
outbound_auth = voipms
aors = voipms
; NAT parameters:
rtp_symmetric = yes
rewrite_contact = yes
send_rpid = yes

[voipms]
type = identify
endpoint = voipms
match = atlanta.voip.ms      ; (one of our multiple servers, you can choose the one closer to your location)

extensions.conf

[mycontext]
; Make sure to include inbound prior to outbound because the _NXXNXXXXXX handler will match the incoming call and create a loop
include => voipms-inbound
include => voipms-outbound

[voipms-outbound]
exten => _1NXXNXXXXXX,1,Dial(PJSIP/${EXTEN}@voipms)
exten => _1NXXNXXXXXX,n,Hangup()
exten => _NXXNXXXXXX,1,Dial(PJSIP/1${EXTEN}@voipms)
exten => _NXXNXXXXXX,n,Hangup()
exten => _011.,1,Dial(PJSIP/${EXTEN}@voipms)
exten => _011.,n,Hangup()
exten => _00.,1,Dial(PJSIP/${EXTEN}@voipms)
exten => _00.,n,Hangup()

; inbound context example for your DID numbers, do not add the number 1 in front

[voipms-inbound]
exten => 7863643011,1,Answer() ;your DID






Asterisk IP Auth. (PJSIP)

pjsip.conf

Note: You'll need to create a sub account to use IP Auth

[transport-udp]
type = transport
protocol = udp
bind = 0.0.0.0

[voipms]
type = aor
contact = sip:[email protected]             ; (one of our multiple servers, you can choose the one closer to your location)

[voipms]
type = endpoint
transport = transport-udp
context = mycontext
disallow = all
allow = ulaw
; allow=g729                 ; uncomment if you support g729
from_user = 100000           ; (Replace with your 6 digit Main SIP Account User ID or Sub Account username, i.e. 123456 or 123456_sub)
aors = voipms
; NAT parameters:
rtp_symmetric = yes
rewrite_contact = yes
send_rpid = yes

[voipms]
type = identify
endpoint = voipms
match = atlanta.voip.ms      ; (one of our multiple servers, you can choose the one closer to your location)

extensions.conf

[mycontext]
; Make sure to include inbound prior to outbound because the _NXXNXXXXXX handler will match the incoming call and create a loop
include => voipms-inbound
include => voipms-outbound

[voipms-outbound]
exten => _1NXXNXXXXXX,1,Dial(PJSIP/${EXTEN}@voipms)
exten => _1NXXNXXXXXX,n,Hangup()
exten => _NXXNXXXXXX,1,Dial(PJSIP/1${EXTEN}@voipms)
exten => _NXXNXXXXXX,n,Hangup()
exten => _011.,1,Dial(PJSIP/${EXTEN}@voipms)
exten => _011.,n,Hangup()
exten => _00.,1,Dial(PJSIP/${EXTEN}@voipms)
exten => _00.,n,Hangup()

; inbound context example for your DID numbers, do not add the number 1 in front

[voipms-inbound]
exten => 7863643011,1,Answer() ;your DID

Personal tools
Namespaces
Variants
Actions
VoIP.ms Wiki
Guides 🇨🇦
Guías 🇲🇽