functions.xml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702
  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. <section id="textops.functions" xmlns:xi="http://www.w3.org/2001/XInclude">
  5. <sectioninfo>
  6. </sectioninfo>
  7. <title>Functions</title>
  8. <section id="search">
  9. <title>
  10. <function>search(re)</function>
  11. </title>
  12. <para>
  13. Searches for the re in the message.
  14. </para>
  15. <para>Meaning of the parameters is as follows:</para>
  16. <itemizedlist>
  17. <listitem>
  18. <para><emphasis>re</emphasis> - Regular expression.
  19. </para>
  20. </listitem>
  21. </itemizedlist>
  22. <example>
  23. <title><function>search</function> usage</title>
  24. <programlisting>
  25. ...
  26. if ( search("[Ss][Ee][Rr]" ) { /*....*/ };
  27. ...
  28. </programlisting>
  29. </example>
  30. </section>
  31. <section id="search_append">
  32. <title>
  33. <function>search_append(re, txt)</function>
  34. </title>
  35. <para>
  36. Searches for the first match of re and appends txt after it.
  37. </para>
  38. <para>Meaning of the parameters is as follows:</para>
  39. <itemizedlist>
  40. <listitem>
  41. <para><emphasis>re</emphasis> - Regular expression.
  42. </para>
  43. </listitem>
  44. <listitem>
  45. <para><emphasis>txt</emphasis> - String to be appended. Xl_lib formatting supported.
  46. </para>
  47. </listitem>
  48. </itemizedlist>
  49. <example>
  50. <title><function>search_append</function> usage</title>
  51. <programlisting>
  52. ...
  53. search_append("[Ss]er", " blabla");
  54. ...
  55. </programlisting>
  56. </example>
  57. </section>
  58. <section id="replace">
  59. <title>
  60. <function>replace(re, txt)</function>
  61. </title>
  62. <para>
  63. Replaces the first occurrence of re with txt.
  64. </para>
  65. <para>Meaning of the parameters is as follows:</para>
  66. <itemizedlist>
  67. <listitem>
  68. <para><emphasis>re</emphasis> - Regular expression.
  69. </para>
  70. </listitem>
  71. <listitem>
  72. <para><emphasis>txt</emphasis> - String. Xl_lib formatting supported.
  73. </para>
  74. </listitem>
  75. </itemizedlist>
  76. <example>
  77. <title><function>replace</function> usage</title>
  78. <programlisting>
  79. ...
  80. replace("ser", "Sip Express Router");
  81. ...
  82. </programlisting>
  83. </example>
  84. </section>
  85. <section id="subst">
  86. <title>
  87. <function>subst('/re/repl/flags')</function>
  88. </title>
  89. <para>
  90. Replaces re with repl (sed or perl like).
  91. </para>
  92. <para>Meaning of the parameters is as follows:</para>
  93. <itemizedlist>
  94. <listitem>
  95. <para><emphasis>'/re/repl/flags'</emphasis> - sed like regular
  96. expression. flags can be a combination of i (case
  97. insensitive), g (global) or s (match newline don't treat it
  98. as end of line).
  99. </para>
  100. </listitem>
  101. </itemizedlist>
  102. <example>
  103. <title><function>subst</function> usage</title>
  104. <programlisting>
  105. ...
  106. # replace the uri in to: with the message uri (just an example)
  107. if ( subst('/^To:(.*)sip:[^@]*@[a-zA-Z0-9.]+(.*)$/t:\1\u\2/ig') ) {};
  108. ...
  109. </programlisting>
  110. </example>
  111. </section>
  112. <section id="subst_uri">
  113. <title>
  114. <function>subst_uri('/re/repl/flags')</function>
  115. </title>
  116. <para>
  117. Runs the re substitution on the message uri (like subst but works
  118. only on the uri)
  119. </para>
  120. <para>Meaning of the parameters is as follows:</para>
  121. <itemizedlist>
  122. <listitem>
  123. <para><emphasis>'/re/repl/flags'</emphasis> - sed like regular
  124. expression. flags can be a combination of i (case
  125. insensitive), g (global) or s (match newline don't treat it
  126. as end of line).
  127. </para>
  128. </listitem>
  129. </itemizedlist>
  130. <example>
  131. <title><function>subst</function> usage</title>
  132. <programlisting>
  133. ...
  134. # adds 3463 prefix to numeric uris, and save the original uri (\0 match)
  135. # as a parameter: orig_uri (just an example)
  136. if (subst_uri('/^sip:([0-9]+)@(.*)$/sip:3463\1@\2;orig_uri=\0/i')){$
  137. ...
  138. </programlisting>
  139. </example>
  140. </section>
  141. <section id="subst_user">
  142. <title>
  143. <function>subst_user('/re/repl/flags')</function>
  144. </title>
  145. <para>
  146. Runs the re substitution on the message uri (like subst_uri but
  147. works only on the user portion of the uri)
  148. </para>
  149. <para>Meaning of the parameters is as follows:</para>
  150. <itemizedlist>
  151. <listitem>
  152. <para><emphasis>'/re/repl/flags'</emphasis> - sed like regular
  153. expression. flags can be a combination of i (case
  154. insensitive), g (global) or s (match newline don't treat it
  155. as end of line).
  156. </para>
  157. </listitem>
  158. </itemizedlist>
  159. <example>
  160. <title><function>subst</function> usage</title>
  161. <programlisting>
  162. ...
  163. # adds 3463 prefix to uris ending with 3642 (just an example)
  164. if (subst_user('/3642$/36423463/')){$
  165. ...
  166. </programlisting>
  167. </example>
  168. </section>
  169. <section id="append_to_reply">
  170. <title>
  171. <function>append_to_reply(txt)</function>
  172. </title>
  173. <para>
  174. Append txt to the reply.
  175. </para>
  176. <para>Meaning of the parameters is as follows:</para>
  177. <itemizedlist>
  178. <listitem>
  179. <para><emphasis>txt</emphasis> - String. Xl_lib formatting supported.
  180. </para>
  181. </listitem>
  182. </itemizedlist>
  183. <example>
  184. <title><function>append_to_reply</function> usage</title>
  185. <programlisting>
  186. ...
  187. append_to_reply("Foo: bar\r\n");
  188. ...
  189. </programlisting>
  190. </example>
  191. </section>
  192. <section id="append_hf">
  193. <title>
  194. <function>append_hf(hf)</function>
  195. </title>
  196. <para>
  197. Appends txt after the last header field.
  198. </para>
  199. <para>Meaning of the parameters is as follows:</para>
  200. <itemizedlist>
  201. <listitem>
  202. <para><emphasis>hf</emphasis> - Header field to be appended. Xl_lib formatting supported.
  203. </para>
  204. </listitem>
  205. </itemizedlist>
  206. <example>
  207. <title><function>append_hf</function> usage</title>
  208. <programlisting>
  209. ...
  210. append_hf("P-hint: VOICEMAIL\r\n");
  211. ...
  212. </programlisting>
  213. </example>
  214. </section>
  215. <section id="append_urihf">
  216. <title>
  217. <function>append_urihf(prefix, suffix)</function>
  218. </title>
  219. <para>
  220. Append header field name with original <acronym>Request-URI</acronym> in middle.
  221. </para>
  222. <para>Meaning of the parameters is as follows:</para>
  223. <itemizedlist>
  224. <listitem>
  225. <para><emphasis>prefix</emphasis> - string (usually at least header field name). Xl_lib formatting supported.
  226. </para>
  227. </listitem>
  228. <listitem>
  229. <para><emphasis>suffix</emphasis> - string (usually at least line terminator). Xl_lib formatting supported.
  230. </para>
  231. </listitem>
  232. </itemizedlist>
  233. <example>
  234. <title><function>append_urihf</function> usage</title>
  235. <programlisting>
  236. ...
  237. append_urihf("CC-Diversion: ", "\r\n");
  238. ...
  239. </programlisting>
  240. </example>
  241. </section>
  242. <section id="is_present_hf">
  243. <title>
  244. <function>is_present_hf(hf_name)</function>
  245. </title>
  246. <para>
  247. Return true if a header field is present in message.
  248. </para>
  249. <note>
  250. <para>
  251. Takes header field names "as is" and doesn't distinguish compact
  252. names.
  253. </para>
  254. </note>
  255. <para>Meaning of the parameters is as follows:</para>
  256. <itemizedlist>
  257. <listitem>
  258. <para><emphasis>hf_name</emphasis> - Header field name.
  259. </para>
  260. </listitem>
  261. </itemizedlist>
  262. <example>
  263. <title><function>is_present_hf</function> usage</title>
  264. <programlisting>
  265. ...
  266. if (is_present_hf("From")) log(1, "From HF Present");
  267. ...
  268. </programlisting>
  269. </example>
  270. </section>
  271. <section id="append_time">
  272. <title>
  273. <function>append_time()</function>
  274. </title>
  275. <para>
  276. Append "Date" header containing the current date and time to the
  277. reply generated by SER.
  278. </para>
  279. <example>
  280. <title><function>is_present_hf</function> usage</title>
  281. <programlisting>
  282. ...
  283. if (method == "REGISTER" ) {
  284. # Many user agents can use the Date header field
  285. # in 200 OK replies to REGISTER to synchronize
  286. # internal clock
  287. append_time();
  288. };
  289. ...
  290. </programlisting>
  291. </example>
  292. </section>
  293. <section id="remove_hf">
  294. <title>
  295. <function>remove_hf(hf_name)</function>
  296. </title>
  297. <para>
  298. Remove from the message all the headers with the specified name.
  299. </para>
  300. <para>Meaning of the parameters is as follows:</para>
  301. <itemizedlist>
  302. <listitem>
  303. <para><emphasis>hf_name</emphasis> - Header field name to be removed.
  304. </para>
  305. </listitem>
  306. </itemizedlist>
  307. <example>
  308. <title><function>remove_hf</function> usage</title>
  309. <programlisting>
  310. ...
  311. remove_hf("Subject") # strip all headers whose name is "Subject".
  312. ...
  313. </programlisting>
  314. </example>
  315. </section>
  316. <section id="remove_hf_re">
  317. <title>
  318. <function>remove_hf_re(reg_exp)</function>
  319. </title>
  320. <para>
  321. Remove from the message all the headers whose names match a given
  322. regular expression.
  323. </para>
  324. <para>Meaning of the parameters is as follows:</para>
  325. <itemizedlist>
  326. <listitem>
  327. <para><emphasis>reg_exp</emphasis> - Regular expression that is
  328. matched against header name fields.
  329. </para>
  330. </listitem>
  331. </itemizedlist>
  332. <example>
  333. <title><function>remove_hf_re</function> usage</title>
  334. <programlisting>
  335. ...
  336. remove_hf_re("Subject|P-.*|X-.*") # strip all headers whose names match
  337. "Subject", contain "P-" or "X-".
  338. ...
  339. </programlisting>
  340. </example>
  341. </section>
  342. <section id="append_hf_value">
  343. <title>
  344. <function>append_hf_value(hf, xl_value)</function>
  345. </title>
  346. <para>
  347. Append new header value after an existing header, if no index acquired append at the end of
  348. list. Note that a header may consist of comma delimited list of values.
  349. </para>
  350. <para>Meaning of the parameters is as follows:</para>
  351. <itemizedlist>
  352. <listitem>
  353. <para><emphasis>hf</emphasis> - Header field to be appended. Format: HFNAME [ [IDX] ].
  354. If index is not specified new header is inserted at the end of message.
  355. </para>
  356. </listitem>
  357. <listitem>
  358. <para><emphasis>xl_value</emphasis> - Value to be added, xl_lib formatting supported.
  359. </para>
  360. </listitem>
  361. </itemizedlist>
  362. <example>
  363. <title><function>append_hf_value</function> usage</title>
  364. <programlisting>
  365. ...
  366. append_hf_value("foo", "gogo;stamp=%Ts") # add new header
  367. append_hf_value("foo[1]", "gogo") # add new value behind first value
  368. append_hf_value("foo[-1]", "%@Bar") # try add value to the last header, if not exists add new header
  369. ...
  370. </programlisting>
  371. </example>
  372. </section>
  373. <section id="insert_hf_value">
  374. <title>
  375. <function>insert_hf_value(hf, xl_value)</function>
  376. </title>
  377. <para>
  378. Insert new header value before an existing header, if no index acquired insert before first
  379. hf header. Note that a header may consist of comma delimited list of values.
  380. To insert value behing last value use <function>appenf_hf_value</function>.
  381. </para>
  382. <para>Meaning of the parameters is as follows:</para>
  383. <itemizedlist>
  384. <listitem>
  385. <para><emphasis>hf</emphasis> - Header field to be appended. Format: HFNAME [ [IDX] ].
  386. If index is not specified new header is inserted at the top of message.
  387. </para>
  388. </listitem>
  389. <listitem>
  390. <para><emphasis>xl_value</emphasis> - Value to be added, xl_lib formatting supported.
  391. </para>
  392. </listitem>
  393. </itemizedlist>
  394. <example>
  395. <title><function>insert_hf_value</function> usage</title>
  396. <programlisting>
  397. ...
  398. insert_hf_value("foo[2]", "gogo")
  399. insert_hf_value("foo", "%$an_avp") # add new header at the top of list
  400. insert_hf_value("foo[1]", "gogo") # try add to the first header
  401. ...
  402. </programlisting>
  403. </example>
  404. </section>
  405. <section id="remove_hf_value">
  406. <title>
  407. <function>remove_hf_value(hf_par)</function>
  408. </title>
  409. <para>
  410. Remove the header value from existing header, Note that a header may consist of comma delimited list of values.
  411. </para>
  412. <para>Meaning of the parameters is as follows:</para>
  413. <itemizedlist>
  414. <listitem>
  415. <para><emphasis>hf_par</emphasis> - Header field/param to be removed. Format: HFNAME [ [IDX] ] [. PARAM ]
  416. If asterisk is specified as index then all values are affected.
  417. </para>
  418. </listitem>
  419. </itemizedlist>
  420. <example>
  421. <title><function>remove_hf_value</function> usage</title>
  422. <programlisting>
  423. ...
  424. remove_hf_value("foo") # remove foo[1]
  425. remove_hf_value("foo[*]") # remove all foo's headers
  426. remove_hf_value("foo[-1]") # last foo
  427. remove_hf_value("foo.bar") # delete parameter
  428. remove_hf_value("foo[*].bar") # for each foo delete bar parameters
  429. ...
  430. </programlisting>
  431. </example>
  432. </section>
  433. <section id="remove_hf_value2">
  434. <title>
  435. <function>remove_hf_value2(hf_par)</function>
  436. </title>
  437. <para>
  438. Remove specified header or parameter. It is expected header in Authorization format (comma delimiters are not treated as multi-value delimiters).
  439. </para>
  440. <para>Meaning of the parameters is as follows:</para>
  441. <itemizedlist>
  442. <listitem>
  443. <para><emphasis>hf_par</emphasis> - Header/param to be removed. Format: HFNAME [ [IDX] ] [. PARAM ]
  444. If asterisk is specified as index then all values are affected.
  445. </para>
  446. </listitem>
  447. </itemizedlist>
  448. <example>
  449. <title><function>remove_hf_value2</function> usage</title>
  450. <programlisting>
  451. ...
  452. remove_hf_value2("foo") # remove foo[1]
  453. remove_hf_value2("foo[*]") # remove all foo's headers, the same as remove_hf_header("foo[*]");
  454. remove_hf_value2("foo[-1]") # last foo
  455. remove_hf_value2("foo.bar") # delete parameter
  456. remove_hf_value2("foo[*].bar") # for each foo delete bar parameters
  457. ...
  458. </programlisting>
  459. </example>
  460. </section>
  461. <section id="assign_hf_value">
  462. <title>
  463. <function>assign_hf_value(hf, xl_value)</function>
  464. </title>
  465. <para>
  466. Assign value to specified header value / param.
  467. </para>
  468. <para>Meaning of the parameters is as follows:</para>
  469. <itemizedlist>
  470. <listitem>
  471. <para><emphasis>hf_para</emphasis> - Header field value / param to be appended. Format: HFNAME [ [IDX] ] [. PARAM]
  472. If asterisk is specified as index then all values are affected.
  473. </para>
  474. </listitem>
  475. <listitem>
  476. <para><emphasis>xl_value</emphasis> - Value to be assigned, xl_lib formatting supported. If value is empty then no equal sign apears in param.
  477. </para>
  478. </listitem>
  479. </itemizedlist>
  480. <example>
  481. <title><function>assign_hf_value</function> usage</title>
  482. <programlisting>
  483. ...
  484. assign_hf_value("foo", "gogo") # foo[1]
  485. assign_hf_value("foo[-1]", "gogo") # foo[last_foo]
  486. assign_hf_value("foo.bar", "")
  487. assign_hf_value("foo[3].bar", "")
  488. assign_hf_value("foo[*]", "") # remove all foo's, empty value remains
  489. assign_hf_value("foo[*].bar", "") # set empty value (ex. lr)
  490. ...
  491. </programlisting>
  492. </example>
  493. </section>
  494. <section id="assign_hf_value2">
  495. <title>
  496. <function>assign_hf_value2(hf, xl_value)</function>
  497. </title>
  498. <para>
  499. Assign value to specified header. It is expected header in Authorization format (comma delimiters are not treated as multi-value delimiters).
  500. </para>
  501. <para>Meaning of the parameters is as follows:</para>
  502. <itemizedlist>
  503. <listitem>
  504. <para><emphasis>hf_para</emphasis> - Header field value / param to be appended. Format: HFNAME [ [IDX] ] [. PARAM]
  505. If asterisk is specified as index then all values are affected.
  506. </para>
  507. </listitem>
  508. <listitem>
  509. <para><emphasis>xl_value</emphasis> - Value to be assigned, xl_lib formatting supported. If value is empty then no equal sign apears in param.
  510. </para>
  511. </listitem>
  512. </itemizedlist>
  513. <example>
  514. <title><function>assign_hf_value2</function> usage</title>
  515. <programlisting>
  516. ...
  517. assign_hf_value2("Authorization.integrity-protected", "\"yes\"")
  518. assign_hf_value2("foo[-1]", "gogo") # foo[last_foo]
  519. assign_hf_value2("foo[*].bar", "") # set empty value (ex. lr)
  520. ...
  521. </programlisting>
  522. </example>
  523. </section>
  524. <section id="include_hf_value">
  525. <title>
  526. <function>include_hf_value(hf, xl_value)</function>
  527. </title>
  528. <para>
  529. Add value in set if not exists, eg. "Supported: path,100rel".
  530. </para>
  531. <para>Meaning of the parameters is as follows:</para>
  532. <itemizedlist>
  533. <listitem>
  534. <para><emphasis>hf</emphasis> - Header field name to be affected.
  535. </para>
  536. </listitem>
  537. <listitem>
  538. <para><emphasis>value</emphasis> - xl_lib formatting supported.
  539. </para>
  540. </listitem>
  541. </itemizedlist>
  542. <example>
  543. <title><function>include_hf_value</function> usage</title>
  544. <programlisting>
  545. ...
  546. include_hf_value("Supported", "path");
  547. ...
  548. </programlisting>
  549. </example>
  550. </section>
  551. <section id="exclude_hf_value">
  552. <title>
  553. <function>exclude_hf_value(hf, xl_value)</function>
  554. </title>
  555. <para>
  556. Remove value from set if exists, eg. "Supported: path,100rel".
  557. </para>
  558. <para>Meaning of the parameters is as follows:</para>
  559. <itemizedlist>
  560. <listitem>
  561. <para><emphasis>hf</emphasis> - Header field name to be affected.
  562. </para>
  563. </listitem>
  564. <listitem>
  565. <para><emphasis>value</emphasis> - xl_lib formatting supported.
  566. </para>
  567. </listitem>
  568. </itemizedlist>
  569. <example>
  570. <title><function>exclude_hf_value</function> usage</title>
  571. <programlisting>
  572. ...
  573. exclude_hf_value("Supported", "100rel");
  574. ...
  575. </programlisting>
  576. </example>
  577. </section>
  578. <section id="hf_value_exists">
  579. <title>
  580. <function>hf_value_exists(hf, xl_value)</function>
  581. </title>
  582. <para>
  583. Check if value exists in set. Alternate select <emphasis>@hf_value_exists.HF.VALUE</emphasis>
  584. may be used. It returns one or zero.
  585. </para>
  586. <para>Meaning of the parameters is as follows:</para>
  587. <itemizedlist>
  588. <listitem>
  589. <para><emphasis>hf</emphasis> - Header field name to be affected. Underscores are treated as dashes.
  590. </para>
  591. </listitem>
  592. <listitem>
  593. <para><emphasis>value</emphasis> - xl_lib formatting supported.
  594. </para>
  595. </listitem>
  596. </itemizedlist>
  597. <example>
  598. <title><function>hf_value_exists</function> usage</title>
  599. <programlisting>
  600. ...
  601. if (hf_value_exists("Supported", "100rel")) {
  602. }
  603. if (@hf_value_exists.supported.path == "1") {
  604. }
  605. ...
  606. </programlisting>
  607. </example>
  608. </section>
  609. <section id="@hf_value">
  610. <title>
  611. <function>@hf_value selects</function>
  612. </title>
  613. <para>
  614. Get value of required header-value or param. Note that functions called 'value2'
  615. works with Authorization-like headers where comma is not treated as value delimiter. Formats:
  616. @hf_value.HFNAME[IDX] # idx value, negative value counts from bottom
  617. @hf_value.HFNAME.PARAM_NAME
  618. @hf_value.HFNAME[IDX].PARAM_NAME
  619. @hf_value.HFNAME.p.PARAM_NAME # or .param., useful if requred called "uri", "p", "param"
  620. @hf_value.HFNAME[IDX].p.PARAM_NAME # dtto
  621. @hf_value.HFNAME[IDX].uri # (&lt; &amp; &gt; excluded)
  622. @hf_value.HFNAME[*] # return comma delimited list of all values (combines headers)
  623. @hf_value.HFNAME # the same as above [*] but may be parsed by cfg.y
  624. @hf_value.HFNAME[*].uri # return comma delimited list of uris (&lt; &amp; &gt; excluded)
  625. @hf_value.HFNAME.uri # the same as above [*] but may be parsed by cfg.y
  626. @hf_value.HFNAME[IDX].name # returns name part, quotes excluded
  627. @hf_value.HFNAME.name # returns name part of the first value
  628. @hf_value2.HFNAME # returns value of first header
  629. @hf_value2.HFNAME[IDX] # returns value of idx's header
  630. @hf_value2.HFNAME.PARAM_NAME
  631. @hf_value2.HFNAME[IDX].PARAM_NAME
  632. @hf_value.HFNAME[IDX].uri # return URI, quotes excluded
  633. @hf_value.HFNAME.p.uri # returns param named uri, not URI itself
  634. @hf_value.HFNAME.p.name # returns param named name, not name itself
  635. @hf_value.HFNAME[IDX].uri.name # any sel_any_uri nested features may be used
  636. @hf_value.HFNAME[IDX].nameaddr.name # select_any_nameaddr
  637. </para>
  638. <para>Meaning of the parameters is as follows:</para>
  639. <itemizedlist>
  640. <listitem>
  641. <para><emphasis>HFNAME</emphasis> - Header field name. Underscores are treated as dashes.
  642. </para>
  643. </listitem>
  644. <listitem>
  645. <para><emphasis>IDX</emphasis> - Value index, negative value counts from bottom
  646. </para>
  647. </listitem>
  648. <listitem>
  649. <para><emphasis>PARAM_NAME</emphasis> - name of parameter
  650. </para>
  651. </listitem>
  652. </itemizedlist>
  653. <example>
  654. <title><function>@hf_value select</function> usage</title>
  655. <programlisting>
  656. ...
  657. $a = @hf_value.my_header[1].my_param;
  658. xplog("L_ERR", "%@hf_value.via[-1], %@hf_value.from.tag\n");
  659. $b = @hf_value.p_associated_uri;
  660. xplog("L_ERR", "Route uris: '%@hf_value.route[*].uri'\n");
  661. $rr = @hf_value.route.uri;
  662. $prt = @hf_value2.authorization.integrity_protected;
  663. ...
  664. </programlisting>
  665. </example>
  666. </section>
  667. </section>