Rate this page:

Using standard variables

Standard variables are the default system variables built in Scenario Editor that you can call in your scripts. These variables provide information about things the system tracks automatically, such as the caller’s phone number, or the name of the agent associated with the call.

Supported standard variables:

  • {{CALL.variable}}

  • {{AGENT.variable}}

  • {{HEADERS.variable}}

CALL object

The CALL object stores variables required to start and process a call.

Here is the list of variables you can view in CALL:

  • {{CALL.phone_a}} – Represents the phone number of the caller (for outbound calls – it is your caller ID).

  • {{CALL.phone_b}} – Represents the phone number of the callee (for inbound calls – it is your caller ID).

  • {{CALL.record_url}} – Stores the call recording URL (if the call recording is activated). You can use it to forward the call recording to the customer’s data base, if required.

  • {{CALL.id}} – Represents the call attempt identifier. This value is filled in only after a call ends. This variable is valuable only for HTTP-requests upon completion of the scenario (Outbound call block). In other cases, this value is empty.

  • {{CALL.result_code}} – Represents the call result code. This value is filled in only after a call ends. This variable is valuable only for HTTP-requests upon completion of the scenario. It helps you evaluate whether a customer dropped the call, or the scenario reached its ending point. You can review these codes in call reports.

Here is the list of available call result codes:

1

Voicemail detector

2

Initiated by the callee

3

End of the scenario

200

The callee is answered

486

The number is busy

408

The callee has not answered

487

The callee has not answered

500

The callee has not answered

603

The call has been declined

404

Invalid number

480

The callee is unavailable

403

Call is forbidden

0

There was no call

4

The call is interrupted by the Stop button

  • {{CALL.attempt_num}} – Represents the call attempt number. It is valuable for calling campaigns. For any other calls, this value is 1.

  • {{CALL.session_id}} - Stores the Voximplant session identifier.

  • {{CALL.callerid}} – This value is the same as {{CALL.phone_a}} but differs for SIP inbound calls.

  • {{CALL.destination}} – This value is the same as {{CALL.phone_b}} but differs for SIP inbound calls.

  • {{CALL.display_name}} – Represents the display name for SIP calls. In PSTN, it matches the caller telephone number.

AGENT object

The AGENT object stores the information about the agent who answered the call in the Call to Queue block of your scenario.

Here is the list of variables you can view in AGENT:

  • {{AGENT.id}} – Represents the identifier of the agent who answered the call from queue.

  • {{AGENT.full_name}} – Stores the name of the agent who answered the call from queue. This is the Name field value in the Profile settings.

  • {{AGENT.username}} – Represents the username of the agent who answered the call from queue. Username usually looks like admin or user-123.

  • {{AGENT.email}} – Stores the email address of the agent who answered the call from queue. You enter this value in the Email address field in the Profile settings.

Assume that the agent’s name is John Smith, his id is 12345, and his email address is jsmith@example.com. {{AGENT}} object will look like: {"id":12345,"full_name":"John Smith","username":"jsmith","email":"jsmith@example.com"}.

HEADER object

When a SIP call is forwarded to your inbound scenario, you may also receive meaningful headers with it. Such headers provide information about the SIP call, and you can change, process and control them if necessary.

By default, all headers are stored within the {{HEADERS}} variable.

Voximplant Kit can process the following headers:

  • X - A SIP header that begins with X can be used to convey any information. For example, an X-Header is often used to convey a subscriber account number for billing.

  • P - P-Headers are special header fields whose applicability is limited to private networks with a certain topology and characteristics of lower layers' protocols.

  • Diversion - The diversion header contains the redirection information of the call, including the reason for diversion.

All headers are stored in a single variable and may look like this: {“X-name”:”value”, “X-time”:”int”}.

To access a header information, you need to call a specific header using the general variable {{HEADERS}}. For example, you need the value of “X-name” header. It will be available upon this call: {{HEADERS.X-name}}.

From Voximplant Kit side, you can ONLY send X-Headers during SIP call transfer.