I’m upgrading my organization’s Asterisk server from 11 to 13, specifically to 13.13. I’ve never been an Asterisk guy but by some miracle I’ve been able to manage our Asterisk 11 server so far. Due to 11’s no support for 100rel, I need to upgrade to Asterisk 13. I just learned that chan_sip is deprecated and that now I need to use chan_pjsip. I’ having a hard time understanding pjsip’s configuration object format, which is causing me headaches trying to convert the config in sip.conf to pjsip.conf. Here is what I have so far:
sip.conf:
[ISP_Trunk]
type = peer
context = inbound-from-ISP
host = IPaddressX
disallow = all
allow = ulaw
canreinvite = yes
dtmfmode = auto
;dtmf = rfc2833
insecure = port,invite
t38pt_udptl = yes
transport = udp
outboundproxy = IPaddressX
qualify = yes
Asterisk’s wiki provide a very well documented link with the migration from SIP to PJSIP, also you can make use of a single object called ‘wizard’ that can be used to configure most common chan_pjsip scenarios.
chan_sip is deprecated but not removed. You can still use it in Asterisk 13.
What you can do is start using chan_sip in 13 and meanwhile learn pjsip and next time when you upgrade Asterisk go with chan_pjsip.
chan_sip hasn’t had canreinvite for a long time, except for backward compatibility. It looks like pjsip uses the same name of this as chan_sip now does, but with an _ between the words.
canreinvite was renamed because it doesn’t affect things like connected line and session timers, even though they use re-INVITEs.
Well, Asterisk is not actually my VoIP system, I use it more as a gateway between my VoIP system (Lync 2010) and my SIP trunk. And the only way to get voicemail working is with canreinvite.
In my sip.conf, I have the following config:
[Lync Trunk]
type = peer
.
.
.
canreinvite = yes
directmedia = no
If I may ask for your advice, how would you convert the above for pjsip.conf?
Well, those options are the same so the end result of that is directmedia=no wins as it came last, so the equivalent would be direct_media=no in pjsip.conf
You need to work our what you are really trying to achieve and code for that.
Even with chan_sip, the most common use (which should be just insecure=invite) is better handled by remotesecret. I don’t know if pjsip better matches the secret = insecure or the remotesecret solution to the problem.
insecure=invite was needed because of the lack, remotesecret. Cook book authors thought it safest (but not in a security sense) to use insecure=very, which is port and invite. insecure=very was deprecated, probably because people were failing to think what they really needed. Instead of thinking, the cook book authors just expanded it to port,invite!