Switchvox - How to strip the "+" sign from the caller ID number using an IVR

Switchvox - How to strip the "+" sign from the caller ID number using an IVR

For Digium SIP Trunks (including DCS accounts), the incoming caller ID will always come in with a "+" in the caller ID number field.
This cannot be changed on a trunk level, however, this can be worked around using an IVR. 

 

The following 4 actions in the following order will strip the leading plus sign:

  1.  Set Variable (Set CHAN_CID_CHAR = CALLER_ID_NUMBER)

    1. Create an action with the Action Type "Set Variable"

    2. In the "Variable to set" section, enter "CHAN_CID_CHAR" in the "Create a new variable" field. 

    3. In the "Set to value of" section, select "CALLER_ID_NUMBER" in the "System Variable" drop down.

    4. Save

  2. Set Variable (Set CHAN_ONE_INT = "1")

    1. Create an action with the Action Type "Set Variable"

    2. In the "Variable to set" section, enter "CHAN_ONE_INT" in the "Create a new variable" field. 

    3. In the "Set to value of" section, enter "1" in the "Static Value" field.

    4. Save

  3.  Perform Math (CHAN_CID_CHAR * CHAN_ONE_INT = CHAN_CID_INT)

    1. Create an action with the Action Type "Perform Math"

    2. In the dropdowns in the "Choose the variables for your operands and the desired operation" section select "CHAN_CID_CHAR", "*", and "CHAN_ONE_INT"

    3. In the "Variable Name for Result" field enter "CHAN_CID_INT"

    4. Save

  4. Alter Caller ID (Replace with CHAN_CID_INT)

    1. Create an action with the Action Type "Alter Caller ID"

    2. In the "How do you want to modify the Caller ID?" dropdown, select "Replace with"

    3. In the "Which part of the Caller ID do you want to modify?" dropdown, select "Caller ID Number"

    4. In the "Use the text from this variable" dropdown, select "CHAN_CID_INT"

    5. Save

 

You can then add a "Dial Extension" action to send the call to the desired extension, but the CID will no longer have the "+" sign. 

 

The way this works is because the "Perform Math" action casts the CID from a String to an Integer (thus dropping the +) and then replacing the CID number with the result of this.