… and the + sign causes the call to fail if I try to call the number back from history. Is there a way to have the + sign removed?
That's what I was responding to - the phone is sending out a number with a + sign in front and I believe the document I linked shows you how to fix that. But if you'd rather strip it from the incoming caller ID, there's a different document for that:
How to change incoming CallerID
So I have been able to successfully strip the first character in the caller ID (most of the time is a + sign), but I would rather recognise and remove a + sign instead, because sometimes its not a + sign at the beginning, but another character which I don't want stripped.
The code I am using in the 'caller ID' module is
${CALLERID(num):1}
What can I change it to?
[from-trunk-custom]
exten => _X!,1,GotoIf($["${CALLERID(num):0:2}" != "+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 => _X!,n(noplusatstart),Goto(from-trunk,${EXTEN},1)
I did read the whole page, I promise. Here's what I couldnt understand: The article says to use the part of the code after the '=' but excluding the closed parenthesis i.e - ${CALLERID(num):1} Learning by example, the :1 at the end simply strips the first digit of the number. Am I right?
Then, further down the page it talks about removing the + sign if it is present, and then gives the following code example if you will edit the conf file manually:
Code:[from-trunk-custom] exten => _X!,1,GotoIf($["${CALLERID(num):0:2}" != "+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 => _X!,n(noplusatstart),Goto(from-trunk,${EXTEN},1)
I am now needing help to determine how I get from that code to which part I should use for the caller ID module. Is it...
$["${CALLERID(num):0:2}" != "+1"]?noplusatstart)
or
$[${CALLERID(num):0:2}
Sorry, a little lost here.
; from-pstn-e164-us:
;
; The context is designed for providers who send calls in e164 format and is
; biased towards NPA calls, callerid and dialing rules. It will do the following:
;
; DIDs in an NPA e164 format of +1NXXNXXXXXX will be converted to 10 digit DIDs
;
; DIDs in any other format will be delivered as they are, including e164 non NPA
; DIDs which means they will need the full format including the + in the inbound
; route.
;
; CallerID(number) presented in e164 NPA format will be trimmed to a 10 digit CID
;
; CallerID(number) presented in e164 non-NPA (country code other than 1) will be
; reformated from: +<CountryCode><Number> to 011<CountryCode><Number>
;
Maybe I am missing something but I think you guys are doing this the HARD way.
FreePBX has a built-in context for dealing with + sign and other E.164 formatting.
How about just try setting the context of your trunk to "context=from-pstn-e164-us" ?
Link up your team and customers Phone System
Live Chat
Video Conferencing
Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.
Check your inbox!
We’ve sent you an email. Click on the button in the email body to verify your email address – (if you can not find it, check your spam folder).
Upon verification you will be directed to the 3CX setup wizard.