Custom coding for selecting IVRs

I was tasked with adding some custom code to choose between 2 different IVRs depending on the agent count of a particular queue. Due to the fact that FreePBX has control of the dialplan and any changes to the code would be overwritten, this the approach I had taken. We created a Queue called “Spanish Queue Check” which FreePBX labeled as "ivr-8. Through FreePBX, we created a Time Condition that, if the time matches, calls “ivr-8”.

I then removed the queue via freePBX and recreated the ivr-8 context in extensions_custom.conf with my own code. We tested everything and it worked: If there was no agent in the Spanish Queue, it sent the call to the English Only IVR. If there was an agent, it routed it the IVR for both English and Spanish. We modified the Queues and Time Conditions and successfully applied it to the config. Multiple times.

Now in the Time Condition under Destination if time matches, it now reads “Error” in the first drop-down and “ad Dest ivr-8,s,1” in the second dropdown. (See image at bottom.) I sort of expected as much. Even with the error, thankfully it can still be submitted and applied. Also, the line to redirect to ivr-8

exten => 9,n(truegoto),GotoIf($["${TCMAINT}"!="RETURN"]?ivr-8,s,1)

is not overwritten even though an error is reported for that setting.

So now everything is working and we are happy. However, it does leave the concern of the error being there. We are wondering if there are any pitfalls to this approach. If so, can you explain what and does anyone have a better idea?

Again, it has been tested and works perfect. We have no problem seeing the error on the Time Condition config page. Just want to know if there are any unseen concerns down the line with this.

Time Condition page image:

image

I would create a custom destination which goes to ivr-8 and point the TC to the custom destination. This way you avoid the “error”.

However, since you mentioned ‘down the line’ it appears that you are using an older version of FreePBX, consider upgrading…

Thanks for pointing that out to me. I am the asterisk programmer here, but I really don’t know freePBX. A side question here: Our client is a major insurance company, we do their customer support. The folks here are very concerned about doing upgrades. The Linux/Open Source community is notorious for upgrades the break backward compatibility. Any validity to their concerns in this case?

Are they? I can think of exactly one breaking change in Asterisk (pipe to comma) that was introduced after Asterisk 1.4 more than 10 years ago. No others are coming to mind.

PizKey. That was the ticket. Everything is great now! Thanks.

Yes, they are. Asterisk/FreePBX, perhaps not.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.