Refer
The Refer
verb in Telnyx allows you to transfer a phone call to another SIP infrastructure during a TeXML call. You can initiate it at any point during the call. When you use the Refer verb, Telnyx will replace the original call with a new call to the external system you specify, effectively transferring the call to that system.
Attributes
ATTRIBUTE | DESCRIPTION | OPTIONS | DEFAULT |
---|---|---|---|
action | Optional URL where TeXML will make a request when the Refer verb ends, to retrieve a new
set of TeXML instructions to continue the call flow. | - | |
method | HTTP request type used to retrieve the next set of instructions. | GET , POST | POST |
Example
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Refer>
<Sip>sip:john@example.com</Sip>
</Refer>
</Response>
Expected callbacks
If action
is set you can expect the following webhook when the Refer
verb finishes. A new set of TeXML instructions should be returned in response.
{
"AccountSid": "6d547b4f-993a-4e87-b95c-2d9460b3824b",
"CallSid": "v3:wf0h6MLq0PIHItrkFyEPM0WLPAarG_fUA2MLQqkLYRhRRrCqnT6TPg",
"CallSidLegacy": "v3:wf0h6MLq0PIHItrkFyEPM0WLPAarG_fUA2MLQqkLYRhRRrCqnT6TPg",
"ReferCallStatus": "in-progress",
"ReferSipResponseCode": "202",
"NotifySipResponseCode": "200",
"Timestamp": "2021-04-28 21:51:13.591099Z"
}
Action callback HTTP attributes
The attributes contained in the action
request to your URL.
ATTRIBUTE | DESCRIPTION |
AccountSid | A unique identifier for the account generating this call. |
CallSid | A unique identifier for this call, generated by Telnyx. |
ReferCallStatus | Provides new call status based on SIP NOTIFY messages. May be omitted if REFER fails or no NOTIFY requests are received. Possible values: in-progress , no-answer , busy , canceled , failed |
ReferSipResponseCode | This indicates the SIP response code that Telnyx receives from the SIP endpoint in response to the REFER request. |
NotifySipResponseCode | Reflects final SIP response code on the referred leg, based on NOTIFY messages. May be omitted if REFER fails or no NOTIFY requests are received. |
Timestamp | The timestamp when the event was fired, given as UTC in RFC 2822 format. |