Basix XML Request
When a call arrives, Basix will make a synchronous HTTP POST request to the XML Server URL (you can set more than one URL to permit fallback), and wait to receive XML in response. Basix sends call parameters to your application that you can act upon before responding.
Request Parameters
Basix sends the following parameters with its request:
Parameter | Description |
---|---|
CallUUID | A unique identifier for this call. |
CalledNumber | Number that is the target of this call. |
CallingNumber | Number that originated this call. |
CallStatus | This parameter depicts the status for the call. "ringing" (not answered yet), "in-progress" (already answered) |
Direction | Indicates the direction of the call: "inbound" or "outbound". |
Anonymous | Indicates if the call is Anonymous (caller ID hidden) or not: "true" or "false" |
DNIS | Shows the original number (if available) that was dialed by the caller (in case of inbound calls). Usually the DNIS is the same as the parameter To. However, it might not always be the case depending on how the call arrived at your Basix PBX. |
CACode | If you are a local carrier and are allowed to see this information, it will provide the CACode of the calling party. |
CarrierID | If you are a local carrier and are allowed to see this information, it will provide the CarrierID of the calling party. |
UserId/UserName | basix user.id and user.name if the person at the distant-end is a basix user |
GroupId/GroupName | basix group.id and group.name if if the person at the distant-end is a basix user on the context of a group. Important: this doesn't indicate the call arrived to a certain group. Instead it indicates a call was generated from that group to a member of the group. |
The parameters are sent in the body of the request as an URL encoded query string. Ex: Direction=inbound&To=05011112222From=090111122226&CallerName=09011112222&DomainName=brs.basix.ne.jp&CallUUID=c58ae32a-6f19-47ba-a402-6f3d031cb1ab&CallStatus=ringing
If we are not able to connect to the first XML Server URL within 10 seconds, we will try the next one till we get a response or till the list of URLs is exhausted.
These parameters will also be available as variables during processing of the XML doc. So that you can do things like these:
Speak CallingNumber and CalledNumber
1 2 3 4 5
<?xml version="1.0" encoding="UTF-8" ?> <Response> <Speak>Your calling number is {{CallingNumber}}</Speak> <Speak>You called to {{CalledNumber}}</Speak> </Response>
Speak different content based on CalledNumber
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
<?xml version="1.0" encoding="UTF-8" ?> <Response> <Switch expr="CalledNumber"> <Case val="0311111111"> <Speak>Your calling number is {{CallingNumber}}</Speak> </Case> <Case val="0322222222"> <Speak>Your called to {{CalledNumber}}</Speak> </Case> <Default> <Speak>Your calling number is {{CallingNumber}}</Speak> <Speak>You called to {{CalledNumber}}</Speak> </Default> </Switch> </Response>
And elements GetDigits, ReceiveFax and SendFax will add extra variables after they complete.
When the call finishes, if configured to do so, Basix will notify the xml server that the call terminated with parameters CallStatus=completed and DisconnectedBy.
Name | Description |
---|---|
CallStatus | "completed" (this means the call ended so we are not asking for XML data, we are just informing the call terminated). |
DisconnectedBy | local-end" (your pbx disconnected the call) or "distant-end" (the distant-end terminated the call) |
If there is an error during XML processing like invalid XML syntax or invalid parameters for Elements, this will terminate the call and the error will be notified to the XML Server URL with extra parameter Error:
Name | Description |
---|---|
Error | some error string like "Unable to parse XML document" or "Invalid parameter 'date' for Element Play" |