iptrtpproxy_admin.xml 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
  4. [ <!ENTITY % local.common.attrib
  5. "xmlns:xi CDATA #FIXED 'http://www.w3.org/2001/XInclude'">
  6. <!-- Include general documentation entities -->
  7. <!ENTITY % docentities SYSTEM "../../../docbook/entities.xml">
  8. %docentities;
  9. ]
  10. >
  11. <chapter>
  12. <title>Admin Guide</title>
  13. <section id="iptrtpproxy.overview">
  14. <title>Overview</title>
  15. <para>
  16. This module provides similar functionality as <emphasis>nathelper</emphasis> but
  17. communicates with <emphasis>netfilter</emphasis> kernel
  18. <emphasis>xt_RTPPROXY</emphasis> module using
  19. the <emphasis>libipt_RTPPROXY</emphasis> userspace library.
  20. All RTP streams are manipulated directly in kernel space, no data is copied from
  21. kernel to userspace and back, it reduces load and delay.
  22. See <ulink url="http://www.2p.cz/en/netfilter_rtp_proxy">
  23. http://www.2p.cz/en/netfilter_rtp_proxy</ulink> for more details.
  24. </para>
  25. <para>
  26. This &kamailio; module is written as a light-weight module, there is no
  27. dialog management as in <emphasis>Nathelper</emphasis>. The reason is that such an API
  28. should be provided by core or a specialized dialog manager module.
  29. Because such module is not in git, session information may be stored
  30. in extra attributes of the <emphasis>avp_db</emphasis> module and
  31. the session id itself in record route as cookie, see the <emphasis>rr</emphasis> module.
  32. </para>
  33. <para>
  34. It should be able to support all cases as re-invites when SIP client offers media change in SDP and
  35. when number of medias in offer/answer are different.
  36. </para>
  37. <para>
  38. <emphasis>Nathelper</emphasis> may be still used for testing if client is behind the NAT.
  39. </para>
  40. <para>
  41. There is also support for media authorization. Number of codec sets may be defined.
  42. When a message containing SDP offer/answer is being processed then current codecs
  43. and streams may be inspected, removed or signallized according a codec set.
  44. </para>
  45. </section>
  46. <section id="iptrtpproxy.known_limitations">
  47. <title>Known limitations</title>
  48. <itemizedlist>
  49. <listitem>
  50. <para>
  51. Only IPv4 addresses are supported.
  52. </para>
  53. </listitem>
  54. <listitem>
  55. <para>
  56. More media streams per session supported
  57. </para>
  58. </listitem>
  59. </itemizedlist>
  60. </section>
  61. <section id="iptrtpproxy.dep">
  62. <title>Dependencies</title>
  63. <para>
  64. The following libraries or applications must be installed before
  65. running &kamailio; with this module loaded:
  66. <itemizedlist>
  67. <listitem>
  68. <para>
  69. netfilter xt_RTPPROXY &amp; libipt_RTPPROXY,
  70. see <ulink url="http://www.2p.cz/en/netfilter_rtp_proxy">http://www.2p.cz/en/netfilter_rtp_proxy</ulink>
  71. </para>
  72. </listitem>
  73. </itemizedlist>
  74. </para>
  75. <note><para>
  76. The modules Makefile must be edited and iptdir setup to the directory with
  77. the iptable sources (if different from ~/iptables). Alternatively
  78. compile the module using:
  79. <programlisting>
  80. make -C modules/iptrtpproxy iptdir=path_to_iptables_src
  81. </programlisting>
  82. </para></note>
  83. </section>
  84. <section id="iptrtpproxy.parameters" xmlns:xi="http://www.w3.org/2001/XInclude">
  85. <title>Parameters</title>
  86. <section id="config">
  87. <title><varname>config</varname> (string)</title>
  88. <para>
  89. References <emphasis>iptrtpproxy.cfg</emphasis>, see <emphasis>iptrtpproxy_helper</emphasis>. Default value
  90. is <emphasis>/etc/iptrtpproxy.cfg</emphasis>. If only codec authorization is to be used then
  91. <emphasis>/dev/null</emphasis> may be used.
  92. </para>
  93. </section>
  94. <section id="switchboard">
  95. <title><varname>switchboard</varname> (string)</title>
  96. <para>
  97. References <emphasis>xt_RTPPROXY</emphasis> switchboard for usage by ser module.
  98. </para>
  99. <para>
  100. The format is:
  101. </para>
  102. <programlisting>
  103. "name=" value * ( ";" name "=" value )
  104. name = "aggregation" | "sip-addr-"
  105. </programlisting>
  106. <para>
  107. The <emphasis>name</emphasis> is the switchboard name as declared in config and will be used by script functions and references switchboard.
  108. It's mandatory parameter. The special name <emphasis>*</emphasis> set values for all switchboards.
  109. </para>
  110. <para>
  111. The <emphasis>sip-addr</emphasis> is address used by <function>iptrtpproxy_ser_param(by_sip_ip)</function> to find a switchboard for particular
  112. connection. If not explicitly configured then RTP switchboard gate address are used for this feature.
  113. </para>
  114. <para>
  115. The <emphasis>aggregation</emphasis> enables to aggregate more switchboards in cluster and to widden bandwidth.
  116. Aggregation will take <emphasis>sip-addr</emphasis> from the first switchboard of its.
  117. </para>
  118. <example>
  119. <title>Declare <varname>switchboard</varname></title>
  120. <programlisting>
  121. ...
  122. modparam("iptrtpproxy", "config", "/etc/iptrtpproxy.cfg");
  123. modparam("iptrtpproxy", "switchboard", "name=my1;sip-addr-a=1.2.3.4;sip-addr-b=5.6.7.8");
  124. modparam("iptrtpproxy", "switchboard", "name=my2;sip-addr-a=2.3.4.5;sip-addr-b=3.4.5.6;aggregation=my23");
  125. modparam("iptrtpproxy", "switchboard", "name=my3;aggregation=my23");
  126. modparam("iptrtpproxy", "switchboard", "name=*;aggregation=my123");
  127. ...
  128. </programlisting>
  129. </example>
  130. </section>
  131. <section id="rpc_heartbeat_timeout">
  132. <title><varname>rpc_heartbeat_timeout</varname> (int)</title>
  133. <para>
  134. Timeout in seconds used for rerequest remote RTP proxy via RPC command after preceeding error.
  135. In other words if a RPC server is unresponsive at the moment then next attempt will be forced
  136. after this timeout. Default value is <emphasis>30</emphasis>.
  137. </para>
  138. </section>
  139. <section id="hostname">
  140. <title><varname>hostname</varname> (string)</title>
  141. <para>
  142. The hostname used by RPC to identify machine where Ser is running to communicate which RTP proxy
  143. via local interface. Default value is taken from system hostname.
  144. </para>
  145. </section>
  146. <section id="declare_codec">
  147. <title><varname>declare_codec</varname> (string)</title>
  148. <para>
  149. There are basic implicit codecs compiled in module, more codecs may be added by this parameter (one codec per modparam).
  150. </para>
  151. </section>
  152. <section id="codec_set">
  153. <title><varname>codec_set</varname> (string)</title>
  154. <para>
  155. Declares new codec set. Codecs are declared for each media type independently.
  156. </para>
  157. <para>
  158. The format is:
  159. </para>
  160. <programlisting>
  161. "name=" value * ( ";" name "=" value )
  162. name = "media_type" | "rights" | "codecs" | "max_streams" | ( "rtp" | "rtcp" ) "_" ( "bytes" | "packets" )
  163. media_types = "audio" | "video" | "application" | "text" | "message" | "data" | "control" | "?" | "*"
  164. </programlisting>
  165. <para>
  166. The <emphasis>name</emphasis> is the codec set name to be defined.
  167. </para>
  168. <para>
  169. The <emphasis>media_type</emphasis> belongs to type at <emphasis>m=</emphasis> SDP line. Question mark means
  170. "unknown media" type and asterisk "all media types".
  171. </para>
  172. <para>
  173. The <emphasis>max_streams</emphasis> defines how many streams (m= lines) is allowed per media type.
  174. </para>
  175. <para>
  176. The <emphasis>rights</emphasis> defines if particular codec is allowed <emphasis>0</emphasis>, disallowed, i.e. will be removed
  177. if bit AND operation with <function>remove_codec_mask</function> is non-zero or its presence will be signallized by <function>@iptrtpproxy.auth_rights</function> (any other value).
  178. </para>
  179. <para>
  180. The <emphasis>codecs</emphasis> comma separated list of codecs. Previous <emphasis>media_type&amp;rights</emphasis> will be applied.
  181. </para>
  182. <para>
  183. The <emphasis>rtp/rtcp_bytes/packets</emphasis> limits bandwidth per <emphasis>media_type</emphasis> (0 is unlimited). It will override
  184. bandwidth limited by <function>iptrtpproxy_set_param("throttle_*")</function>.
  185. </para>
  186. <example>
  187. <title>Declare <varname>codec_set</varname></title>
  188. <programlisting>
  189. ...
  190. # enable all codecs, default state when codec is declared
  191. modparam("iptrtpproxy", "codec_set", "name=cs1;media_type=*;max_streams=9999;rights=0;codecs=*");
  192. # allow only 2 audio and 1 video stream
  193. modparam("iptrtpproxy", "codec_set", "name=cs2;media_type=*;max_streams=0;media_type=audio;max_streams=2;media_type=video;max_streams=1");
  194. # dtto, allow only a few audio and video codecs, GSM codec is allowed but signallized
  195. modparam("iptrtpproxy", "codec_set", "name=cs3;media_type=*;max_streams=0;rights=1;codecs=*;media_type=audio;max_streams=2;rights=0;codecs=PCMU,G729,G728,parityfec,telephone-events;rights=2;codecs=GSM;media_type=video;max_streams=1;rights=0;codecs=jpeg,parityfec");
  196. # limit max. bandwidth for video¨
  197. modparam("iptrtpproxy", "codec_set", "name=cs4;media_type=video;rtp_bytes=10000;rtcp_bytes=1000");
  198. ...
  199. </programlisting>
  200. </example>
  201. </section>
  202. </section>
  203. <section id="iptrtpproxy.funcs" xmlns:xi="http://www.w3.org/2001/XInclude">
  204. <title>Functions</title>
  205. <section id="iptrtpproxy_alloc">
  206. <title>
  207. <function>iptrtpproxy_alloc(gate_a_to_b [, existing_sess_ids])</function>
  208. </title>
  209. <para>
  210. Parses SDP content and allocates for each RTP media stream one RTP proxy session.
  211. SDP is updates to reflect allocated sessions. Switchboard/aggregation is set using
  212. <function>iptrtpproxy_set_param(by_sip_ip)</function> or <function>iptrtpproxy_set_param("switchboard/aggregation")</function>.
  213. </para>
  214. <para>
  215. Aggregation supports load balancing among more RTP proxies controlled by RPC.
  216. The module try to allocate at machines/switchboards in following order (priorities)
  217. not yet asked (or being heartbeated) machines, responsive machines, switchboards
  218. having percentualy more free slots, non responsive machines.
  219. </para>
  220. <para>
  221. Proxy may hide caller identity provided at <emphasis>o=</emphasis> line using
  222. <function>@iptrtpproxy.o_name/addr</function> and <function>iptrtpproxy_set_param(o_name/addr)</function>
  223. functions. But the script is responsible for rewritting to original values in
  224. a response or a callee initiated re-INVITE. Therefore original value need to be stored
  225. in-dialog.
  226. </para>
  227. <itemizedlist>
  228. <listitem>
  229. <para>
  230. if <emphasis>gate_a_to_b</emphasis> bit 0 is set
  231. then SDP regards to gate-a to gate-b direction.
  232. </para>
  233. </listitem>
  234. <listitem>
  235. <para>
  236. <emphasis>protected_session_ids</emphasis> list of existing sessions
  237. enables reusing already allocated sessions in re-INVITE without
  238. allocating new sessions for each stream in SDP regardless a IP/port
  239. is required. It's mostly undesirable, typically "hold-on" is
  240. done via re-INVITE without any change. There is drawback because
  241. callee cannot change IP:port in 200OK which is legal case in RFC3264.
  242. But because some non-RFC3264 compliant phones dislike proactively
  243. changed IP:port at RTP proxy it seems it's less evil.
  244. </para>
  245. </listitem>
  246. <listitem>
  247. <para>
  248. function returns true is a session was created, identifier is available
  249. via select <function>@iptrtpproxy.session_ids</function>.
  250. </para>
  251. </listitem>
  252. </itemizedlist>
  253. <example>
  254. <title><function>iptrtpproxy_alloc</function> usage</title>
  255. <programlisting>
  256. ...
  257. if (!iptrtpproxy_set_param("aggregation_by_sip_ip_a", "@received.ip")) {
  258. if (!iptrtpproxy_set_param("switchboard_by_sip_ip_a", "@received.ip")) {
  259. t_reply("500", "RTP proxy error");
  260. drop;
  261. }
  262. }
  263. eval_push("x:%@next_hop.src_ip");
  264. if (@eval.get[-1] == @received.ip) {
  265. if (@iptrtpproxy.aggregation_a) {
  266. iptrtpproxy_set_param("aggregation_b", "@iptrtpproxy.aggregation_a");
  267. }
  268. else {
  269. iptrtpproxy_set_param("switchboard_b", "@iptrtpproxy.switchboard_a");
  270. }
  271. }
  272. else {
  273. if (!iptrtpproxy_set_param("aggregation_by_sip_ip_b", "@eval.get[-1]")) {
  274. if (!iptrtpproxy_set_param("switchboard_by_sip_ip_b", "@eval.get[-1]")) {
  275. t_reply("500", "RTP proxy error");
  276. drop;
  277. }
  278. }
  279. }
  280. eval_remove(-1, 1);
  281. if (!iptrtpproxy_alloc("1")) {
  282. t_reply("500", "RTP proxy error");
  283. drop;
  284. }
  285. $sess_ids = @iptrtpproxy.session_ids;
  286. ...
  287. </programlisting>
  288. </example>
  289. </section>
  290. <section id="iptrtpproxy_update">
  291. <title>
  292. <function>iptrtpproxy_update(gate_a_to_b, session_ids)</function>
  293. </title>
  294. <para>
  295. Parses SDP content and updates sessions provided by <emphasis>session_ids</emphasis> and
  296. updates SDP. If succesfull then session_ids may be changed (in case e.g. media
  297. stream has port zero particular session is released), the
  298. result of <function>@iptrtpproxy.session_ids</function> should be stored for future in-dialog usage.
  299. </para>
  300. <para>
  301. The SDP contect is also affected by <function>iptrtpproxy_set_param(o_name/addr)</function>
  302. functions. If a stream is deactivated in SDP then Sessions may be deleted unless
  303. mentioned in <emphasis>protected_session_ids</emphasis>.
  304. </para>
  305. <itemizedlist>
  306. <listitem>
  307. <para>
  308. if <emphasis>gate_a_to_b</emphasis> bit 0 is set
  309. then SDP regards to gate-a to gate-b direction.
  310. </para>
  311. <para>
  312. if <emphasis>gate_a_to_b</emphasis> bit 1 is set
  313. then SDP is updated only, no RTP session are affected.
  314. Should be used when handling retransmission in onreply route,
  315. retransmission replies are not eaten be tm module!
  316. </para>
  317. </listitem>
  318. </itemizedlist>
  319. <example>
  320. <title><function>iptrtpproxy_update</function> usage</title>
  321. <programlisting>
  322. ...
  323. # load $sess_ids from dialog
  324. if (iptrtpproxy_update("0", $sess_ids)) {
  325. $sess_ids = @iptrtpproxy.session_ids;
  326. # save sess_ids in dialog
  327. }
  328. ...
  329. </programlisting>
  330. </example>
  331. </section>
  332. <section id="iptrtpproxy_adjust_timeout">
  333. <title>
  334. <function>iptrtpproxy_adjust_timeout(gate_a_to_b, session_ids)</function>
  335. </title>
  336. <para>
  337. Adjust timeout for particular gate. It's useful in "200 OK"
  338. decrease timeout to learning timeout if INVITE has set (long) <emphasis>ringing timeout</emphasis>.
  339. </para>
  340. <itemizedlist>
  341. <listitem>
  342. <para>
  343. if <emphasis>gate_a_to_b</emphasis> bit 0 is set
  344. then it regards to gate-a to gate-b direction.
  345. </para>
  346. </listitem>
  347. </itemizedlist>
  348. <example>
  349. <title><function>iptrtpproxy_adjust_timeout</function> usage</title>
  350. <programlisting>
  351. ...
  352. # load $sess_ids from dialog
  353. if (status=~"18[0-9]") {
  354. iptrtpproxy_set_param("learning_timeout", "60");
  355. }
  356. else {
  357. iptrtpproxy_set_param("learning_timeout", "5");
  358. }
  359. if (iptrtpproxy_adjust_timeout("0", $sess_ids)) {
  360. }
  361. ...
  362. </programlisting>
  363. </example>
  364. </section>
  365. <section id="iptrtpproxy_delete">
  366. <title>
  367. <function>iptrtpproxy_delete(session_ids)</function>
  368. </title>
  369. <para>
  370. Delete sessions identified by <emphasis>session_ids</emphasis>. May be used when dialog is being
  371. destroyed (BYE) or when INVITE failed in failure route. If <emphasis>protected_session_ids</emphasis>
  372. list is provided then this set is excluded from sessions to be deleted.
  373. </para>
  374. <example>
  375. <title><function>iptrtpproxy_delete</function> usage</title>
  376. <programlisting>
  377. ...
  378. # load $sess_ids from dialog
  379. iptrtpproxy_delete($sess_ids);
  380. ...
  381. </programlisting>
  382. </example>
  383. </section>
  384. <section id="iptrtpproxy_authorize_media">
  385. <title>
  386. <function>iptrtpproxy_authorize_media()</function>
  387. </title>
  388. <para>
  389. Authorizes SDP media according currect <emphasis>codec_set</emphasis>. If bit AND operation
  390. between rights in codec set and <function>remove_codec_mask</function> is non zero then
  391. such a codec are to be removed. The result may be obtained from
  392. <function>@iptrtpproxy.auth_rights</function> which returns max. right which has been applied when
  393. processing all codecs of enabled streams.
  394. </para>
  395. <para>
  396. The function MUST NOT be called after <function>iptrtpproxy_alloc/update</function>!
  397. But the function may be called several times to authorize using more codec sets.
  398. </para>
  399. <example>
  400. <title><function>iptrtpproxy_authorize_media</function> usage</title>
  401. <programlisting>
  402. ...
  403. if (@iptrtpproxy.active_media_num == "0") break;
  404. iptrtpproxy_set_param("codec_set", "cs2");
  405. iptrtpproxy_set_param("remove_codec_mask", "1");
  406. if (!iptrtpproxy_authorize_media()) {
  407. t_reply("415", "Cannot authorize media");
  408. drop;
  409. }
  410. iptrtpproxy_set_param("codec_set", "cs3");
  411. if (!iptrtpproxy_authorize_media()) {
  412. t_reply("415", "Cannot authorize media");
  413. drop;
  414. }
  415. if (@iptrtpproxy.active_media_num == "0") {
  416. t_reply("488", "Not acceptable here");
  417. drop;
  418. }
  419. if (@iptrtpproxy.auth_rights == "2") {
  420. append_hf_value("Contact: &lt;sip:1.2.3.4&gt;");
  421. t_reply("301", "Redirect to transcoder");
  422. drop;
  423. }
  424. ...
  425. </programlisting>
  426. </example>
  427. </section>
  428. <section id="iptrtpproxy_set_param">
  429. <title>
  430. <function>iptrtpproxy_set_param(param, value)</function>
  431. </title>
  432. <para>
  433. Set particular parameter needed mainly by <function>iptrtpproxy_alloc/update/adjust_timeout</function>.
  434. The paramter value is availble via <function>@iptrtpproxy.&lt;param&gt;</function>.
  435. </para>
  436. <itemizedlist>
  437. <listitem>
  438. <para>
  439. Supported parameters: <emphasis>expiration_timeout</emphasis>, <emphasis>ttl</emphasis>, <emphasis>learning_timeout</emphasis>,
  440. <emphasis>always_learn</emphasis>,
  441. <emphasis>aggregation_a</emphasis>, <emphasis>aggregation_b</emphasis>,
  442. <emphasis>switchboard_a</emphasis>, <emphasis>switchboard_b</emphasis>,
  443. <emphasis>throttle_mark</emphasis>,
  444. <emphasis>throttle_rtp_max_bytes</emphasis>, <emphasis>throttle_rtp_max_packets</emphasis>,
  445. <emphasis>throttle_rtcp_max_bytes</emphasis>, <emphasis>throttle_rtcp_max_packets</emphasis>.
  446. </para>
  447. </listitem>
  448. </itemizedlist>
  449. </section>
  450. <section id="iptrtpproxy_set_param(by_sip_ip)">
  451. <title>
  452. <function>iptrtpproxy_set_param("(aggregation/switchboard)_by_sip_ip_(a/b)", sip_ip)</function>
  453. </title>
  454. <para>
  455. Find corresponding aggregation or switchboard and set
  456. <function>@iptrtpproxy.aggregation_a/b</function> or <function>@iptrtpproxy.switchboard_a/b</function>.
  457. Switchboards/aggregations are compared against <emphasis>sip-addr</emphasis>,
  458. it allow separate SIP and RTP traffic and RTP aggregation.
  459. </para>
  460. <itemizedlist>
  461. <listitem>
  462. <para>
  463. <emphasis>sip_ip</emphasis> IP to be compared, typically <function>@received.ip</function>
  464. or <function>@next_hop.src_ip</function>.
  465. </para>
  466. </listitem>
  467. <listitem>
  468. <para>
  469. function returns true if switchboard/aggregation was found
  470. </para>
  471. </listitem>
  472. </itemizedlist>
  473. </section>
  474. <section id="iptrtpproxy_set_param(protected_session_ids)">
  475. <title>
  476. <function>iptrtpproxy_set_param("protected_session_ids", sess_ids)</function>
  477. </title>
  478. <para>
  479. Used for reusing sessions in <function>iptrtpproxy_alloc</function>, <function>iptrtpproxy_update</function>
  480. and <function>iptrtpproxy_delete</function>.
  481. </para>
  482. </section>
  483. <section id="iptrtpproxy_set_param(o_name)">
  484. <title>
  485. <function>iptrtpproxy_set_param("o_name", value)</function>
  486. </title>
  487. <para>
  488. Username to be rewritten at <emphasis>o=</emphasis> line by <function>iptrtpproxy_alloc/update</function>
  489. to hide caller identity. If value is blank then username is left unchanged.
  490. </para>
  491. </section>
  492. <section id="iptrtpproxy_set_param(o_addr)">
  493. <title>
  494. <function>iptrtpproxy_set_param("o_addr", value)</function>
  495. </title>
  496. <para>
  497. Address to be rewritten at <emphasis>o=</emphasis> line by <function>iptrtpproxy_alloc/update</function>
  498. to hide caller identity. If value is blank then address is left unchanged.
  499. </para>
  500. </section>
  501. <section id="iptrtpproxy_set_param(codec_set)">
  502. <title>
  503. <function>iptrtpproxy_set_param("codec_set", value)</function>
  504. </title>
  505. <para>
  506. Codec set for <function>iptrtpproxy_authorize_media</function>. Current codec set
  507. may be obtained by <function>@iptrtpproxy.codec_set</function>.
  508. </para>
  509. </section>
  510. <section id="iptrtpproxy_set_param(remove_codec_mask)">
  511. <title>
  512. <function>iptrtpproxy_set_param("remove_codec_mask", value)</function>
  513. </title>
  514. <para>
  515. Mask used in <function>iptrtpproxy_authorize_media</function>. Current mask
  516. may be obtained by <function>@iptrtpproxy.remove_codec_mask</function>.
  517. </para>
  518. </section>
  519. </section>
  520. <section>
  521. <title>Selects</title>
  522. <section id="iptrtpproxy.session_ids">
  523. <title>
  524. <function>@iptrtpproxy.session_ids</function>
  525. </title>
  526. <para>
  527. Returns sessions allocated/updated in <function>iptrtpproxy_alloc/update</function>.
  528. </para>
  529. <para>
  530. The format is:
  531. </para>
  532. <programlisting>
  533. switchboard_name [ ":" [ session_id "/" created ] * ( "," session_id "/" created ) ] ]
  534. session_id = * ( [0-9] ) ; empty when no session allocated
  535. created = timestamp
  536. </programlisting>
  537. </section>
  538. <section id="iptrtpproxy.sdp_ip">
  539. <title>
  540. <function>@iptrtpproxy.sdp_ip</function>
  541. </title>
  542. <para>
  543. Return first rewritten IP provided at SDP <emphasis>c=</emphasis> line.
  544. </para>
  545. </section>
  546. <section id="iptrtpproxy.o_name">
  547. <title>
  548. <function>@iptrtpproxy.o_name</function>
  549. </title>
  550. <para>
  551. Return username from original <emphasis>o=</emphasis> line.
  552. </para>
  553. </section>
  554. <section id="iptrtpproxy.o_addr">
  555. <title>
  556. <function>@iptrtpproxy.o_addr</function>
  557. </title>
  558. <para>
  559. Return address from original <emphasis>o=</emphasis> line.
  560. </para>
  561. </section>
  562. <section id="iptrtpproxy.auth_rights">
  563. <title>
  564. <function>@iptrtpproxy.auth_rights</function>
  565. </title>
  566. <para>
  567. Result of <function>iptrtpproxy_authorize_media</function>.
  568. </para>
  569. </section>
  570. <section id="iptrtpproxy.active_media_num">
  571. <title>
  572. <function>@iptrtpproxy.active_media_num</function>
  573. </title>
  574. <para>
  575. Returns number of active media streams in SDP. <function>iptrtpproxy_authorize_media</function>
  576. may disable some streams, i.e. returned value may change after authorization.
  577. </para>
  578. </section>
  579. </section>
  580. </chapter>