2
0

dialog_ng_devel.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. <?xml version="1.0" encoding='ISO-8859-1'?>
  2. <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
  4. <!-- Include general documentation entities -->
  5. <!ENTITY % docentities SYSTEM "../../../docbook/entities.xml">
  6. %docentities;
  7. ]>
  8. <!-- Module Developer's Guide -->
  9. <chapter>
  10. <title>&develguide;</title>
  11. <section>
  12. <title>Available Functions</title>
  13. <section>
  14. <title>
  15. <function moreinfo="none">register_dlgcb (dialog, type, cb, param, free_param_cb)</function>
  16. </title>
  17. <para>
  18. Register a new callback to the dialog.
  19. </para>
  20. <para>Meaning of the parameters is as follows:</para>
  21. <itemizedlist>
  22. <listitem>
  23. <para>
  24. <emphasis>struct dlg_cell* dlg</emphasis> - dialog to
  25. register callback to. If maybe NULL only for DLGCB_CREATED callback
  26. type, which is not a per dialog type.
  27. </para>
  28. </listitem>
  29. <listitem>
  30. <para>
  31. <emphasis>int type</emphasis> - types of callbacks; more
  32. types may be register for the same callback function; only
  33. DLGCB_CREATED must be register alone. Possible types:
  34. <itemizedlist>
  35. <listitem>
  36. <para>
  37. <emphasis>DLGCB_LOADED</emphasis>
  38. </para>
  39. </listitem>
  40. <listitem>
  41. <para>
  42. <emphasis>DLGCB_CREATED</emphasis> - called when a new
  43. dialog is created - it's a global type (not associated to
  44. any dialog)
  45. </para>
  46. </listitem>
  47. <listitem>
  48. <para>
  49. <emphasis>DLGCB_FAILED</emphasis> - called when the dialog
  50. was negatively replied (non-2xx) - it's a per dialog type.
  51. </para>
  52. </listitem>
  53. <listitem>
  54. <para>
  55. <emphasis>DLGCB_CONFIRMED_NA</emphasis> - called when the
  56. dialog is confirmed (2xx replied) but the setup-concluding ACK
  57. message from the caller is yet pending - it's a per dialog type.
  58. </para>
  59. </listitem>
  60. <listitem>
  61. <para>
  62. <emphasis>DLGCB_CONFIRMED</emphasis> - called when the
  63. dialog is confirmed (2xx replied) and the setup-concluding ACK
  64. message from the caller has been seen - it's a per dialog type.
  65. </para>
  66. </listitem>
  67. <listitem>
  68. <para>
  69. <emphasis>DLGCB_REQ_WITHIN</emphasis> - called when the
  70. dialog matches a sequential request (excluding setup-concluding
  71. ACK messages which are handled in DLGCB_CONFIRMED) - it's a per
  72. dialog type.
  73. </para>
  74. </listitem>
  75. <listitem>
  76. <para>
  77. <emphasis>DLGCB_TERMINATED</emphasis> - called when the
  78. dialog is terminated via BYE - it's a per dialog type.
  79. </para>
  80. </listitem>
  81. <listitem>
  82. <para>
  83. <emphasis>DLGCB_TERMINATED_CONFIRMED</emphasis> -
  84. called when response to a BYE request is received - it's a
  85. per dialog type.
  86. </para>
  87. </listitem>
  88. <listitem>
  89. <para>
  90. <emphasis>DLGCB_EXPIRED</emphasis> - called when the
  91. dialog expires without receiving a BYE - it's a per dialog
  92. type.
  93. </para>
  94. </listitem>
  95. <listitem>
  96. <para>
  97. <emphasis>DLGCB_EARLY</emphasis> - called when the
  98. dialog is created in an early state (18x replied) - it's
  99. a per dialog type.
  100. </para>
  101. </listitem>
  102. <listitem>
  103. <para>
  104. <emphasis>DLGCB_RESPONSE_FWDED</emphasis> - called when
  105. the dialog matches a reply to the initial INVITE request - it's
  106. a per dialog type.
  107. </para>
  108. </listitem>
  109. <listitem>
  110. <para>
  111. <emphasis>DLGCB_RESPONSE_WITHIN</emphasis> - called when
  112. the dialog matches a reply to a subsequent in dialog request
  113. - it's a per dialog type.
  114. </para>
  115. </listitem>
  116. <listitem>
  117. <para>
  118. <emphasis>DLGCB_MI_CONTEXT</emphasis> - called when the
  119. mi dlg_list_ctx command is invoked - it's a per dialog type.
  120. </para>
  121. </listitem>
  122. <listitem>
  123. <para>
  124. <emphasis>DLGCB_SPIRALED</emphasis> - called when the
  125. dialog matches a spiraling request - it's a per dialog type.
  126. </para>
  127. </listitem>
  128. <listitem>
  129. <para>
  130. <emphasis>DLGCB_DESTROY</emphasis>
  131. </para>
  132. </listitem>
  133. </itemizedlist>
  134. </para>
  135. </listitem>
  136. <listitem>
  137. <para>
  138. <emphasis>dialog_cb cb</emphasis> - callback function to be
  139. called. Prototype is:
  140. <quote>void (dialog_cb)
  141. (struct dlg_cell* dlg, int type, struct dlg_cb_params * params);
  142. </quote>
  143. </para>
  144. </listitem>
  145. <listitem>
  146. <para>
  147. <emphasis>void *param</emphasis> - parameter to be passed to
  148. the callback function.
  149. </para>
  150. </listitem>
  151. <listitem>
  152. <para>
  153. <emphasis>param_free callback_param_free</emphasis> -
  154. callback function to be called to free the param.
  155. Prototype is:
  156. <quote>void (param_free_cb) (void *param);</quote>
  157. </para>
  158. </listitem>
  159. </itemizedlist>
  160. </section>
  161. <section>
  162. <title>
  163. <function moreinfo="none">terminate_dlg (str callid, str ftag, str ttag, hdrs)</function>
  164. </title>
  165. <para>
  166. Terminate a Dialog identified by callid, ftag and ttag in early or confirmed state.
  167. </para>
  168. <para>Meaning of parameters is as follows:</para>
  169. <itemizedlist>
  170. <listitem>
  171. <para>
  172. <emphasis>str* callid</emphasis> - callid of dialog to
  173. terminate.
  174. </para>
  175. </listitem>
  176. <listitem>
  177. <para>
  178. <emphasis>str* ftag</emphasis> - from_tag of dialog to
  179. terminate.
  180. </para>
  181. </listitem>
  182. <listitem>
  183. <para>
  184. <emphasis>str* ttag</emphasis> - to tag of dialog to
  185. terminate.
  186. </para>
  187. </listitem>
  188. <listitem>
  189. <para>
  190. <emphasis>str* hdrs</emphasis> - string containg extra headers (full format)
  191. to be added to the BYE requests of the dialog.
  192. </para>
  193. </listitem>
  194. </itemizedlist>
  195. </section>
  196. <section>
  197. <title>
  198. <function moreinfo="none">lookup_terminate_dlg (unsigned int h_entry, unsigned int h_id, hdrs)</function>
  199. </title>
  200. <para>
  201. Terminate a Dialog identified by h_entry and h_id (similar to dlg_end_dlg command via XMLRPC).
  202. </para>
  203. <para>Meaning of parameters is as follows:</para>
  204. <itemizedlist>
  205. <listitem>
  206. <para>
  207. <emphasis>unsigned int h_entry</emphasis> - Number of the table, where to find the dialog
  208. </para>
  209. </listitem>
  210. <listitem>
  211. <para>
  212. <emphasis>unsigned int h_id</emphasis> - Number of the entry in the table, where to find the dialog
  213. terminate.
  214. </para>
  215. </listitem>
  216. <listitem>
  217. <para>
  218. <emphasis>str* hdrs</emphasis> - string containg extra headers (full format)
  219. to be added to the BYE requests of the dialog.
  220. </para>
  221. </listitem>
  222. </itemizedlist>
  223. </section>
  224. <section>
  225. <title>
  226. <function moreinfo="none">set_dlg_var (dlg, key, val)</function>
  227. </title>
  228. <para>
  229. Add a variable to the dialog structure
  230. </para>
  231. <para>Meaning of parameters is as follows:</para>
  232. <itemizedlist>
  233. <listitem>
  234. <para>
  235. <emphasis>struct dlg_cell* dlg</emphasis> - dialog to
  236. add to.
  237. </para>
  238. </listitem>
  239. <listitem>
  240. <para>
  241. <emphasis>str* key</emphasis> - Name of the variable.
  242. </para>
  243. </listitem>
  244. <listitem>
  245. <para>
  246. <emphasis>str* val</emphasis> - Value of the variable.
  247. </para>
  248. </listitem>
  249. </itemizedlist>
  250. </section>
  251. <section>
  252. <title>
  253. <function moreinfo="none">get_dlg_var (dlg, key)</function>
  254. </title>
  255. <para>
  256. Retrieves a variable attached to the dialog structure
  257. </para>
  258. <para>Meaning of parameters is as follows:</para>
  259. <itemizedlist>
  260. <listitem>
  261. <para>
  262. <emphasis>struct dlg_cell* dlg</emphasis> - dialog to
  263. get the variable from.
  264. </para>
  265. </listitem>
  266. <listitem>
  267. <para>
  268. <emphasis>str* key</emphasis> - Name of the variable.
  269. </para>
  270. </listitem>
  271. </itemizedlist>
  272. </section>
  273. <section>
  274. <title>
  275. <function moreinfo="none">get_current_dialog ()</function>
  276. </title>
  277. <para>
  278. Get the current dialog for a message, if exists
  279. </para>
  280. </section>
  281. </section>
  282. </chapter>