iptrtpproxy.xml 22 KB

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