how to enable and configure the pjsip in vicidial
how to enable configure PJSIP in vicidial |
What is PJSIP?
PJSIP is a free and open source multimedia communication library written in C language implementing standard based protocols such as SIP, SDP, RTP, STUN, TURN, and ICE.PJSIP is both compact and feature rich. It supports audio, video, presence, and instant messaging
Beginning with Asterisk 13.8.0, a stable version of pjproject is included in Asterisk's ./third-party directory and is enabled with the --with-pjproject-bundled option to ./configure. Beginning with Asterisk 15.0.0, it is enabled by default but can be disabled with the --without-pjproject-bundled option to ./configure
Enabling the PJSIP in Vicidial
Downloading and Installing Asterisk 16.
If you are already using the asterisk 16 then you can skip this step and proceed with next step.Asterisk 16 downloaded can be downloaded from below link
http://download.vicidial.com/
Check either beta-apps folder or required-apps folder for asterisk 16 software
If you using Vicibox 10 with asterisk 16 is good to go, or if asterisk 13 is installed then install asterisk by running the command the command vicibox-ast16 to install the asterisk 16 version.
For scratch install Remove the asterisk 13 and install asterisk 16 with PJSIP support
that is ./configure --with-pjproject-bundled
Once the asterisk 16 or above version is installed proceed with the next steps to configure and enable PJSIP support.
Step 1 : Changing the SIP Bindport
By default chan_sip module will be installed in asterisk which is binded to port 5060, for PJSIP to work properly we need to shift the bind port 5060 to PJSIP and use 5061 for chan_sip.
edit the file sip.conf by using the vi editor
vi /etc/asterisk/sip.confchange
bindport=5060
to
bindport=5061
save the file (:wq!)
Step 2: Disable the websocket
Edit the sip.conf file and disable the websocket by setting the value to false as shown below
websocket_enabled=falsenote: if websocket_endabled options is not there add it and set to false and save the file.
Step 3: PJSIP bind port to 5060
Edit the pjsip.conf file using vi or nano editor and set the bind option as show below
changebind = 0.0.0.0:5061
to
bind = 0.0.0.0:5060
save the config and reboot the vicidial once to take effect the changes.
Step 4: Set PJSIP in vicidial as default
In vicidial you can use PJSIP or SIP or BOTH PJSIP and SIP to work together.
Login to your vicidial admin portal (http://Serverip/vicidial/admin.php) with admin credentials which should have full admin permissions.
Navigate to Admin > System Settings
Creating PJSIP Phones in Vicidial
https://wiki.asterisk.org/wiki/display/AST/PJSIP+Configuration+Wizard
Creating PJSIP carrier/trunk in Vicidial
In vicidial you need to manually create the PJSIP configuration for PJSIP carriers as show below.
Below is the sample PJSIP carrier settings.
For example the carrier name is pjsiptrunkAdmin > Carriers
Example for IP based authentication trunk with trunk ip 10.10.10.17
note: replace 10.10.10.17 with your trunk IP
[pjsiptrunk] type = aor contact = sip:10.10.10.17 qualify_frequency = 15 maximum_expiration = 3600 minimum_expiration = 60 default_expiration = 120 [pjsiptrunk] type = identify endpoint = pjsiptrunk match = 10.10.10.17 [pjsiptrunk] type = endpoint context = trunkinbound dtmf_mode = none disallow = all allow = ulaw rtp_symmetric = yes rewrite_contact = yes rtp_timeout = 60 use_ptime = yes moh_suggest = default direct_media = no trust_id_inbound = yes send_rpid = yes inband_progress = no tos_audio = ef language = en aors = pjsiptrunk
type=registration
retry_interval=20
max_retries=10
contact_user=username
expiration=600
transport=0.0.0.0-udp
outbound_auth=pjsiptrunk
client_uri=sip:username@10.10.10.17:5060
server_uri=sip:10.10.10.17:5060
[pjsiptrunk]
type=auth
auth_type=userpass
password=secret
username=username
[pjsiptrunk]
type=aor
qualify_frequency=60
contact=sip:username@10.10.10.17:5060
default_expiration=600
[pjsiptrunk]
type=identify
endpoint=pjsiptrunk
match=10.10.10.17
[pjsiptrunk]
type=endpoint
transport=0.0.0.0-udp
context=trunkinbound
dtmf_mode=rfc4733
disallow=all
allow=alaw
allow=ulaw
allow=g729
direct_media=no
rtp_symmetric=yes
trust_id_inbound=yes
send_rpid=yes
;from_domain=10.10.10.17
inband_progress=yes
rewrite_contact=yes
;force_rport=yes
aors=pjsiptrunk
Vicidial PJSIP Dialplan
In Asterisk the Channel variable name for the PJSIP protocol is PJSIP, below is the sample dialplan to dialout via PJSIP trunk , for example our carrier nam context set in pjsip.conf is pjsiptrunk .
exten => _9X.,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _9X.,n,Dial(PJSIP/${EXTEN:1}@PJSIPCARRIER,30,Tto)
exten => _9X.,n,Hangup()
Conclusion:
Below are referral links used for this article.
vicidial.org/docs/PJSIP_SUPPORT.txt
wiki.asterisk.org/wiki/display/AST/PJSIP+Configuration+Wizard
Authenticate each user while dialling out in asterisk