how to enable and configure the pjsip in vicidial

       In this article I have provide steps for how to enable and configure PJSIP in vicidial. Vicidial supports PJSIP protocol from asterisk 16 and above versions. If are planning to use  the PJSIP phones or trunks in vicidial you must have asterisk 16 version installed, if you are using older version of asterisk then Reinstall the asterisk version to asterisk 16. 
vicidial pjisp configuration
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

    Follow below steps to enable the PJSIP in vicidial by installing asterisk version 16 or above . Asterisk 16 or above is must in vicidial to support the PJSIP.

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.conf
change
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=false
note: 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

change
bind = 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
Change the Allowed SIP Stacks

By default SIP is enabled, change it to PJSIP if you want to use only PJSIP,
if you want to use both PJSIP and SIP stacks then select SIP_and_PJSIP

note:
if you select SIP_and_PJSIP ,you need to manually select the options while creating phones and carriers.

Creating PJSIP Phones in Vicidial

    In vicidial the PJSIP phones are created using the asterisk PJSIP Wizard ,all you need is to create a phones in normal way you create SIP phones and select PJSIP under Client Protocol, the vicidial will run the PJSIP wizard on background and create PJSIP phones for you.
For more details on PJSIP wizard check the below link

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 pjsiptrunk

Under Vicidial admin portal Navigate to 
Admin > Carriers
Create a new carrier , under account entry add the below sample PJSIP settings

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

Example for PJSIP trunk with username and password authenticated
note: replace username and secret with your pjsip trunk credentials

[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:

    Hope this article is helpful in enabling and configuring the PJSIP in vicidial , also you have learnt to reinstall asterisk to asterisk 16 version, for professional support reach me on skype or telegram id: striker24x7

Below are referral links used for this article.
vicidial.org/docs/PJSIP_SUPPORT.txt
wiki.asterisk.org/wiki/display/AST/PJSIP+Configuration+Wizard

1 Comments
  • Ajit Kumar
    Ajit Kumar April 4, 2022 at 11:42 AM

    Authenticate each user while dialling out in asterisk

Add Comment
comment url