Route the caller to external resources (typically upstream providers).
Schema#
Validator for the resources callflow data object
custom_sip_headers#
Custom SIP headers applied to an INVITE
Special Dynamic Flags#
Zone#
Adding the value "zone"
to the dynamic_flags
array will result in a flag set to the zone name that is executing the call.
Custom Channel Vars#
Adding the value "custom_channel_vars."
appended with a normalized variable name will add the value (if present) to the flags array. For example, "custom_channel_vars.owner_id"
.
Examples#
Route to the system carriers#
{"module":"resources",
"data":{
"use_local_resources":false
}
}
Route to the account's local carriers#
{"module":"resources",
"data":{
"use_local_resources":true
}
}
Route to another account's local carriers#
{"module":"resources",
"data":{
"use_local_resources":true,
"hunt_account_id":"{OTHER_ACCOUNT_ID}"
}
}
This is great for resellers; they can set their reseller account id as the hunt_account_id
in callflows for their child accounts (such as in the no_match
callflow).
Dynamic Flags#
{"module":"resources",
"data":{
"dynamic_flags": ["custom_channel_vars.owner_id", "zone"]
}
}
This will add the zone name processing the call and owner ID of the endpoint to the required flags of the resource requests. In this example only resources for that zone and owner will be selected (the resources would need the corresponding values set as available flags).
Custom SIP Headers#
You can include a couple macros that will be replaced at the time of a call in the SIP headers. For instance, if you need to send the Caller-ID number as an "X-" SIP header:
{"module":"resources",
"data":{
"use_local_resources":true,
"hunt_account_id":"{OTHER_ACCOUNT_ID}",
"custom_sip_headers":{
"X-Billing-Number":"{caller_id_number}"
}
}
}
By using {caller_id_number}
, Kazoo will replace the header value with the actual Caller-ID number for that call. If the number was 4158867900
then the SIP INVITE would include the header X-Billing-Number: 4158867900
.
You can find the listing of available macros in the /v2/schemas/ecallmgr
API call; look for the expandable_macros
defaults.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.