Dynamic Route Get earlier IVR response

I am looking to see if I can use dynamic routes to forward calls based on an earlier IVR selection to a corresponding announcement if no one in a ring group answeres.

I have a small shop and we use the IVR mainly to answer common questions and then forward to a single ring group for all the phones with thier IVR selection added to the CID. I want to add time conditions after the IVR and Caller Id Set, but before the ring group. Right now that means 7 or 8 time conditions going to 4 or 5 duplicate ring groups so if theres no answer they go the correct voicemail instructions (Announcement) which all lead back to the same voicemail. Basically our IVR herds cats…

I am thinking I can use a dynamic route after a single ring group to then redirect to the correct announcement based on what option they selected. On another post I found this,

$["${CALLERID(name)}"=“Potential Spam”]

using the caller name to decide, I think this could work, We put the option selected in front of the caller name (eg: “Sales: John Doe”) But I would need to have a wild card for the rest of the CID. I’m not sure if that is a regular expression or just a text search.

The other option I thought might be more robust is if there is a variable set for the option they chose earlier that could be retrieved. Like IVR ID 3 Option 1,2,3 etc.

Thanks in advance

If the can prefix is a consistent number of characters (say 4) then you can branch call flow with a dynroute checking asterisk variable


then define all the possible 4 character prefixes as conditions.

[edit - fixed expression to ${CALLERID(name):0:4}]

That should work, they are not all the same length but, if I go 4 or 5 characters in, they are all different.

I would still be curious if its possible to retrieve the menu option pressed later in a call. As a variable.

Not possible using dialplan. The IVR module does not save the caller input in a channel var.

${CALLERID(name):4} Has to be ${CALLERID(name):0:4} For this to work.

:4 presumably would strip the first 4 characters, rather then strip beyond them. Although I did not actually test that.

1 Like

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