Jump to content

Dialplan logic


cphtdk

Recommended Posts

Hi,

 

I would like to specify a specific trunk for mobile phones.

The mobilephone prefixes are as follows:

020xxxxxx

030xxxxxx

031xxxxxx

040xxxxxx

041xxxxxx

042xxxxxx

050xxxxxx

051xxxxxx

052xxxxxx

053xxxxxx

060xxxxxx

061xxxxxx

071xxxxxx

081xxxxxx

091xxxxxx

 

In Asterisk this would actually be the dialplan, but i cannot figure it out in Snom.

Would there be an easy way to do this?

 

The 2 range I can get working with 0([2][0-9]{7})@.*

but why whould the 30/31 range not be matched by 0([3][0-1]{7})@.*

I don't get it....

 

Brgds

Thomas Jensen

Link to comment
Share on other sites

You can use

Pattern: ^0([2-9][0-3][0-9]{6})@.*

Replacement: sip:0\1@\r;user=phone

 

The above is very specific to your example. It translates to "start matching from the beginning of the dialed number, first digit 0, second digit anything between 2-9, 3rd digit anything between 0-3, then followed by 6 digits between 0-9"

Link to comment
Share on other sites

  • 4 weeks later...

You can use

Pattern: ^0([2-9][0-3][0-9]{6})@.*

Replacement: sip:0\1@\r;user=phone

 

The above is very specific to your example. It translates to "start matching from the beginning of the dialed number, first digit 0, second digit anything between 2-9, 3rd digit anything between 0-3, then followed by 6 digits between 0-9"

 

Thank you for the hint.

 

I ended up adding all these lines to cover all of the above prefixes:

^0([2][0-9]{7})@.*

^0([3-6][0-1][0-9]{6})@.*

^0([4-5][3][0-9]{6})@.*

^0([5][3][0-9]{6})@.*

^0([7-9][1][0-9]{6})@.*

 

Quite a complicated setup...

 

/Thomas

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