cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3414
Views
10
Helpful
15
Replies

Route customer call to a specific agent based on calling number

Steve W
Level 1
Level 1

Hello All,

Long time reader, first time posting.

I am using UCCX version 8.5

I have had a customer service agent ask me if I can automatically route calls from specific customers to him.

Is there a way to route a call from a customer, to a specific agent, based on that customer's calling number?

Thank you in advance,

Steve

3 Accepted Solutions

Accepted Solutions

Just focusing on your immediate need, you would solve that problem like this:

if (strCallingNumber == Customer_1 || strCallingNumber == Customer_2 || strCallingNumber == Customer_3 || ..)

However, a slighty better approach would be to have all the calling numbers in a single string, separated by a delimeter, and then perform a search function within the String.

Example:

Variables

String calling_number = "6125551313"

String calling_numbers = "6125551212,6125551313,6125551414"

Script

if (calling_numbers.indexOf(calling_number) >= 0)

  true

    /* The calling number is in the list */

  false

    /* The calling number is not in the list */

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.

View solution in original post

Could you clarify what you said here:

Steve Wolfe wrote:

...unfortunately it routed the call to the specific agent every time and did not take the calling number into consideration...

The solution I have given you would only work for a single agent.  If you had multiple agents, and multiple calling numbers per agent, another way to do it would be with a HashMap like this:

Example:

Variables

java.util.HashMap cgn_to_cs = {

  java.util.HashMap map = new java.util.HashMap();

  map.put("6125551212", "avholloway");

  map.put("6125551313", "avholloway");

  map.put("6515551212", "ekholloway");

  map.put("6515551313", "ekholloway");

  ...just keep adding as many mappings as you need to...

  return map;

}

String calling_number = ""

User cs_rep = null

Script

Set calling_number = "6515551212"

if (cgn_to_cs.containsKey(calling_number))

  true

    /* Calling number found, store the agent username */

    Set cs_rep = USER[(String) cgn_to_cs.get(calling_number)]

  false

    /* Calling number not found */

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.

View solution in original post

I see where it went wrong.

You would have needed to use the strCallingNumber variable, which you used with the Get Call Contact Info step, down in the If step.  Because you used the Calling_Number variable, and it's hard coded to "13035551234", it would never give you a different result, no matter where you called from.

I hope that helps.

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.

View solution in original post

15 Replies 15

thomascollins
Level 3
Level 3

Hi Steve,

Sure -- almost anything is possible with scripting.  In your IVR script you can easily check the ANI (calling number).  Then you could use the script to transfer it directly to the agent.  Or if you wanted to get more fancy you could put that call into a special queue, where that one agent is the highest skilled, but others are available as backups.

Tom

Happy Monday Tom,

Thank you for the reply.  I am able to get the calling number, that should not be a problem.

Do I need to add a statement to say " if calling number =123-456-7890 then..

Would I do a Call Redirect, or Select resource, and then somehow choose the agentid?

If I choose call redirect, will the stats still show in the historical reports?  Or would I then have to use CDR for stats?

Any extra info would be greatly appreciated, I am relatively new to uccx and I'm still learning the scripting.

Thank you for your time!

Steve

Steve, To rout to a specific Agent and keep stats, you would use the Select Resource step, just change it from routing to a CSQ to route to an Agent (Resource). The negative here is that you cannot "queue" to a single resource this way, so it' a one shot thing.  Either the Agent is Ready, or their not, and then you have to script for that contingency. One way to work around that is to create a CSQ for each Agent, and only skill that one Agent in their own queue, but that does not scale well at all.  I'm not sure how large your CC is, or how large your servers/OVA's are.

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.

Hi Anthony,

Thank you very much for the reply.  The CS department is relatively small, around 25 agents.

I have tried to follow your advice, this is what I have so far

Accept

Get Call Contact Info 

Then I created a variable strCallingNumber.  I also added 7 variables Customer_1 Type= string Value=number Customer_2 etc

I then have an IF statement. 

What I would like to do is  IF strCallingNumber == "Customer_1" "Customer_2" "Customer_3" etc...

TRUE = route the call to Select Resouce 

Type=Resource Resource Target= TempResourceSelectedVar2 Resource Selected Alex (The CS agent)  I added a variable Alex type=user  value= username

FALSE = send to main CSQ

The problem I ran into is in the IF statement, it will Not let me use the following:

strCallingNumber == " Customer_1 " " Customer_2"

It Will let me use 1 variable. I.E 

strCallingNumber == " Customer_1"

Works fine

I need a way to compare the strCallingNumber against my customer numbers.  All of my customer numbers are String variables, value = customer number.

I have added my script to this reply, it might be easier to see it.

Thanks again for your time,

Steve

Just focusing on your immediate need, you would solve that problem like this:

if (strCallingNumber == Customer_1 || strCallingNumber == Customer_2 || strCallingNumber == Customer_3 || ..)

However, a slighty better approach would be to have all the calling numbers in a single string, separated by a delimeter, and then perform a search function within the String.

Example:

Variables

String calling_number = "6125551313"

String calling_numbers = "6125551212,6125551313,6125551414"

Script

if (calling_numbers.indexOf(calling_number) >= 0)

  true

    /* The calling number is in the list */

  false

    /* The calling number is not in the list */

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.

Hi Anthony,

That worked perfectly.  Thank you for all of your time on this issue.

I would absolutely agree that a better approach would be using the String calling_numbers = "6125551313,6125551310"

I tried it and unfortunately it routed the call to the specific agent every time and did not take the calling number into consideration (I'm sure it's something I missed)

I have uploaded my working script.  Hopefully it might benefit someone else in the near future.

Thanks again for your help, I owe you a coffee.

Steve

Could you clarify what you said here:

Steve Wolfe wrote:

...unfortunately it routed the call to the specific agent every time and did not take the calling number into consideration...

The solution I have given you would only work for a single agent.  If you had multiple agents, and multiple calling numbers per agent, another way to do it would be with a HashMap like this:

Example:

Variables

java.util.HashMap cgn_to_cs = {

  java.util.HashMap map = new java.util.HashMap();

  map.put("6125551212", "avholloway");

  map.put("6125551313", "avholloway");

  map.put("6515551212", "ekholloway");

  map.put("6515551313", "ekholloway");

  ...just keep adding as many mappings as you need to...

  return map;

}

String calling_number = ""

User cs_rep = null

Script

Set calling_number = "6515551212"

if (cgn_to_cs.containsKey(calling_number))

  true

    /* Calling number found, store the agent username */

    Set cs_rep = USER[(String) cgn_to_cs.get(calling_number)]

  false

    /* Calling number not found */

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.

Hi Anthony,

The problem I encountered was, it always routed the call to agent John Smith, regardless of the Calling Number,

My goal was, if the calling number is 1234 or 5678, it should go to John Smith, if the calling number does not match those 2 numbers, then it should go to the main Queue.

So, when I called from number 5555, it should have gone to the main queue, but instead it went to agent John Smith.

I hope that helps?

I've taken a look at the second script you posted and it looks fine.  Was it with the second script you had that happen?  does it work ok now?

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.

Hi Anthony,

The final script that I previously posted is a working script, no issues there.  You saved the day

After you mentioned there was a better way to do it using " have all the calling numbers in a single string " I completely agree and tried it myself but had no luck. 

I have attached that non working script to this post.

Thanks!


I see where it went wrong.

You would have needed to use the strCallingNumber variable, which you used with the Get Call Contact Info step, down in the If step.  Because you used the Calling_Number variable, and it's hard coded to "13035551234", it would never give you a different result, no matter where you called from.

I hope that helps.

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.

Hey Anthony,

That worked perfectly. 

After reading your post and take several looks at my script, it seems obvious now.

Thanks again for all of your time and assistance!

I'm very happy to hear it.  Thanks for the positive feedback.  See you around Steve!

Anthony Holloway

Please use the star ratings to help drive great content to the top of searches.

Hi Steve Wolfe,

 

I try to use this script you attached, but after 30s if i don't pick up this call, the system will announce the error message. After that, the system always inform the messeage error.

Please help me this case.

Thank you.