+ in front of number?

Does anyone have any idea on how to remove the + in front of a received number? every time I try to call a missed call it will not work because of the +18005555555 or something like that.
I am not very savvy with all this, but I can find my way around asterisk. I can fix the phone side of it, but even if I blacklist a number I still have to add the + before the number.

Any help would be appreciated.



I am not sure how to implement that, thank you for taking the time to look it up. I tried to look it up but got page after page. Looking for something with a + is not a good idea for searching… lol

Anyway, could someone explain this? I opened my extensions_custom.conf and all that is in mine is mainly the stuff I put in for googlevoice.

Many thanks.

Follow the directions, in the trunk context field set:


I am sorry, as I mentioned I am not that great with this stuff, and I have no clue what to put where. I have stared at it for ages, but still it makes no sense to me.
Thanks for the help anyway.


This is what I put in my extentions_custom.conf

;------------------------------------------------------------------------------- ; 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> ; [from-sip-external] exten => _+1NXXNXXXXXX/_+1NXXNXXXXXX,1,Set(CALLERID(number)=${CALLERID(number):2}) exten => _+1NXXNXXXXXX/_NXXNXXXXXX,2,Goto(from-sip-external,${EXTEN:2},1) exten => _+1NXXNXXXXXX/_+X.,1,Set(CALLERID(number)=011${CALLERID(number):1}) exten => _+1NXXNXXXXXX/_011X.,n,Goto(from-sip-external,${EXTEN:2},1) exten => _+1NXXNXXXXXX,1,Goto(from-sip-external,${EXTEN:2},1) exten => _[0-9+]./_+1NXXNXXXXXX,1,Set(CALLERID(number)=${CALLERID(number):2}) exten => _[0-9+]./_NXXNXXXXXX,n,Goto(from-sip-external,${EXTEN},1) exten => _[0-9+]./_+X.,1,Set(CALLERID(number)=011${CALLERID(number):1}) exten => _[0-9+]./_011X.,n,Goto(from-sip-external,${EXTEN},1) exten => _[0-9+].,1,Goto(from-sip-external,${EXTEN},1) exten => s/_+1NXXNXXXXXX,1,Set(CALLERID(number)=${CALLERID(number):2}) exten => s/_NXXNXXXXXX,n,Goto(from-sip-external,${EXTEN},1) exten => s/_+X.,1,Set(CALLERID(number)=011${CALLERID(number):1}) exten => s/_011X.,n,Goto(from-sip-external,${EXTEN},1) exten => s,1,Goto(from-sip-external,${EXTEN},1)

I changed out the [from-pstn-e164-us] to [from-sip-external]… not sure if this is right but I have been trying… No luck so far.

I have no idea what you are doing. Simply change the context variable in your inbound trunk to from-pstn-e164-us.

That’s what I was saying… I know very little about it but learn something new everyday. Could I trouble you for a more precise location on where to add this? From what I gather I need to add this to my extention_custom_conf of which I have done. I just need to change it back to how it was :slight_smile: … I use sipstation module and I am unsure where to add this to the inbound trunk.

I don’t know anything about the sipstation module. Doesn’t it create a trunk? In the trunk, change the context field. I really don’t know how to explain it any better, it’s “context=xxxx”.

Just delete all the code you added in extensions_custom.conf, it is not needed, the context is built into the system to perform the CID manipulation.

I think I know where you mean… under basic / trunks I click on one of the trunks for sip station and I see under outgoing setting / peer details the context=from-pstn

I will edit my wrong doings in the morning and change the context out to see if this fixes it… thank you so much for your help. You have be great!!!

WOW, I feel like such an idiot. That worked great!! Thank you so much for your help. It’s people like you that make this phone system so fantastic…

Not a problem, glad to be of help.

This is weird… can anyone tell from the above script why it is now placing a 9 on my outgoing CID? I called my work phone and I noticed my number is prefixed with a 9 and my name does not appear anymore.

Nope… scrap the above… it is my work phone system adding the 9 to the front of my number. Wonder why my CID is not working… hmm.

This can be achieved by many ways. Dial plan injection gives you more control on what you want to achieve. One method is to use CUT function of asterisk in dialplan. Refer to http://www.voip-info.org/wiki/view/Asterisk+func+cut.

Other method could be to call a script that you can create in php or perl, remove + sign there and set the variable to new values. hope this helps.