Is it possible to have multiple time conditions slaved to one setting ?

Status
Not open for further replies.

neeek

Member
Mar 12, 2021
31
4
8
41
Hi

I have a particular client on a multi tenant fusion instance, that has 5 inbound DIDs, each DID routes to a separate time condition, as each of the time conditions have a different match destination (but the failover destination is the same for all 5 time conditions)

As all of the match time conditions are the same (office hours) I was wondering if there is an easy way to set things so that any changes would only have to be done to one time condition and the others would copy those settings, so I wouldnt have to edit 5 time conditions everytime the client changes their mind on what their operating hours are ?

Or maybe could I add a variable to an inbound DIDs call, send all DIDs to the same time condition and have the match condition for the time condition route depending on that variable ?

Nic
 

agree

Member
Aug 26, 2018
135
24
18
You're asking for an easy way; you can 'easily' achieve this with a dialplan if you know how to write XML dialplan
 
  • Like
Reactions: neeek

neeek

Member
Mar 12, 2021
31
4
8
41
You're asking for an easy way; you can 'easily' achieve this with a dialplan if you know how to write XML dialplan
I figured as much, but the issue with that is that I would be the only guy who understood what that specific dialplan did :)
I am already the Regex guy at work, dont really want to be the dialplan guy as well ;)

I will give it a bash though :)
 

neeek

Member
Mar 12, 2021
31
4
8
41
You're asking for an easy way; you can 'easily' achieve this with a dialplan if you know how to write XML dialplan
I found a post with a similar request to mine (not sure how I completely missed that one) and played around with XML dialplans on my "testbench" PBX
and I got what I was after working by setting a variable (my_dest) in the inbound route and then in the time condition the alternate/timeout destination
I had:
<action application="transfer" data="${my_dest} XML pbx.whatever.com"/>

But as soon as someone makes a change to the time condition using the Applications > Time Conditions page, that all gets overwritten..
I guess I could make a dialplan for the routing and do the data="${my_dest} XML bit there, but that will confuse the client logging in to change the times
 

whut

Member
Dec 23, 2022
228
22
18
I found a post with a similar request to mine (not sure how I completely missed that one) and played around with XML dialplans on my "testbench" PBX
and I got what I was after working by setting a variable (my_dest) in the inbound route and then in the time condition the alternate/timeout destination
I had:
<action application="transfer" data="${my_dest} XML pbx.whatever.com"/>

But as soon as someone makes a change to the time condition using the Applications > Time Conditions page, that all gets overwritten..
I guess I could make a dialplan for the routing and do the data="${my_dest} XML bit there, but that will confuse the client logging in to change the times
yes you can get it working by editing the time condition dialplan or time condition xml. but the customizations will be overwritten whenever the time condition is saved. the time condition gui takes priority and is the 'owner' of the dialplan.
 

agree

Member
Aug 26, 2018
135
24
18
yes you can get it working by editing the time condition dialplan or time condition xml. but the customizations will be overwritten whenever the time condition is saved. the time condition gui takes priority and is the 'owner' of the dialplan.
@whut You can write a time condition dialpan that isn't linked to the time condition page.
 

agree

Member
Aug 26, 2018
135
24
18
Here's something I quickly wrote (without testing) to give you an idea.

XML:
<extension name="DID-Time-Condition" continue="true" break="on-false">
    <condition regex="any">
        <regex field="destination_number" expression="234557890"/>
        <regex field="destination_number" expression="234557891"/>
        <regex field="destination_number" expression="234557892"/>
        <regex field="destination_number" expression="234557893"/>
        <condition wday="2-5" time-of-day="09:00-18:000" break="on-false">
            <action application="set" cond_mtached="true" inline="true"/>
            <action application="log" data="info time condition matched" inline="true"/>
            <anti-action application="log" data="info time condition didn't match" inline="true"/>
            <anti-action application="transfer" data="alternate_dest"/>
        </condition>
    </condition>
    
    <!--if the above matched-->
    <condition field="${cond_mtached}" expression="^true$">
        <condition field="destination_number" expression="234557891" break="on-true">
            <action application="transfer" data="dest1"/>
        </condition>
        <condition field="destination_number" expression="234557892" break="on-true">
            <action application="transfer" data="dest2"/>
        </condition>
        <condition field="destination_number" expression="234557893" break="on-true">
            <action application="transfer" data="dest3"/>
        </condition>
    </condition>
</extension>
 
  • Like
Reactions: pksml and neeek

whut

Member
Dec 23, 2022
228
22
18
@whut You can write a time condition dialpan that isn't linked to the time condition page.
yes you can! that may be a nice method to get around this issue. it gets you away from the nice gui method. benefits and drawbacks to the 'dialplan' method and the 'time condition' method.
 

neeek

Member
Mar 12, 2021
31
4
8
41
I would prefer to keep a time condition that is linked to the time condition page, as a few of our clients have limited logins so that they can manage things like call forwards and times and such.

I can always do the custom xml dialplan as a separate thing, I suppose the question then is how to "register" that dialplan so that it shows up as a selectable destination in the dropdown..
 

neeek

Member
Mar 12, 2021
31
4
8
41
Sweet :)
I guess I have to create the dialplan first using the GUI, set Destination=true, and only then edit the XML. (and add a "DO NOT EDIT" description :rolleyes:)

Thanks
 

neeek

Member
Mar 12, 2021
31
4
8
41
I don't understand what this will achieve. Could you please elaborate?
That setting will allow the custom dialplan to be selected as a destination for example:
routebysouce.jpg

Basically anywhere where you choose where to send a call in the GUI via a dropdown, that custom dialplan will show up
 
Status
Not open for further replies.