*** id: b8d72f79-1ddc-4a88-bc3d-379b19041372 title: sip\_refer slug: /reference/sip-refer description: Send a SIP REFER to a SIP call. max-toc-depth: 3 ---------------- [statuscallbacks]: #statuscallbacks Send SIP REFER to a SIP call. ## **Properties** An object that accepts the following properties. SIP URI to REFER to. HTTP or HTTPS URL to deliver SIP REFER status events. Learn more about [status callbacks][statuscallbacks]. Username to use for SIP authentication. Password to use for SIP authentication. ## **Variables** Set by the method: * **sip\_refer\_to:** (out) The SIP URI the recipient is to INVITE. * **sip\_refer\_result:** (out) Overall SIP REFER result. * **return\_value:** (out) Same value as `sip_refer_result`. * **sip\_refer\_response\_code:** (out) Recipient response to the REFER request. * **sip\_refer\_to\_response\_code:** (out) INVITE response to the recipient. ## **StatusCallbacks** A POST request will be sent to `status_url` with a JSON payload like the following: The type of event. Always `calling.call.refer` for this method. The channel for the event, includes the SWML session ID. Unix timestamp (float) when the event was generated. The project ID associated with the call. The Space ID associated with the call. An object containing SIP REFER-specific parameters. The call ID. The node handling the call. The SIP URI the recipient is being referred to. The overall result of the SIP REFER operation (e.g., `success`). The SIP response code for the REFER request itself (e.g., `"202"`). Only present when a response has been received. The SIP response code for the INVITE sent by the recipient to the refer target (e.g., `"200"`). Only present when a response has been received. The segment ID for the call leg. Present when available. The tag associated with the call. Present when set. ### Raw JSON example ```json { "event_type": "calling.call.refer", "event_channel": "swml:xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "timestamp": 1640000000.123, "project_id": "xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "space_id": "xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "params": { "call_id": "xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "node_id": "xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "sip_refer_to": "sip:alice@example.com", "state": "success", "sip_refer_response_code": "202", "sip_notify_response_code": "200" } } ``` *** ## **Examples** ### Send SIP REFER and post result ```yaml version: 1.0.0 sections: main: - sip_refer: to_uri: 'sip:alice@example.com' - play: url: 'say: Connected. The SIP refer result is ${sip_refer_result}' - execute: dest: 'https://example.com/handle_sip_refer_result' ``` ```json { "version": "1.0.0", "sections": { "main": [ { "sip_refer": { "to_uri": "sip:alice@example.com" } }, { "play": { "url": "say: Connected. The SIP refer result is ${sip_refer_result}" } }, { "execute": { "dest": "https://example.com/handle_sip_refer_result" } } ] } } ```