Outbound Routes (Multiped Dialplan Expressions)

Status
Not open for further replies.

Incred

Member
Jun 25, 2023
53
0
6
51
When I create an outbound I have the option to select multiple dialplan expressions.

When I save the outbound route two entries are created.
1) One has the gateway name followed by the last dialplan RegEx
2) Once is called call_direction-outbound

It appears that only the last of the dialplan entries is recorded when I save the outbound route however I believe I can have multiple dialplan entries in a single outbound route?

Should I add the missing dialplan entries to both the outbound routes entires listed above? I am not sure how the two are related and why I have two.
 

hamagid

Member
Dec 14, 2020
78
8
8
33
The call_direction-outbound is only created to make sure the call is labeled as an outbound call.
 

hamagid

Member
Dec 14, 2020
78
8
8
33
You can have all your outbound routes regex conditions in one call_direction-outbound condition.
Code:
<condition field="destination_number" expression="^(\d{7})$" break="on-true">
    <action application="export" data="call_direction=outbound" inline="true"/>
</condition>

<condition field="destination_number" expression="^\+?1?([2-9]\d{2}[2-9]\d{2}\d{4})$" break="on-true">
    <action application="export" data="call_direction=outbound" inline="true"/>
</condition>

<condition field="destination_number" expression="^(011|\+)(\d{1,18})$" break="on-true">
    <action application="export" data="call_direction=outbound" inline="true"/>
</condition>
 

Incred

Member
Jun 25, 2023
53
0
6
51
Thank you for your response and help however I am still unsure here.

To be specific, I have a single outbound route that I wish to match against four dialplans. When I create an outbound route it only records the last dialplan. I understand from your post above that I can simply add the additional dialplans directly to the call_direction-outbound entry. Do I simply do the same for the 2nd outbound route entry "FAK003323.10d" and add the missing three dialplans there too (and change the name)?Outbound1.pngOutbound2.pngOutbound3.png
 

hamagid

Member
Dec 14, 2020
78
8
8
33
Adding those to the call_direction-outbound, will only set the $call_direction to "outbound", it won't actually route your calls.

You can add those conditions in the same way to your outbound route dialplan, so the outbound route will catch all of those dialed scenarios and route them the same.

There are more ways to add multiple dial patterns to a dialplan, you can use a single regex line to catch all of the scenarios, or you can use:

<condition regex="any" continue="true">
<regex field="destination_number" expression="xxxx"/>
<regex field="destination_number" expression="xxxx"/>
<regex field="destination_number" expression="xxxx"/>
 

Incred

Member
Jun 25, 2023
53
0
6
51
Does this look correct for the call_diurection-outbound Diaplan? I am not sure what to enter/select for Break, Inline and Order.Outbound4.png
 

Incred

Member
Jun 25, 2023
53
0
6
51
Ok, I just don't get it however I need to get it working. Can someone please advise if this will work:Outbound5.png
 
Status
Not open for further replies.