[sr-dev] git:carstenbock/ims: - added some Usage-examples

Carsten Bock carsten at bock.info
Mon Mar 28 21:58:41 CEST 2011


Module: sip-router
Branch: carstenbock/ims
Commit: 5569b0237f18169fc4d18dac9f1599df5e1d0735
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=5569b0237f18169fc4d18dac9f1599df5e1d0735

Author: Carsten Bock <carsten at bock.info>
Committer: Carsten Bock <carsten at bock.info>
Date:   Mon Mar 28 21:56:10 2011 +0200

- added some Usage-examples
- improved the usage notes for reginfo_handle_notify() (updated the docs to what the function should be like ;-) )
- updated the example for reginfo_handle_notify()

---

 modules_k/pua_reginfo/doc/pua_reginfo_admin.xml |   44 +++++++++++++++++++++-
 1 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/modules_k/pua_reginfo/doc/pua_reginfo_admin.xml b/modules_k/pua_reginfo/doc/pua_reginfo_admin.xml
index cf54d6b..6ecc39a 100644
--- a/modules_k/pua_reginfo/doc/pua_reginfo_admin.xml
+++ b/modules_k/pua_reginfo/doc/pua_reginfo_admin.xml
@@ -35,6 +35,24 @@
  	      And finally, it can process received "NOTIFY" requests and it will 
               update the local registry accordingly.
 	    </para>
+	    <para>
+ 	      Use cases for this might be:
+		<itemizedlist>
+		<listitem>Keeping different Servers in Sync regarding
+		the location database
+		</listitem>
+		<listitem>Get notified, when a user registers: A presence-server,
+		which handles offline message storage for an account, would get
+		notified, when the user comes online.
+		</listitem>
+		<listitem>A client could subscribe to it's own registration-status,
+		so he would get notified as soon as his account gets administratively
+		unregistered.
+		</listitem>
+		<listitem>...</listitem>
+		</itemizedlist>
+	    </para>
+
 	</section>
 
 	<section>
@@ -145,7 +163,7 @@ modparam("pua_reginfo", "outbound_proxy", "sip:proxy at kamailio.org")
 		<title>Set <varname>server_address</varname> parameter</title>
 		<programlisting format="linespecific">
 ...
-modparam("pua_reginfo", "server_address", "sip:bla at 160.34.23.12")
+modparam("pua_reginfo", "server_address", "sip:reginfo at 160.34.23.12")
 ...
 </programlisting>
 		</example>
@@ -161,12 +179,34 @@ modparam("pua_reginfo", "server_address", "sip:bla at 160.34.23.12")
 				This function processes received "NOTIFY"-requests and updates
 				the local registry accordingly.
 			</para>
+			<para>
+				This method does not create any SIP-Reponse, this has to be done
+				the script-writer.
+			</para>
+			<para>Return codes:</para>
+			<itemizedlist>
+			<listitem>
+				<para>
+				<emphasis>2</emphasis> - contacts successfully updated,
+				but no more contacts online now.
+				</para>
+				<para>
+				<emphasis>1</emphasis> - contacts successfully updated and at
+				at least one contact still registered.
+				</para>
+				<para>
+				<emphasis>-1</emphasis> - Invalid NOTIFY or other error (see log-file)
+				</para>
+			</listitem>
+			</itemizedlist>
+
 			<example>
 				<title><function>reginfo_handle_notify</function> usage</title>
 				<programlisting format="linespecific">
 ...
 if(is_method("NOTIFY")) 
-	reginfo_handle_notify();		
+	if (reginfo_handle_notify())
+		send_reply("202", "Accepted");
 ...
 				</programlisting>
 			</example>




More information about the sr-dev mailing list