cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
226
Views
3
Helpful
2
Replies

UCCX 12.5 - convert name to decimal code

Bill Elmore
Level 1
Level 1

I am working on a project that requires taking a "Customer Name" string and converting it to touch tone/decimal code so that we can transmit that name along with account number to our payment company via DTMF.  (I know....welcome back to the '90s).  The payment company's system needs a # before each decimal code and it only supports upper case.

If String customerName = "JIM JONES", the result needs to be String TTcustomerName = "#74#73#77#32#74#79#78#69#83"

This part is making my head hurt, so any good ideas are appreciated.

1 Accepted Solution

Accepted Solutions

@Bill Elmore 

You can achieve this conversion by using Java code snippet applied in set variable node. On the screenshot is the result of active debug.

Marekgamangtcom_0-1729616173479.png

Link to the sample script: Link 
Code in set variable node:

{
	String tempCustomerName = "";
	int i =0;
	for(i = 0; i < customerName.length(); i++) {
  		tempCustomerName += "#" + (int)customerName.charAt(i);
	}
	return tempCustomerName;
}

Hope that helps you.

Marek https://gaman-gt.com
UCCE, PCCE, UCCX, WxCC, Cisco Finesse, Custom Gadget, CVP, CUIC, CUCM

View solution in original post

2 Replies 2

@Bill Elmore 

You can achieve this conversion by using Java code snippet applied in set variable node. On the screenshot is the result of active debug.

Marekgamangtcom_0-1729616173479.png

Link to the sample script: Link 
Code in set variable node:

{
	String tempCustomerName = "";
	int i =0;
	for(i = 0; i < customerName.length(); i++) {
  		tempCustomerName += "#" + (int)customerName.charAt(i);
	}
	return tempCustomerName;
}

Hope that helps you.

Marek https://gaman-gt.com
UCCE, PCCE, UCCX, WxCC, Cisco Finesse, Custom Gadget, CVP, CUIC, CUCM

Bill Elmore
Level 1
Level 1

Thank you, Marek.  That's exactly what I needed!