telephonyevents.sgml
来自「ortp协议栈(实时传输协议)」· SGML 代码 · 共 222 行
SGML
222 行
<refentry id="ortp-Telephone-events-(RFC2833)-"><refmeta><refentrytitle>Telephony events (RFC2833)</refentrytitle><manvolnum>3</manvolnum><refmiscinfo>ORTP Library</refmiscinfo></refmeta><refnamediv><refname>Telephony events (RFC2833)</refname><refpurpose></refpurpose></refnamediv><refsynopsisdiv><title>Synopsis</title><synopsis>#include <telephonyevents.h>struct <link linkend="telephone-event">telephone_event</link>;<link linkend="gint">gint</link> <link linkend="rtp-session-telephone-events-supported">rtp_session_telephone_events_supported</link> (<link linkend="RtpSession">RtpSession</link> *session);<link linkend="mblk-t">mblk_t</link>* <link linkend="rtp-session-create-telephone-event-packet">rtp_session_create_telephone_event_packet</link> (<link linkend="RtpSession">RtpSession</link> *session, int start);<link linkend="gint">gint</link> <link linkend="rtp-session-add-telephone-event">rtp_session_add_telephone_event</link> (<link linkend="RtpSession">RtpSession</link> *session, <link linkend="mblk-t">mblk_t</link> *packet, <link linkend="guchar">guchar</link> event, <link linkend="gint">gint</link> end, <link linkend="guchar">guchar</link> volume, <link linkend="guint16">guint16</link> duration);<link linkend="gint">gint</link> <link linkend="rtp-session-read-telephone-event">rtp_session_read_telephone_event</link> (<link linkend="RtpSession">RtpSession</link> *session, <link linkend="mblk-t">mblk_t</link> *packet, <link linkend="telephone-event-t">telephone_event_t</link> **tab);<link linkend="gint">gint</link> <link linkend="rtp-session-send-dtmf">rtp_session_send_dtmf</link> (<link linkend="RtpSession">RtpSession</link> *session, <link linkend="gchar">gchar</link> dtmf, <link linkend="guint32">guint32</link> userts);</synopsis></refsynopsisdiv><refsect1><title>Description</title><para></para></refsect1><refsect1><title>Details</title><refsect2><title><anchor id="telephone-event">struct telephone_event</title><programlisting>struct telephone_event{#ifdef WORDS_BIGENDIAN guchar event; guchar E:1; guchar R:1; guchar volume:6; guint16 duration;#else guint16 duration; guchar R:1; guchar E:1; guchar volume:6; guchar event;#endif};</programlisting><para></para></refsect2><refsect2><title><anchor id="rtp-session-telephone-events-supported">rtp_session_telephone_events_supported ()</title><programlisting><link linkend="gint">gint</link> rtp_session_telephone_events_supported (<link linkend="RtpSession">RtpSession</link> *session);</programlisting><para>Tells whether telephony events payload type is supported within the context of the rtpsession.</para><para></para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>session</parameter> :</entry><entry> a rtp session </entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> the payload type number used for telephony events if found, -1 if not found.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="rtp-session-create-telephone-event-packet">rtp_session_create_telephone_event_packet ()</title><programlisting><link linkend="mblk-t">mblk_t</link>* rtp_session_create_telephone_event_packet (<link linkend="RtpSession">RtpSession</link> *session, int start);</programlisting><para></para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>session</parameter> :</entry><entry></entry></row><row><entry align="right"><parameter>start</parameter> :</entry><entry></entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry></entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="rtp-session-add-telephone-event">rtp_session_add_telephone_event ()</title><programlisting><link linkend="gint">gint</link> rtp_session_add_telephone_event (<link linkend="RtpSession">RtpSession</link> *session, <link linkend="mblk-t">mblk_t</link> *packet, <link linkend="guchar">guchar</link> event, <link linkend="gint">gint</link> end, <link linkend="guchar">guchar</link> volume, <link linkend="guint16">guint16</link> duration);</programlisting><para>Adds a named telephony event to a rtp packet previously allocated using<link linkend="rtp-session-create-telephone-event-packet">rtp_session_create_telephone_event_packet</link>().</para><para></para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>session</parameter> :</entry><entry> a rtp session.</entry></row><row><entry align="right"><parameter>packet</parameter> :</entry><entry> a rtp packet as a <link linkend="mblk-t">mblk_t</link></entry></row><row><entry align="right"><parameter>event</parameter> :</entry><entry> the event type as described in rfc2833, ie one of the TEV_ macros.</entry></row><row><entry align="right"><parameter>end</parameter> :</entry><entry> boolean to indicate if the end bit should be set. (end of tone)</entry></row><row><entry align="right"><parameter>volume</parameter> :</entry><entry> the volume of the telephony tone, as described in rfc2833</entry></row><row><entry align="right"><parameter>duration</parameter> :</entry><entry>the duration of the telephony tone, in timestamp unit.</entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>0 on success.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="rtp-session-read-telephone-event">rtp_session_read_telephone_event ()</title><programlisting><link linkend="gint">gint</link> rtp_session_read_telephone_event (<link linkend="RtpSession">RtpSession</link> *session, <link linkend="mblk-t">mblk_t</link> *packet, <link linkend="telephone-event-t">telephone_event_t</link> **tab);</programlisting><para>Reads telephony events from a rtp packet. *<parameter>tab</parameter> points to the beginning of the event buffer.</para><para></para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>session</parameter> :</entry><entry> a rtp session from which telephony events are received.</entry></row><row><entry align="right"><parameter>packet</parameter> :</entry><entry> a rtp packet as a mblk_t.</entry></row><row><entry align="right"><parameter>tab</parameter> :</entry><entry> the address of a pointer.</entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> the number of events in the packet if successfull, 0 if the packet did notcontain telephony events.</entry></row></tbody></tgroup></informaltable></refsect2><refsect2><title><anchor id="rtp-session-send-dtmf">rtp_session_send_dtmf ()</title><programlisting><link linkend="gint">gint</link> rtp_session_send_dtmf (<link linkend="RtpSession">RtpSession</link> *session, <link linkend="gchar">gchar</link> dtmf, <link linkend="guint32">guint32</link> userts);</programlisting><para>This functions creates telephony events packets for <parameter>dtmf</parameter> and sends them.It uses <link linkend="rtp-session-create-telephone-event-packet">rtp_session_create_telephone_event_packet</link>() and <link linkend="rtp-session-add-telephone-event">rtp_session_add_telephone_event</link>() to create them and finally<link linkend="rtp-session-sendm-with-ts">rtp_session_sendm_with_ts</link>() to send them.</para><para></para><informaltable pgwide="1" frame="none" role="params"><tgroup cols="2"><colspec colwidth="2*"><colspec colwidth="8*"><tbody><row><entry align="right"><parameter>session</parameter> :</entry><entry> a rtp session</entry></row><row><entry align="right"><parameter>dtmf</parameter> :</entry><entry> a character meaning the dtmf (ex: '1', '#' , '9' ...)</entry></row><row><entry align="right"><parameter>userts</parameter> :</entry><entry> the timestamp</entry></row><row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> 0 if successfull, -1 if the session cannot support telephony events or if the dtmfgiven as argument is not valid.</entry></row></tbody></tgroup></informaltable></refsect2></refsect1></refentry>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?