Jump to content

Rewrite global numbers


cphtdk

Recommended Posts

Hi guys,

 

We have a dialplan which includes 0 for an "outside line".

 

The problem is that all inbound calls are received from the carrier in national 8 digit format (we don't use area codes in Denmark), or international format 00[CountryCode][LocalNumber].

Thus they do not match addressbook entries. Neither is it possible to return calls from the phones call log, as the numbers lacks the 0 prefix, and therefore do not matched in the outbound dialplan.

 

Is there any way to add the 0 prefix to all calls received on a specific trunk?

 

Brgds

Thomas

Link to comment
Share on other sites

Hmm. You could assume that there is no region code, so all numbers are either international or local. That could work on inbound. Then to make an outbound call, you could use different dial plan entries and then use the replacement to fix the 0 that is being presented to the carrier:

 

Prio: 10 Pattern: 00* Replacement 00*

Prio: 20 Pattern: 0* Replacement 0045*

Prio: 30 Pattern: * Replacement *

 

At this point just an idea.

 

Generally speaking, I am a friend of numbers that you would enter in your cell phone as well. This is easy to explain to end users these days. The prefix from the old PBX days is always confusing ("How many 0 do I have to put in to make an international call???").

Link to comment
Share on other sites

  • 4 weeks later...

Hmm. You could assume that there is no region code, so all numbers are either international or local. That could work on inbound. Then to make an outbound call, you could use different dial plan entries and then use the replacement to fix the 0 that is being presented to the carrier:

 

Prio: 10 Pattern: 00* Replacement 00*

Prio: 20 Pattern: 0* Replacement 0045*

Prio: 30 Pattern: * Replacement *

 

At this point just an idea.

 

Generally speaking, I am a friend of numbers that you would enter in your cell phone as well. This is easy to explain to end users these days. The prefix from the old PBX days is always confusing ("How many 0 do I have to put in to make an international call???").

 

Hmm this really doesn’t solve the problem. The system should prefix the incoming caller id to make it work.

Skipping the 0 altogether is not an option, as it would make it impossible to write a dial plan for the phones to immediately dial the number when an extension or national number had been keyed in wothout pressing OK or waiting for a timeout.

 

I finally had to have the carrier add the prefix before sending us the call. Now everything is as we wanted it, but only thanks to our very flexible carrier.

 

 

/Thomas

Link to comment
Share on other sites

Something for the next upcoming versions is probably a dial plan for inbound purposes. We probably need to apply that inbound dial plan to every header that contains a useful Caller-ID, e.g. RequestURI, From, To and P-Asserted-Identity. The currente ERE-based list is a start, flexible, but not easy to undestand for the average PBX user.

Link to comment
Share on other sites

We have exactly the same problem using Snom ONE and a UK PRI ISDN. Other systems (Asterisk to name one) use the ISDN TON (Type Of Number) field which can be extracted from the ISDN call data.

I believe this data is already passed through to the inbound call routing rules (in the NetBorderExpress pstn.in.isdn.setup.ie.0xZZ.0xYY field), but there is no way to set the sip.out.from.uri headers using it. I'm sure some RegEx guru could write a workaround based on the binary value of the relevant ISDN headers, but I'm not that guru unfortuantely. There is already a pstn.out.phoneNumber.type, we just need a pstn.in.phoneNumber.type and we can get NBE routing rules to do the rest.

 

The "official" snom Wiki suggestion (Here...) is pretty useless too - it basically forces a 0 to be appended to every incoming call. Brilliant for local, but no use whatsoever for international calls.

 

This really needs to be resolved before we can start selling this as a serious ISDN PBX - I can't comment for SIP as all our clients so far still use ISDN for external calls.

All business users need to be able to hit the redial button on a missed call and get through. Having to guess if it was a local, national or international number is not going to go down well!

Link to comment
Share on other sites

  • 2 months later...

Ciao ragazzi,

 

Something for the next upcoming versions is probably a dial plan for inbound purposes.

 

I would urgently need this "inbound dial plan" because all my customers have trunks from at least two countries and I have to provide the callers' numbers in the international format.

 

What's the planned schedule on this topic?

 

Thanks in advance.

 

Tanti saluti

 

Florian

Link to comment
Share on other sites

The inbound dial plan can also be done with a list of extended regular expressions. Not very convenient, but it does solve the problem. For example, you could use something like this: !00([0-9]*)!+\1! !\+([0-9]*)!+\1!. Because the list is trunk specific and the service provider should usually use only one form, you should be able to translate all inbound traffic into one format (preferrably the one with the + in front of the country code). If you specify your country code in the domain settings, the PBX has also the chance to understand the number from the context and automatically convert into the global +-Format.

Link to comment
Share on other sites

  • 2 months later...

Sorry to bother you again, but unfortunately I didn't succeed to get it working.

 

Here is my requirement more in detail:

 

I have the following incoming call, which I want to send always to extension 50 (a hunt group).

In addition to that I want to see the caller's number on the phone as +40373722222 instead of 40373722222 in order to be able to use the entry from the callers' list to call back.

 

INVITE sip:40373711111@192.168.100.5:5060;transport=udp;line=a87ff679 SIP/2.0
Record-Route: <sip:85.204.232.10;ftag=c82c163e0942f84b89be068a1b2fa668;lr>
Via: SIP/2.0/UDP 85.204.232.10;branch=z9hG4bK6202.acb0fdb8515ae4f906c5fc607f3bb810.0
Via: SIP/2.0/UDP 85.204.232.10:5061;branch=z9hG4bKb971741b4a3b11e74efee46b38ad8806;rport=5061
Max-Forwards: 16
From: <sip:40373722222@85.204.232.10>;tag=c82c163e0942f84b89be068a1b2fa668
To: <sip:40373711111@85.204.232.10>
Call-ID: 49795A3309CECECA10237350FE1E11FC4564B5DE
CSeq: 200 INVITE
Contact: Anonymous <sip:85.204.232.10:5061>
Expires: 300
User-Agent: Sippy
cisco-GUID: 554731087-3059945953-3006070804-571693236
h323-conf-id: 554731087-3059945953-3006070804-571693236
Content-disposition: session
Content-Type: application/sdp
Content-Length: 266

 

Thanks in advance for your help.

 

Best regards

 

Florian

Link to comment
Share on other sites

Ok, it seems I'm still making a fundamental mistake:

 

I'm interested only in modifying the FROM address in the phone display (not at all for routing purposes), so I'm using the

expression "!([0-9]*)!+\1!f!50" in the field "Send call to extension" in the configuration of the trunk.

 

[8] 2012/06/15 15:28:38:	Call from a trunk 4
[8] 2012/06/15 15:28:38:	Trunk alonia.ro@myPbxDomain has country code not set, area code not set
[8] 2012/06/15 15:28:38:	To is <sip:40373711111@85.204.232.10;user=phone>, user 0, domain 1
[8] 2012/06/15 15:28:38:	Trying to match number 40373722222 with ERE ([0-9]*)
[8] 2012/06/15 15:28:38:	Send call to extension ERE returned +40373722222
[8] 2012/06/15 15:28:38:	User not found for account +40373722222 in domain myPbxDomain, trying to send the call to default account 50
[5] 2012/06/15 15:28:38:	Domain trunk alonia.ro@myPbxDomain sends call to 50 in domain myPbxDomain

 

As I can see from the log the regular expression prepended the plus-sign correctly but the FROM number displayed on my phone continues to be "40373722222".

 

Is the field "Send call to extension" really the right thing to achieve what I want?

 

Best regards

 

 

Florian

Link to comment
Share on other sites

As I can see from the log the regular expression prepended the plus-sign correctly but the FROM number displayed on my phone continues to be "40373722222".

 

The SIP From header has essentially two fields: The "display name" and the URI, similar to an email address. The routing is all about the URI, and what the phone displays is typically the display-name. The PBX typically does not mess with the display name, as it is really hard to say if the display name contains a name (lets say, in Japanese UTF-8 encoded) or something else valid. The only way is the address book; however in this case that does not sound like an option to me. The provider does say this call is from "40373722222", it would be better if that would be in a better readable format.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...