<!-- Module Developer's Guide -->

<chapter>
	<chapterinfo>
	<revhistory>
		<revision>
		<revnumber>$Revision: 1827 $</revnumber>
		<date>$Date: 2007-03-12 17:22:53 +0200 (Mon, 12 Mar 2007) $</date>
		</revision>
	</revhistory>
	</chapterinfo>
	<title>Developer's Guide</title>
	<section>
	<title>Available Functions</title>

	<section>
		<title>
		<function moreinfo="none">register_dlgcb (dialog, type, cb, param)</function>
		</title>
		<para>
		Register a new callback to the dialog.
		</para>
		<para>Meaning of the parameters is as follows:</para>
		<itemizedlist>
		<listitem>
			<para><emphasis>struct dlg_cell* dlg</emphasis> - dialog to 
			register callback to. If maybe NULL only for DLG_CREATED callback
			type, which is not a per dialog type.
			</para>
		</listitem>
		<listitem>
			<para><emphasis>int type</emphasis> - types of callbacks; more
			types may be register for the same callback function; only 
			DLG_CREATED must be register alone. Possible types:
			<itemizedlist>
			<listitem>
				<para><emphasis>DLG_CREATED</emphasis> - called when a new 
				dialog is created - it's a global type (not associated to 
				any dialog)
				</para>
			</listitem>
			<listitem>
				<para><emphasis>DLG_FAILED</emphasis> - called when the dialog
				was negatively replied (non-2xx) - it's a per dialog type.
				</para>
			</listitem>
			<listitem>
				<para><emphasis>DLG_CONFIRMED</emphasis> - called when the 
				dialog is confirmed (2xx replied) - it's a per dialog type.
				</para>
			</listitem>
			<listitem>
				<para><emphasis>DLG_REQ_WITHIN</emphasis> - called when the 
				dialog matches a sequential request - it's a per dialog type.
				</para>
			</listitem>
			<listitem>
				<para><emphasis>DLG_TERMINATED</emphasis> - called when the 
				dialog is terminated via BYE - it's a per dialog type.
				</para>
			</listitem>
			<listitem>
				<para><emphasis>DLG_EXPIRED</emphasis> - called when the 
				dialog expires without receiving a BYE - it's a per dialog 
				type.
				</para>
			</listitem>
			</itemizedlist>
			</para>
		</listitem>
		<listitem>
			<para><emphasis>dialog_cb f</emphasis> - callback function to be 
			called. Prototype is: <quote>void (dialog_cb) 
			(struct dlg_cell* dlg, int type, struct sip_msg* msg, 
			void** param);</quote>
			</para>
		</listitem>
		<listitem>
			<para><emphasis>void *param</emphasis> - parameter to be passed to
			the callback function.
			</para>
		</listitem>

		</itemizedlist>
	</section>

	</section>

</chapter>

<!-- Keep this element at the end of the file
Local Variables:
sgml-parent-document: ("dialog.sgml" "book" "chapter")
End:
-->
