QUESTION Country Codes - Further Help

Adam Pierce

New Member
Joined
Apr 20, 2016
Messages
2
Reaction score
0
Hi Guys

i am am having issues removing the country code from the inbound caller id, i have used the following found on the forum

[from-didlogic]
exten => _./_44XXXXXXXX,1,Set(CALLERID(number)=${CALLERID(number):2})
exten => _./_NXXXXXXX,n,Set(CALLERID(name)=${CALLERID(name):2})
exten => _./_NXXXXXXX,n,Goto(from-trunk,${EXTEN},1)
exten => _.,1,Goto(from-trunk,${EXTEN},1)
exten => s,1,Goto(from-trunk,${EXTEN},1

which does remove the 44 but then it shows as 12345678900 i need to replace the leading 0


many thanks for your help


Adam
 
Last edited:

ostridge

Guru
Joined
Jan 22, 2015
Messages
1,618
Reaction score
517
1st you should post the result of
Code:
sudo status
Log into the console and type the above code - so that the status screen appears. Copy the result and post it here.

Help us to know what you are saying -- what distro / hardware / software linux flavour platform
file /etc/asterisk/extensions_additional.conf /etc/asterisk/extensions_custom.conf

http://pbxinaflash.com/community/threads/piaf-help-flowchart.12610/

Now you seem to be editing one of the conf files?? for inbound clid
Note the warning in *_additional.conf files which shouldnot be edited.

You should be using the freepbx GUI to set up the outbound routes for the trunk if that is what you are doing??
prepend + prefix | pattern / Your_CLID
44+ 0|ZXXXXXXXX/02031234567 the 0 gets removed; the 44 gets added (or vice versa)

It shouldnt be necessary to alter inbound did as the 44 is probably useful to the person answering to know what was sent and what country sent it.
Regards
 

Adam Pierce

New Member
Joined
Apr 20, 2016
Messages
2
Reaction score
0
My Apologies, reading back my post was pretty vague.


I have 2 inbound providers (Simwood & DIDLogic) presenting caller id as follows


Simwood: 01234567890

DIDLogic: 441234567890


what I want to do is rewrite the didlogic inbound caller id to show as the Simwood one does (removing the 44 and adding 0) so that blacklisting and other functions work as expected no matter which trunk they come in on


I have added the above context into extensions_custom.conf I want the caller id rewritten and then to continue processing in the normal way.


what has happened now is it shows 1234567890 - so the 44 is removed as desired but I need to add the 0


Asterisk = ONLINE | Dahdi = ONLINE | MySQL = ONLINE x

x SSH = ONLINE | Apache = ONLINE | Iptables = OFFLINE x

x Fail2ban = ONLINE | Internet = ONLINE | Ip6Tables = ONLINE x

x Disk Free = ADEQUATE| Mem Free = ADEQUATE| NTPD = ONLINE x

x SendMail = ONLINE | Samba = OFFLINE | Webmin = ONLINE x

x Ethernet0 = ONLINE | Ethernet1 = N/A | Wlan0 = N/A x

x x

x PIAF Installed Version = 2.0.6.4 under *VMWARE* x

x FreePBX Version = 2.11.0.43 x

x 2.11 x

x Running Asterisk Version = 11.5.1 x

x Asterisk Source Version = 11.5.1 x

x Dahdi Source Version = 2.7.0.1 x

x Libpri Source Version = 1.4.14 x

x IP Address = 192.168.50.50 on eth0 x

x Operating System = CentOS release 6.4 (Final) x

x Kernel Version = 2.6.32-358.6.2.el6.i686 - 32 Bit x


many thanks for your input
 

ostridge

Guru
Joined
Jan 22, 2015
Messages
1,618
Reaction score
517
Hi sorry for delay to reply.

CUT
CUT(varname,char-delim,range-spec) Slices and dices strings, based upon a named delimiter.
(from linux CLI )
Code:
 asterisk -x "core show function CUT"

You know about
SET assigns a value to a channel variable.
Code:
 asterisk -x "core show function SET"

Or search for the above functions at: http://www.voip-info.org
perhaps some help with variable math and concatenation might help in:
http://www.voip-info.org/wiki/view/Asterisk+variables

There may be some consequences as country codes are as you know - not fixed number of digits so may need multiple definitions, or perhaps block certain countries to just accept +44 etc.
[URL='http://pbxinaflash.com/commun...-countries.45/']IPtables: BlackList Countries[/URL]
Regards
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,607
Reaction score
826
There is a context that asterisk provides called "from-pstn-e164-us" in /etc/asterisk/extensions.conf I would suggest you take that as a template and write your own "from-"pstn-e164-uk" , All NANP numbers are "closed" in that they are all (apart from short codes like [34568]11) of the form 1NXXNXXXXXX. Where the initial 1 is the NANP country code (not strictly just the US), yours of course is 44 , the first NXX is the area code, the second NXX the office/(exchange) code, the last 4 the subscriber extension at the above officecode/area code.

For the uk the rules are now maintained by Oftel and a little more byzantine , a summary at

https://en.wikipedia.org/wiki/List_of_dialling_codes_in_the_United_Kingdom

So be careful if your Granny lives in Brampton :)

(think yourself lucky you don't live in Italy)
 
Last edited:

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,607
Reaction score
826
I suspect that the "special case" of Brompton is rooted in the "special case" of Carlisle and it's licensing laws and brewery ownership back in c1916, identified by the munitions factories that tended to produce not so good "product" after lunchtime, I might be wrong :)
 

Members online

No members online now.

Forum statistics

Threads
25,778
Messages
167,504
Members
19,198
Latest member
serhii
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.
Top