Something like this might work:
String callingNumber
String newCallingNumber
callingNumber = Get Call Contact Info (--Triggering Contact--,Calling Number)
Calling Number: |
callingNumber |
Called Number: |
|
Arrival Type: |
|
Last Redirected Number: |
|
Original Called Number: |
|
Dialed Number: |
|
Set newCallingNumber = callingNumber.substring(1,5) + " " + callingNumber.substring(5,8) + " " + callingNumber.substring(8);
/* Single space between quotes */
/* Formats the number XXXX XXX XXX.
This assumes the length of the Calling Number is 11 characters. Some length check of the calling number would be wise otherwise (try/catch?), this could possibly throw an IndexOutOfBoundsException exception */
Send the newCallingNumber to your CRM. You may need to set a PV or ECC variable to newCallingNumber before exiting this UCCX script before sending it to your CRM.
I'm in a UCCE/ICM/IPIVR environment so I don't know how you would send the information to your CRM in a strictly UCCX environment.
Bill