| 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <!DOCTYPE docs SYSTEM "appdocsxml.dtd"> |
| 3 | <docs xmlns:xi="http://www.w3.org/2001/XInclude"> |
| 4 | <configInfo name="chan_websocket" language="en_US"> |
| 5 | <synopsis>Configuration for chan_websocket</synopsis> |
| 6 | <description><para> |
| 7 | <emphasis>WebSocket Channel Driver</emphasis> |
| 8 | </para> |
| 9 | </description> |
| 10 | <configFile name="chan_websocket.conf"> |
| 11 | <configObject name="global"> |
| 12 | <since> |
| 13 | <version>20.18.0</version> |
| 14 | <version>22.8.0</version> |
| 15 | <version>23.2.0</version> |
| 16 | </since> |
| 17 | <synopsis>Global settings for chan_websocket</synopsis> |
| 18 | <configOption name="control_message_format" default="plain-text"> |
| 19 | <since> |
| 20 | <version>20.18.0</version> |
| 21 | <version>22.8.0</version> |
| 22 | <version>23.2.0</version> |
| 23 | </since> |
| 24 | <synopsis>Determines the format used for sending and receiving |
| 25 | control mesages on the websocket. |
| 26 | </synopsis> |
| 27 | <description> |
| 28 | <enumlist> |
| 29 | <enum name="plain-text"> |
| 30 | <para>The legacy plain text single-line message format.</para> |
| 31 | </enum> |
| 32 | <enum name="json"> |
| 33 | <para>The new JSON format.</para> |
| 34 | </enum> |
| 35 | </enumlist> |
| 36 | </description> |
| 37 | </configOption> |
| 38 | </configObject> |
| 39 | </configFile> |
| 40 | </configInfo> |
| 41 | |
| 42 | <info name="Dial_Resource" language="en_US" tech="WebSocket"> |
| 43 | <para>WebSocket Dial Strings:</para> |
| 44 | <para><literal>Dial(WebSocket/connectionid[/websocket_options])</literal></para> |
| 45 | <para>WebSocket Parameters:</para> |
| 46 | <enumlist> |
| 47 | <enum name="connectionid"> |
| 48 | <para>For outgoing WebSockets, this is the ID of the connection |
| 49 | in websocket_client.conf to use for the call. To accept incoming |
| 50 | WebSocket connections use the literal <literal>INCOMING</literal></para> |
| 51 | </enum> |
| 52 | <enum name="websocket_options"> |
| 53 | <para>Options to control how the WebSocket channel behaves.</para> |
| 54 | <enumlist> |
| 55 | <enum name="c(codec) - Specify the codec to use in the channel"> |
| 56 | <para></para> |
| 57 | <para> If not specified, the first codec from the caller's channel will be used. |
| 58 | </para> |
| 59 | </enum> |
| 60 | <enum name="d(media_direction) - Set the media direction for this call"> |
| 61 | <para>Sets the media direction for the call. It is important to |
| 62 | note that this is from the perspective of the application, NOT |
| 63 | Asterisk.</para> |
| 64 | <enumlist> |
| 65 | <enum name="both"> |
| 66 | <para> |
| 67 | The default behavior. Media flows both ways like normal. |
| 68 | </para> |
| 69 | </enum> |
| 70 | <enum name="in"> |
| 71 | <para> |
| 72 | Asterisk will send media to the application but drop any media |
| 73 | it receives. |
| 74 | </para> |
| 75 | </enum> |
| 76 | <enum name="out"> |
| 77 | <para> |
| 78 | Asterisk will only receive media from the application, but will |
| 79 | not send any media. |
| 80 | </para> |
| 81 | </enum> |
| 82 | </enumlist> |
| 83 | </enum> |
| 84 | <enum name="f(format) - Control message format for this call"> |
| 85 | <para> |
| 86 | format: |
| 87 | </para> |
| 88 | <xi:include xpointer="xpointer(/docs/configInfo[@name='chan_websocket']/configFile[@name='chan_websocket.conf']/configObject[@name='global']/configOption[@name='control_message_format']/description/enumlist)"/> |
| 89 | </enum> |
| 90 | <enum name="n - Don't auto answer"> |
| 91 | <para>Normally, the WebSocket channel will be answered when |
| 92 | connection is established with the remote app. If this |
| 93 | option is specified however, the channel will not be |
| 94 | answered until the <literal>ANSWER</literal> command is |
| 95 | received from the remote app or the remote app calls the |
| 96 | /channels/answer ARI endpoint. |
| 97 | </para> |
| 98 | </enum> |
| 99 | <enum name="p - Passthrough mode"> |
| 100 | <para>In passthrough mode, the channel driver won't attempt |
| 101 | to re-frame or re-time media coming in over the websocket from |
| 102 | the remote app. This can be used for any codec but MUST be used |
| 103 | for codecs that use packet headers or whose data stream can't be |
| 104 | broken up on arbitrary byte boundaries. In this case, the remote |
| 105 | app is fully responsible for correctly framing and timing media |
| 106 | sent to Asterisk and the MEDIA text commands that could be sent |
| 107 | over the websocket are disabled. Currently, passthrough mode is |
| 108 | automatically set for the opus, speex and g729 codecs. |
| 109 | </para> |
| 110 | </enum> |
| 111 | <enum name="v(uri_parameters) - Add parameters to the outbound URI"> |
| 112 | <para>This option allows you to add additional parameters to the |
| 113 | outbound URI. The format is: |
| 114 | <literal>v(param1=value1,param2=value2...)</literal> |
| 115 | </para> |
| 116 | <para>You must ensure that no parameter name or value contains |
| 117 | characters not valid in a URL. The easiest way to do this is to |
| 118 | use the URIENCODE() dialplan function to encode them. Be aware |
| 119 | though that each name and value must be encoded separately. You |
| 120 | can't simply encode the whole string.</para> |
| 121 | </enum> |
| 122 | </enumlist> |
| 123 | </enum> |
| 124 | </enumlist> |
| 125 | <para>Examples: |
| 126 | </para> |
| 127 | <example title="Make an outbound WebSocket connection using connection 'connection1' and the 'sln16' codec."> |
| 128 | same => n,Dial(WebSocket/connection1/c(sln16)) |
| 129 | </example> |
| 130 | <example title="Make an outbound WebSocket connection using connection 'connection1' and the 'opus' codec. Passthrough mode will automatically be set."> |
| 131 | same => n,Dial(WebSocket/connection1/c(opus)) |
| 132 | </example> |
| 133 | <example title="Listen for an incoming WebSocket connection and don't auto-answer it."> |
| 134 | same => n,Dial(WebSocket/INCOMING/n) |
| 135 | </example> |
| 136 | <example title="Add URI parameters."> |
| 137 | same => n,Dial(WebSocket/connection1/v(${URIENCODE(vari able)}=${URIENCODE(${CHANNEL})},variable2=$(URIENCODE(${EXTEN})})) |
| 138 | </example> |
| 139 | <example title="Use the JSON control message format for this call."> |
| 140 | same => n,Dial(WebSocket/connection1/f(json)) |
| 141 | </example> |
| 142 | </info> |
| 143 | </docs> |