Cannot call a number in history

paulnye

Guru
Joined
Apr 17, 2011
Messages
208
Reaction score
2
I am using yealink t28s. In the phones call history they show as +14105556666 for example, 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?
 
Could you create an outbound route with a + in the prefix to strip the + out, then a . in the number to simply pass the rest of the number through?
 
I am referring to inbound calls, not outbound calls. I did follow the instructions in the link. I used both ways that the thread suggested. The reply on that thread suggested adding this at the top of /etc/asterisk/extensions_custom.conf

exten => _+X!,1,Noop(Stripping + from start of number)
exten => _+X!,n,Goto(from-internal,${EXTEN:1},1)
exten => h,1,Hangup()

So I did that verbatim. Was I supposed to literally copy this code just as is?
Then I restarted the PBX box, but nothing has changed, and inbound calls display the caller ID starting as +1 then 10digit number.
 
… 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
 
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

Thanks for the help on this one! In the link you posted, I used the 'setcallerID' module that they recommended, and it works great. I used .. ${CALLERID(num):1} which removes the first digit (which is always the + sign)
 
Related question

Sinse I now learned how to remove a character in the caller ID, does anyone know how to change the caller ID displaying on my yealink T28 from 14103334444 to 1410-333-4444, or even 1410 333 4444, making it easier to recognize the number?
 
Paul,
Code can be written to do that, but you will have to remember to write code that will change it back when you hit redial on the phone. I don't think the Asterisk outbound dial-plan will know how to handle the blanks.
 
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?
 
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?

How to change incoming CallerID

(Actually READ THE ENTIRE PAGE this time!)
 
How to change incoming CallerID

(Actually READ THE ENTIRE PAGE this time!)

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.
 
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?

Right. More specifically, it returns a subset of the string starting at the second character, to the end of the string.
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)

Right. THAT'S the part you should be paying attention to.
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.

Nuke the Caller ID module, it won't do what you need in this case. You have to put the entire code block in extensions_custom.conf and then in your trunks send your calls to the from-trunk-custom context. The Caller ID module is fine for simply adding or removing characters but it won't handle conditionals (or at least it wouldn't last time I looked at it). So don't use it - just add the entire context shown to the bottom of extensions_custom.conf
 
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" ?

here is the block of comments from extensions.conf:

Code:
; 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" ?

Bill is correct. I had completely forgotten about that built-in context!

It's hell when you get so old you can't remember anything! :wheelchairb:
 
Okay, so where exactly do I specify this context, then?

Which trunk?

If I understand this correctly, this would take care of situations where numbers are specified in a phone book in the

+ [country] [city] [phone-number]

format - which is the case with any address book originating or synched with a mobile phone, for example. On my iPhone I use Acrobits Softphone (and awesome voip client) and use the integrated number rewriting capability to solve this - then again, I know how to do this, but I can't expect my clients to.

If this solution would automatically take care of the conversion, it would be extremely awesome.

So, I just don't know where I would place

context=from-pstn-e164-us

Help please?
 

Members online

Forum statistics

Threads
26,688
Messages
174,412
Members
20,259
Latest member
Fadeek86
Get 3CX - Absolutely Free!

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.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top