Route Calls based on Location

Just wondering if anyone has experience in routing calls based on the location that the client is calling from, and how to go about starting that.

I have tried testing with setting the participant data to the ani, and then using a decision block to route if the first 3 numbers of that ani equals the area code, but it always errors and won't even let me save it as it says that I can't convert to a string.

I would suggest using an "Update Data" block and create a flow variable that will hold the ANI during the flow execution (no need to attach ANI as participant data since it is already part of the basic call data).

Once you have the ANI in a flow variable then you will likely need to manipulate it a bit because I'm pretty sure that the ANI is in the format of "tel:+18885551212". So you are going to want to use the substring() function dip into that string and grab the area code part.

So specifically, drop an "Update Data" block into your flow. Add an "Update Statement" of type string. In the variable name enter "myANI" and it will turn that into Task.myANI. In the Value to Assign field use the button to convert it to an expression and enter "substring(Call.Ani, 6, 3)". Using my example ANI, when this block is executed Task.myANI should have a value of '888'.

Now you can use a decision block to branch appropriately. I'd suggest to define a Data Table that has at least two columns, the key being the area code, and the second column being the queue name to route to. When you do a data table lookup using Task.myANI, if it returns a queue name then you can transfer the call to that queue. If there is no match for the area code in the Data Table, then you can default to a queue. Note, you'll have to use the FindQueue(string queueName) function in the Transfer to ACD block so that it converts the name of the queue from the data table into an actual queue recognizable by the Transfer to ACD block.

I hope that helps you make some progress.

1 Like

Thank you so very much that's exactly what I was hoping for! Appreciate the quick reply!