Fusionpbx outbound dialplan expressions for numbers starting 07

Status
Not open for further replies.

TimGuyUK

Member
Feb 28, 2018
105
3
18
52
Hi Guys

Im in the middle of bringing up a FusionPBX server initially for me to learn, my office and maybe to resell as a multi-tenant solution.

In my learning I am creating a layout of an office where by I want to limit what an extension can dial, either internal, local, international, premium, mobile etc.

I was going to do this with 'Toll Allow' and by creating outbound dialplan expressions of (as an example for UK mobiles) 9+07xxxxxxxxx and then assign Toll Allows to them.

Can someone give me an example of an expression to do that, and more importantly is that the way to go about limiting extension destinations?

A sub question to this is can an extension be a member of more than one Toll Allow, or can a outbound destination be a member of more than one Toll Allow

Thanks in advance.

Tim
 

JamesBorne

Active Member
Jan 24, 2019
294
57
28
Australia

TimGuyUK

Member
Feb 28, 2018
105
3
18
52
Thanks

I haven't had a chance to go back to it yet. I shall try later this week.

Does anyone have the correct fusionpbx expression for 9,07xxxxxxxxx to get me going, Ive googled and googled and tried and im just not getting it.

Tim
 

TimGuyUK

Member
Feb 28, 2018
105
3
18
52
Hang on Hang on, have I got it?

^9(07\d{9})$

I think so, quick test seams to work.

Hurra
 

TimGuyUK

Member
Feb 28, 2018
105
3
18
52
Also just tried the Toll Allow and it does what I wanted to do. What I didnt know from the docs was if the entries were fixed or free text as long as they matched. I believe they are free text, using 'mobile' as my test with my new found regex
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,498
413
83
Also just tried the Toll Allow and it does what I wanted to do. What I didnt know from the docs was if the entries were fixed or free text as long as they matched. I believe they are free text, using 'mobile' as my test with my new found regex
They are free text. Whatever you put in the Toll Allow field in the extension record or the Forwarding Toll Allow field in the ring group record just sets the ${toll_allow} channel variable. It is not implemented anywhere in the dial plan to it is entirely up to you what you do with it.
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,498
413
83
Just wondering why would you use a 9 prefix at all?
I can't answer for @TimGuyUK but here in the UK some SIP trunk providers will allow you to dial local numbers** without a city (STD) code. For example the Nottingham STD code is 0115 so you can, from anywhere in the country, call the Nottingham number 01159123456 but if you were within the Nottingham 0115 area, you could simply dial 9123456 to reach the same destination.
We also have destinations like 101 for non emergency help and 123 for the providers speaking clock, or *21 for the providers divert facility etc.

So whilst we mostly route outbound when we see a 0 (zero) I always make a prefix 9 also available so users can call 9123 etc.

I hope that makes sense.

(** The local STD code is determined by the RPID or presentation number for the SIP account)
 
Last edited:

TimGuyUK

Member
Feb 28, 2018
105
3
18
52
Just wondering why would you use a 9 prefix at all?

Ere, What Adrian said (Lol) but also tbh because the users are used to it and it sets a good virtual wall between internal and external. I have used some Ayvas that were setup with no 9 but Ive come from a Mitel background and it was always taught that way from back in the day!!!
 

TimGuyUK

Member
Feb 28, 2018
105
3
18
52
They are free text. Whatever you put in the Toll Allow field in the extension record or the Forwarding Toll Allow field in the ring group record just sets the ${toll_allow} channel variable. It is not implemented anywhere in the dial plan to it is entirely up to you what you do with it.

Thanks for the confirmation, and while Ive got you, an extension can be a member of multiple TollAllows with a , separation? Or is it a |

Tim
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,498
413
83
I have always separated different tags with commas eg GW1, GW2, GW3. What this then actually does is set the ${toll_allow} variable to be "GW1: GW2: GW3". so then it's up to you how you use it. If you wanted the condition to be true if any one of the tags is present you might test like condition ${toll_allow} TAG
Code:
<condition field="${toll_allow}" expression="GW1"/>

If you wanted to test for a $toll_allow being just one specific tag, you may use something like condition ${toll_allow} ^TAG$
Code:
<condition field="${toll_allow}" expression="^GW1$"/>

You can cut and slice it however you want.
 

EasyBB

Active Member
Oct 23, 2016
240
33
28
Australia
but here in the UK some SIP trunk providers will allow you to dial local numbers** without a city (STD) code.
Same situation here in Australia.....normally you dial 10 digit FNN (Full National Number) but to dial local, only 8 digits are required.
Yes, using prefix is the old way. If you plan your extension numbers carefully, Fusion dial plan can and will route calls without a prefix. For example our local 8 digit numbers can be matched with ^(0011613|00613|\+613|613|03)?([5-9]\d{7})$; so if i stay away from extension numbers starting [5-9], no prefix is necessary.
 
  • Like
Reactions: Adrian Fretwell

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,498
413
83
For example our local 8 digit numbers can be matched with ^(0011613|00613|\+613|613|03)?([5-9]\d{7})$; so if i stay away from extension numbers starting [5-9], no prefix is necessary.
You have inspired me to go away and think about some creative regexp!
 

EasyBB

Active Member
Oct 23, 2016
240
33
28
Australia
You have inspired me to go away and think about some creative regexp!
I just looked at my actual regex that I use; it is slightly different

Code:
^(?:0011613|00613|\+613|613|03)?([4-689]\d{7})$

I then make necessary adjustments at the bridge line based on what the provider expects (I use multiple providers- both local and international)

This one also would do the same:
Code:
^(?:0011613|00613|\+613|613|03)?([^0-37]\d{7})$
 
Last edited:

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,070
577
113
I'm UK and I never use a 9 unless the clients specifically ask for it. to get around the 101 etc I use three digit extension ranges and always start at 200.

A typical dialplan I use is multiple outbound routes in order:

International
^00(.*)$

UK Inland
^0(.*)$
Prefix 44

Local, in this case for Rochdale:
^(\d{6})$
Prefix 441706

Non-Emergency
^(101|111|105)$

Emergency
^(999|112)$
 
Status
Not open for further replies.