FreePBX/Incredible PBX - removing leading CID + (plus)
Post ReplyFreePBX/Incredible PBX - removing leading CID + (plus)Posted: Sunday, May 12, 2019 [04:46:10] - 1
Run into a problem when CID comes with leading +, i.e. +1. US context from-pstn-e164-us pretty much takes care of it but if your trunk connected to other countries where provider sends CID with leading plus and length of CID is not 10 - then there are a number of ways to remove it. Main reason a + sign has to be removed is that CID stored on extension phone with it and when one tries to call back from call history - call does not go through. It is not advisable, but if one could remember what was done to settings - the simplest way is to add full SIP provider context to: /etc/asterisk/extensions_override_freepbx.conf and remove plus sign there before it is passed for processing include => from-trunk-sip-Provider_Context-custom exten => _.,1,Set(GROUP()=OUT_1) ; Remove the leading + exten => _X!,1,GotoIf($["${CALLERID(num):0:1}" != "+"]?noplusatstart) exten => _X!,n,NoOp(Changing Caller ID number from ${CALLERID(num)} to ${CALLERID(num):1}) exten => _X!,n,Set(CALLERID(num)=${CALLERID(num):1}) exten => _.,n(noplusatstart),Goto(from-trunk,${EXTEN},1) ;exten => _.,n,Goto(from-trunk,${EXTEN},1) ; this is original line commented-out ;--== end of [from-trunk-sip-Provider_Context] ==--; the following code removes the plus sign only: exten => _X!,1,GotoIf($["${CALLERID(num):0:1}" != "+"]?noplusatstart) exten => _X!,n,NoOp(Changing Caller ID number from ${CALLERID(num)} to ${CALLERID(num):1}) exten => _X!,n,Set(CALLERID(num)=${CALLERID(num):1}) The rest of the code is taken from your SIP provider context. It's a dirty hack, but it works. If SIP settings for a given trunk ever changed - this file has to be edited manually or trunk may not work. |
RE: FreePBX/Incredible PBX - removing leading CID + (plus)Posted: Sunday, May 12, 2019 [04:56:52] - 2