ViciDial Setup over PJSIP

sachin
edited October 18 in asterisk

PJSIP SUPPORT IN ASTERISK Started: 2021-01-12 Updated: 2022-01-03

* NOTE: Full PJSIP support was added to VICIdial in svn/trunk revision 3511.

This document will go over how to enable support for PJSIP within Asterisk 16 on a VICIDial.


What is PJSIP exactly?

PJSIP is a software library that is it's own Open-Source project, separate from the Asterisk Open-Source project. Beta support for PJSIP was added into Asterisk in the version 12 branch in 2012, based upon the PJSIP project's codebase. The original Asterisk SIP library(chan_sip) was developed back in 2002 and was not built to handle many of the changes made to the SIP standard since then. The PJSIP architecture is more flexible and is the chosen path forward for the Asterisk project for future SIP channel development. Eventually, the original Asterisk chan_sip libraries will be depricated, although a firm date for that has not yet been set.


What is the PJSIP Wizard?

Added to Asterisk in version 13.2, the PJSIP Wizard is a more simplified option for setting up PJSIP accounts. In VICIdial, we actually use this format on the back-end to set up Phones that are set to the PJSIP protocol. More information on how PJSIP-Wizard works, and examples of configurations using it and regular PJSIP are available here:

https://wiki.asterisk.org/wiki/display/AST/PJSIP+Configuration+Wizard


The PJSIP Open-Source project:

https://www.pjsip.org/


STEPS TO ACTIVATE PJSIP ON YOUR VICIBOX 10 INSTALL, WITH ASTEIRSK 16:

1. Go into /etc/asterisk/sip.conf and change: 

bindport=5061
websocket_enabled=false ; If websocket_enabled is not there add it and set it to false

2. Go into /etc/asterisk/pjsip.conf and change: 

bind=0.0.0.0:5060

#include "pjsip-vicidial.conf"

; ADD INBOUND AUTH FOR YOUR VENDOR TO TERMINATE CALLS ON YOUR DIALER
; YOU MAY ADD THIS IN YOUR CARRIER SETTINGS, ADD AT ONE PLACE ONLY

[INBOUNDTRUNK]
type=aor
contact=sip:192.168.1.10
 
[INBOUNDTRUNK]
type=identify
endpoint=INBOUNDTRUNK
match=192.168.1.10/32
 
[INBOUNDTRUNK]
type=endpoint
context=trunkinbound
dtmf_mode=rfc4733
disallow=all
allow=ulaw,alaw,g729
rewrite_contact=yes
rtp_timeout=60
use_ptime=yes
trust_id_inbound=yes
send_rpid=yes
inband_progress=no
tos_audio=ef
language=en
aors=INBOUNDTRUNK
transport=transport-udp
force_rport=yes

3. Reboot the dialer

4. Go to Admin -> System Settings, and change Allowed SIP Stacks from: "SIP" to "PJSIP" or "SIP_and_PJSIP"

5. Go to Admin -> Carriers, Phones and carriers will need to be manually changed if you want to switch them to PJSIP

EXAMPLE PJSIP CARRIER CONFIGURATION:

[OUTBOUND-ACCOUNT]
type=aor
contact=sip:OUTBOUND-ACCOUNT@192.168.1.10

[OUTBOUND-ACCOUNT]
type=auth
auth_type=userpass
password=strong-password
username=OUTBOUND-ACCOUNT

[OUTBOUND-ACCOUNT]
type=endpoint
context=trunkinbound
dtmf_mode=none
disallow=all
allow=ulaw,alaw,g729
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=OUTBOUND-ACCOUNT
outbound_auth=OUTBOUND-ACCOUNT
transport=transport-udp

DIALPLAN ENTRY:

exten => _91NXXNXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log) 
exten => _91NXXNXXXXXX,n,Dial(PJSIP/${EXTEN:1}@OUTBOUND-ACCOUNT,${CAMPDTO},tTo) 
exten => _91NXXNXXXXXX,n,Hangup() 

6. Go to Admin -> Phones -> Add a New Phone

While creating the phone, select "Client Protocol" as "PJSIP"


Next Topic: How to move UDP based endpoints to WebRTC

https://forum.devsach.in/discussion/96/vicidial-setup-over-pjsip-webrtc-almalinux-8

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!