09 Transfer Parameters: `blxferVariables`


09 Transfer Parameters: blxferVariables

blxferVariables is used to pass channel variables in transfer operations such as blxfer() (blind transfer). Common use cases include cross-department transfers and SIP header passthrough.

1. Data structure

  • Type: ChannelVariable[]
  • Max items: up to 5

Example:

[
  { "name": "mainUniqueId", "value": "${cdr_main_unique_id}", "type": 2 },
  { "name": "userFiled", "value": "${BASE64_ENCODE(${cdr_main_unique_id})}", "type": 2 }
]

Field meanings (aligned with 06-Types.md):

FieldMeaning
nameVariable name
valueVariable value (channel variable value or SIP header value)
typeVariable type (see below)

2. type values

typeCategoryNotes
1Normal channel variableSupports ${} references to existing channel variables
2SIP header variableWhen placing a call, the system may prepend X-Asterisk- to the header name; P-Tinet- keeps its prefix; P-User- indicates a custom header name with automatic prefix removal
3Normal variable (auto-wrap value with ${})For downstream systems that do not accept ${} in input
4SIP header (auto-wrap value with ${} and no prefix per convention)For downstream systems that do not accept ${} in input

2.1 type=1 (channel variable)

[{ "name": "userFiled", "value": "111222", "type": 1 }]
[{ "name": "userFiled", "value": "${cdr_main_unique_id}", "type": 1 }]

2.2 type=2 (SIP header variable)

Two common patterns for value:

// Pattern A: client encodes base64
[{ "name": "userFiled", "value": "MTExMjIy", "type": 2 }]

// Pattern B: server-side expression does BASE64_ENCODE (common for passing a local-department variable cross-department)
[{ "name": "userFiled", "value": "${BASE64_ENCODE(${cdr_main_unique_id})}", "type": 2 }]

Header naming rules (summary):

  • Name abc → actual header X-Asterisk-abc
  • Name starts with P-Tinet- → keep header name as P-Tinet-xxx
  • Name starts with P-User- → remove the prefix and send header as xxx

3. Cross-department caller ID (example)

By default, the caller ID may be the outbound caller ID of the originating department. If you want the customer’s real number to be used as caller ID:

{ "name": "cust_callee_clid", "value": "${cdr_customer_number}", "type": 1 }

4. How the destination department retrieves values (examples)

4.1 Read SIP header in an IVR variable node

Variable name: parent_unique_id
Variable value: ${PJSIP_HEADER(read,X-Asterisk-parent_unique_id)}
Value type: expression

4.2 Decode the value in HTTP interaction / hangup push

parent_unique_id=${BASE64_DECODE(${parent_unique_id})}