<Siprec> instruction allows you to start a stream on a phone call and send that stream to one of the available partners via the SIPREC connector configuration.
The most basic use of
<?xml version="1.0" encoding="UTF-8"?> <Response> <Start> <Siprec connectorName="my_addon_connector" /> </Start> </Response>
This TwiML will instruct Twilio to fork the audio stream of the current call and send it in real-time over SIPREC to a partner using the configured connector.
<Siprec> starts the audio stream asynchronously and immediately continues with the next TwiML instruction. If there is no instruction, the call will be disconnected. In order to avoid this, provide a TwiML instruction to continue the call.
Connectors are configured via the Marketplace Add-on in the Twilio Stream Connectors Console page. Connectors cannot be configured outside of the console via TwiML. This requirement is in place to ensure that the credentials needed to send the stream to a partner are stored securely.
Any communication issues encountered while streaming media to the partner will be reported in the Twilio Debugger with additional information about the failure.
<Siprec> supports the following attributes:
|Attribute Name||Allowed Values||Default Value|
|name||Optional. Unique name for the Stream||none|
|connectorName||Unique name used when configuring the connector via Marketplace Add-on.||Default|
name will allow you to reference the SIPREC stream directly. This name must be unique per Call.
For instance by naming the
<Start> <Siprec name="my_first_siprec_stream" connectorName="my_addon_connector" /> </Start>
You can later use the unique
my_first_siprec_stream to stop the stream.
<Stop> <Siprec name="my_first_siprec_stream" /> </Stop>
connectorName attribute must contain a unique name corresponding to the siprec Stream Connector installed via Twilio Stream Connectors console page.
For example, to use Gridspace Connector, use
Gridspace_1 is the unique name specified when configuring Gridspace Connector in the Stream Connectors page. In order to start a SIPREC session, you must first configure the appropriate SIPREC connector via console.
If you'd like to use a specific partner and do not find them in the available Stream Connectors list, please write to us at email@example.com and include details about your desired partner.
SIPREC partners often require additional metadata along with the audio stream. You can provide custom data by using
<Start> <Siprec name=”my_stream_1” connectorName=”Gridspace_1” > <Parameter name=”Custom1” value =”Bob” /> <Parameter name=”Custom2” value =”Blah” /> <Parameter name=”Custom3” value =”Alice” /> </Siprec> </Start>
The exact names of parameters vary from partner to partner, so please refer to the appropriate partner tile in the Stream Connectors page to identify the custom parameters that need to be passed.