Add prefix to inbound number

Status
Not open for further replies.

rstefko

Customer
Joined
May 29, 2019
Messages
10
Reaction score
3
Whenever someone from Czech republic calls our number we get number without country prefix. Regular Czech numbers always have 9 characters. I would like to add 00420 as a prefix to the number when the number has exactly 9 digits. I know about https://www.3cx.com/docs/cid-reformatting/ but I was not able to make this work. Does anyone has any ideas?
 
Hi @rstefko

What does the provider send you when you get international incoming calls?

Might be a good idea to run a capture and ask someone to call you from an international number, without any CID Inbound reformatting options enabled on your system.

The invite from the provider should show you what number the PBX actually receives.
 
When it is international number we get something like +421XXXXXXXXX.
 
Ok so best to check via a capture to verify what appears in the INVITE message, and then add an Inbound reformatting rule to adjust this

The rule would most likely need to be

Source: (.........)
Replace: 00420\1
 
I have already tried this before, but it does not work as expected.
When the number is 00421123456789 it ends up as 00420004211234.
 
For CID replacement to work properly, the prefix you want to change must be unique when compared to numbers you don't want modified. If the country code, or a unique prefix, is not available, then you have nothing to modify, and only succeed in adding digits to all incoming numbers, whether you intend to or not.
 
Last edited:
  • Like
Reactions: JohnS_3CX
In addition to what @leejor said above, before you modify any incoming numbers you need to know exactly what the provider sends in the INVITE message. Then, if you know the first few digits of your numbers of interest, it becomes possible to write rules that apply only to those specific numbers.

This course here will help you better understand how CID reformatting works, with some examples.

Course: https://www.3cx.com/3cxacademy/videos/advanced/configuring-inbound-routing/
Pre-recorded webinar:
 
OK. So as a first rule I catch numbers with 00 prefix (00)(.*) and left them as they are with replacement patter n \1\2. It seems to work.
 
Hi @rstefko

Are you based in Slovakia or in the Czech republic?
 
Czech republic.
 
Ok so for 9 digit number you can use reformatting as those will all come from Czech republic.

You said "When the number is 00421123456789 it ends up as 00420004211234. "

These appear to be Slovak numbers (+421) and the provider should send them to you complete with country code, making them over 9 digits. The rule should not apply for numbers over 9 digits.

So the rule below should work as expected:

Source: (.........) example: 123456789 where each dot in the parenthesis means 1 digit
Replace: 00420\1 should become 00420123456789 where \1 means all the contents of the parenthesis
 
I already have it working. See the screenshot with working version.
 

Attachments

  • Annotation 2019-06-03 142144.png
    Annotation 2019-06-03 142144.png
    34.7 KB · Views: 42
  • Like
Reactions: JohnS_3CX
The first rule should not really be necessary.
 
Status
Not open for further replies.

Forum statistics

Threads
111,926
Messages
589,764
Members
164,799
Latest member
RicoDinero