[Pkg-voip-commits] r9854 - in /kamailio/trunk/debian: control.tls patches/series patches/upstream/0002-modules_k-presence_xml-Xcap-auth-reason-when-user-de.patch
maniac-guest at alioth.debian.org
maniac-guest at alioth.debian.org
Thu Jun 28 06:24:50 UTC 2012
Author: maniac-guest
Date: Thu Jun 28 06:24:49 2012
New Revision: 9854
URL: http://svn.debian.org/wsvn/pkg-voip/?sc=1&rev=9854
Log:
upstream fix. update control.tls
Added:
kamailio/trunk/debian/patches/upstream/0002-modules_k-presence_xml-Xcap-auth-reason-when-user-de.patch
Modified:
kamailio/trunk/debian/control.tls
kamailio/trunk/debian/patches/series
Modified: kamailio/trunk/debian/control.tls
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/control.tls?rev=9854&op=diff
==============================================================================
--- kamailio/trunk/debian/control.tls (original)
+++ kamailio/trunk/debian/control.tls Thu Jun 28 06:24:49 2012
@@ -17,7 +17,9 @@
libgeoip-dev (>= 1.4.5),
libjson0-dev,
libldap2-dev,
+ liblua5.1-0-dev,
libmemcache-dev,
+ libmono-2.0-dev,
libmysqlclient-dev,
libncurses5-dev,
libpcre3-dev,
@@ -46,7 +48,7 @@
Pre-Depends: ${misc:Pre-Depends}
Depends: ${shlibs:Depends}, ${misc:Depends}, python, adduser
Replaces: openser
-Suggests: kamailio-mysql-modules, kamailio-postgres-modules, kamailio-unixodbc-modules, kamailio-cpl-modules, kamailio-radius-modules, kamailio-presence-modules, kamailio-xml-modules, kamailio-perl-modules, kamailio-snmpstats-modules, kamailio-xmpp-modules, kamailio-carrierroute-modules, kamailio-berkeley-modules, kamailio-ldap-modules, kamailio-python-modules, kamailio-redis-modules, kamailio-tls-modules
+Suggests: kamailio-mysql-modules, kamailio-postgres-modules, kamailio-unixodbc-modules, kamailio-cpl-modules, kamailio-radius-modules, kamailio-presence-modules, kamailio-xml-modules, kamailio-perl-modules, kamailio-snmpstats-modules, kamailio-xmpp-modules, kamailio-carrierroute-modules, kamailio-berkeley-modules, kamailio-ldap-modules, kamailio-python-modules, kamailio-redis-modules, kamailio-lua-modules, kamailio-mono-modules, kamailio-tls-modules
Description: very fast and configurable SIP proxy
Kamailio is a very fast and flexible SIP (RFC3261)
proxy server. Written entirely in C, Kamailio can handle thousands calls
@@ -132,6 +134,32 @@
This package provides the memcached module, an interface to the memcached
server, a high-performance, distributed memory object caching system.
+Package: kamailio-lua-modules
+Architecture: any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: ${misc:Depends}, ${shlibs:Depends}, kamailio (= ${binary:Version})
+Description: contains the app_lua module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the app_lua module, an extension allowing to
+ execute embedded Lua applications within configuration file.
+
+Package: kamailio-mono-modules
+Architecture: any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Depends: ${misc:Depends}, ${shlibs:Depends}, kamailio (= ${Source-Version})
+Description: contains the app_mono module
+ Kamailio is a very fast and flexible SIP (RFC3261)
+ proxy server. Written entirely in C, Kamailio can handle thousands calls
+ per second even on low-budget hardware.
+ .
+ This package provides the app_mono module, an extension allowing to
+ execute embedded Mono applications within configuration file.
+
Package: kamailio-python-modules
Architecture: any
Multi-Arch: same
@@ -359,6 +387,7 @@
Package: kamailio-tls-modules
Architecture: any
Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
Depends: ${misc:Depends}, ${shlibs:Depends}, kamailio (= ${binary:Version})
Description: contains the TLS kamailio transport module
This has been split out of the main kamailio package, so that kamailio will
Modified: kamailio/trunk/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/series?rev=9854&op=diff
==============================================================================
--- kamailio/trunk/debian/patches/series (original)
+++ kamailio/trunk/debian/patches/series Thu Jun 28 06:24:49 2012
@@ -1,3 +1,4 @@
upstream/0001-dialog-k-proper-unlock-of-profile-for-mi-list-comman.patch
+upstream/0002-modules_k-presence_xml-Xcap-auth-reason-when-user-de.patch
multiarch_support.patch
no_INSTALL_file.patch
Added: kamailio/trunk/debian/patches/upstream/0002-modules_k-presence_xml-Xcap-auth-reason-when-user-de.patch
URL: http://svn.debian.org/wsvn/pkg-voip/kamailio/trunk/debian/patches/upstream/0002-modules_k-presence_xml-Xcap-auth-reason-when-user-de.patch?rev=9854&op=file
==============================================================================
--- kamailio/trunk/debian/patches/upstream/0002-modules_k-presence_xml-Xcap-auth-reason-when-user-de.patch (added)
+++ kamailio/trunk/debian/patches/upstream/0002-modules_k-presence_xml-Xcap-auth-reason-when-user-de.patch Thu Jun 28 06:24:49 2012
@@ -1,0 +1,323 @@
+From 3abf967f61a1bd95c28d4e8a929a8bd5df00671d Mon Sep 17 00:00:00 2001
+From: Anca Vamanu <anca.vamanu at 1and1.ro>
+Date: Wed, 27 Jun 2012 18:34:55 +0300
+Subject: [PATCH] modules_k/presence_xml Xcap auth reason when user deleted
+ from list
+
+The reason in Subscription-Status header in Notify when a user is
+deleted from the contact list can be decided by the admin by setting
+presence_xml module parameter xcapauth_usedel_reason. Default value is
+"probation".
+---
+ modules_k/presence/presence.c | 10 +---
+ modules_k/presence_xml/README | 32 ++++++++++--
+ modules_k/presence_xml/doc/presence_xml_admin.xml | 29 +++++++++++
+ modules_k/presence_xml/presence_xml.c | 4 ++
+ modules_k/presence_xml/xcap_auth.c | 55 ++++++++++++---------
+ 5 files changed, 94 insertions(+), 36 deletions(-)
+
+diff --git a/modules_k/presence/presence.c b/modules_k/presence/presence.c
+index 95a7127..29470bc 100644
+--- a/modules_k/presence/presence.c
++++ b/modules_k/presence/presence.c
+@@ -828,17 +828,9 @@ int pres_update_status(subs_t subs, str reason, db_key_t* query_cols,
+ query_vals[q_wuser_col].val.str_val= subs.watcher_user;
+ query_vals[q_wdomain_col].val.str_val= subs.watcher_domain;
+
+- /* if status is no longer ACTIVE, switch to terminated */
+- if(subs.status!=status && status==ACTIVE_STATUS)
+- {
+- subs.status = TERMINATED_STATUS;
+- subs.reason.s = get_status_str(TERMINATED_STATUS);
+- subs.reason.len = strlen(subs.reason.s);
+- }
+-
+ update_vals[u_status_col].val.int_val= subs.status;
+ update_vals[u_reason_col].val.str_val= subs.reason;
+-
++
+ if (pa_dbf.use_table(pa_db, &watchers_table) < 0)
+ {
+ LM_ERR( "in use_table\n");
+diff --git a/modules_k/presence_xml/README b/modules_k/presence_xml/README
+index 3f2d281..e42dbed 100644
+--- a/modules_k/presence_xml/README
++++ b/modules_k/presence_xml/README
+@@ -32,6 +32,7 @@ Anca-Maria Vamanu
+ 3.7. integrated_xcap_server (int)
+ 3.8. xcap_server (str)
+ 3.9. passive_mode(int)
++ 3.10. xcapauth_userdel_reason(str)
+
+ 4. Functions
+
+@@ -54,8 +55,9 @@ Anca-Maria Vamanu
+ 1.7. Set integrated_xcap_server parameter
+ 1.8. Set xcap_server parameter
+ 1.9. Set passive_mode parameter
+- 1.10. pres_check_basic usage
+- 1.11. pres_check_activities usage
++ 1.10. Set xcapauth_userdel_reason parameter
++ 1.11. pres_check_basic usage
++ 1.12. pres_check_activities usage
+
+ Chapter 1. Admin Guide
+
+@@ -78,6 +80,7 @@ Chapter 1. Admin Guide
+ 3.7. integrated_xcap_server (int)
+ 3.8. xcap_server (str)
+ 3.9. passive_mode(int)
++ 3.10. xcapauth_userdel_reason(str)
+
+ 4. Functions
+
+@@ -135,6 +138,7 @@ Chapter 1. Admin Guide
+ 3.7. integrated_xcap_server (int)
+ 3.8. xcap_server (str)
+ 3.9. passive_mode(int)
++ 3.10. xcapauth_userdel_reason(str)
+
+ 3.1. db_url(str)
+
+@@ -260,6 +264,26 @@ modparam("presence_xml", "xcap_server", "xcap_server.ag.org")
+ modparam("presence_xml", "passive_mode", 1)
+ ...
+
++3.10. xcapauth_userdel_reason(str)
++
++ This parameter represents the reason that will be included in the
++ Subscription-State header of the Notify when a rule is no longer found
++ in the XCAP pres-auth document for a user that was previously allowed.
++ The Subscription state in this case switches to "terminated". Because
++ it is not clear which reason is most appropriate in this case from the
++ ones defined by the RFC 3265, this parameter offers the possibility for
++ the admin to decide which one he wishes to use.
++
++ Default value: âprobationâ . Since probation also accepts a retry-after
++ parameter to specify after at least how may seconds the client should
++ reattempt to resubscribe, you can include this in the parameter also.
++
++ Example 1.10. Set xcapauth_userdel_reason parameter
++...
++modparam("presence_xml", "xcapauth_userdel_reason", "probation;retry-after=30")
++modparam("presence_xml", "xcapauth_userdel_reason", "rejected")
++...
++
+ 4. Functions
+
+ 4.1. pres_check_basic(presentity_uri, status)
+@@ -276,7 +300,7 @@ modparam("presence_xml", "passive_mode", 1)
+ * 1 - if a match is found.
+ * -1 - if a match is not found.
+
+- Example 1.10. pres_check_basic usage
++ Example 1.11. pres_check_basic usage
+ ...
+ if (pres_check_basic("$ru", "open")) {
+ ...
+@@ -300,7 +324,7 @@ modparam("presence_xml", "passive_mode", 1)
+ * -1 - if a match is not found.
+ * -2 - if /presence/person or /presence/person/activity do not exist.
+
+- Example 1.11. pres_check_activities usage
++ Example 1.12. pres_check_activities usage
+ ...
+ if (pres_check_basic("$ru", "open")) {
+ pres_check_activities("$ru", "unknown");
+diff --git a/modules_k/presence_xml/doc/presence_xml_admin.xml b/modules_k/presence_xml/doc/presence_xml_admin.xml
+index 69252a5..57b4f26 100644
+--- a/modules_k/presence_xml/doc/presence_xml_admin.xml
++++ b/modules_k/presence_xml/doc/presence_xml_admin.xml
+@@ -288,8 +288,37 @@ modparam("presence_xml", "passive_mode", 1)
+ </programlisting>
+ </example>
+ </section>
++
++ <section>
++ <title><varname>xcapauth_userdel_reason</varname>(str)</title>
++ <para>
++ This parameter represents the reason that will be included in the
++ Subscription-State header of the Notify when a rule is no longer found
++ in the XCAP pres-auth document for a user that was previously allowed.
++ The Subscription state in this case switches to "terminated". Because
++ it is not clear which reason is most appropriate in this case from
++ the ones defined by the RFC 3265, this parameter offers the possibility
++ for the admin to decide which one he wishes to use.
++ </para>
++ <para>
++ <emphasis>Default value: <quote>probation</quote> </emphasis> . Since
++ probation also accepts a retry-after parameter to specify after at
++ least how may seconds the client should reattempt to resubscribe,
++ you can include this in the parameter also.
++ </para>
++ <example>
++ <title>Set <varname>xcapauth_userdel_reason</varname> parameter</title>
++ <programlisting format="linespecific">
++...
++modparam("presence_xml", "xcapauth_userdel_reason", "probation;retry-after=30")
++modparam("presence_xml", "xcapauth_userdel_reason", "rejected")
++...
++</programlisting>
++ </example>
++ </section>
+ </section>
+
++
+ <section>
+ <title>Functions</title>
+ <section>
+diff --git a/modules_k/presence_xml/presence_xml.c b/modules_k/presence_xml/presence_xml.c
+index 52b4e60..45fcbd5 100644
+--- a/modules_k/presence_xml/presence_xml.c
++++ b/modules_k/presence_xml/presence_xml.c
+@@ -94,6 +94,7 @@ int disable_presence = 0;
+ int disable_winfo = 0;
+ int disable_bla = 1;
+ int passive_mode = 0;
++str xcapauth_userdel_reason = str_init("probation");
+
+ /** SL API structure */
+ sl_api_t slb;
+@@ -126,6 +127,7 @@ static param_export_t params[]={
+ { "disable_winfo", INT_PARAM, &disable_winfo },
+ { "disable_bla", INT_PARAM, &disable_bla },
+ { "passive_mode", INT_PARAM, &passive_mode },
++ { "xcapauth_userdel_reason", STR_PARAM, &xcapauth_userdel_reason.s},
+ { 0, 0, 0}
+ };
+
+@@ -168,6 +170,8 @@ static int mod_init(void)
+ return -1;
+ }
+
++ xcapauth_userdel_reason.len = strlen(xcapauth_userdel_reason.s);
++
+ db_url.len = db_url.s ? strlen(db_url.s) : 0;
+ LM_DBG("db_url=%s/%d/%p\n",ZSW(db_url.s),db_url.len, db_url.s);
+ xcap_table.len = xcap_table.s ? strlen(xcap_table.s) : 0;
+diff --git a/modules_k/presence_xml/xcap_auth.c b/modules_k/presence_xml/xcap_auth.c
+index 4492170..ad2603d 100644
+--- a/modules_k/presence_xml/xcap_auth.c
++++ b/modules_k/presence_xml/xcap_auth.c
+@@ -47,6 +47,8 @@
+ #include "xcap_auth.h"
+ #include "pidf.h"
+
++extern str xcapauth_userdel_reason;
++
+ int http_get_rules_doc(str user, str domain, str* rules_doc);
+
+ int pres_watcher_allowed(subs_t* subs)
+@@ -55,7 +57,8 @@ int pres_watcher_allowed(subs_t* subs)
+ xmlNodePtr node= NULL, actions_node = NULL;
+ xmlNodePtr sub_handling_node = NULL;
+ char* sub_handling = NULL;
+-
++ int ret = 0;
++
+ /* if force_active set status to active*/
+ if(force_active)
+ {
+@@ -64,12 +67,12 @@ int pres_watcher_allowed(subs_t* subs)
+ subs->reason.len= 0;
+ return 0;
+ }
+- subs->status= PENDING_STATUS;
+- subs->reason.s= NULL;
+- subs->reason.len= 0;
+
+ if(subs->auth_rules_doc== NULL)
+ {
++ subs->status= PENDING_STATUS;
++ subs->reason.s= NULL;
++ subs->reason.len= 0;
+ return 0;
+ }
+
+@@ -84,27 +87,35 @@ int pres_watcher_allowed(subs_t* subs)
+ node= get_rule_node(subs, xcap_tree);
+ if(node== NULL)
+ {
+- xmlFreeDoc(xcap_tree);
+- return 0;
++ /* if no rule node was found and the previous state was active -> set the
++ * state to terminated with reason xcapauth_userdel_reason (default "probation") */
++ if(subs->status != PENDING_STATUS)
++ {
++ subs->status= TERMINATED_STATUS;
++ subs->reason= xcapauth_userdel_reason;
++ }
++ goto done;
+ }
+
+- /* process actions */
++ subs->status= PENDING_STATUS;
++ subs->reason.s= NULL;
++ subs->reason.len= 0;
++
++ /* process actions */
+ actions_node = xmlNodeGetChildByName(node, "actions");
+ if(actions_node == NULL)
+- {
++ {
+ LM_DBG("actions_node NULL\n");
+- xmlFreeDoc(xcap_tree);
+- return 0;
++ goto done;
+ }
+ LM_DBG("actions_node->name= %s\n",
+ actions_node->name);
+
+ sub_handling_node = xmlNodeGetChildByName(actions_node, "sub-handling");
+ if(sub_handling_node== NULL)
+- {
++ {
+ LM_DBG("sub_handling_node NULL\n");
+- xmlFreeDoc(xcap_tree);
+- return 0;
++ goto done;
+ }
+ sub_handling = (char*)xmlNodeGetContent(sub_handling_node);
+ LM_DBG("sub_handling_node->name= %s\n",
+@@ -115,8 +126,8 @@ int pres_watcher_allowed(subs_t* subs)
+ if(sub_handling== NULL)
+ {
+ LM_ERR("Couldn't get sub-handling content\n");
+- xmlFreeDoc(xcap_tree);
+- return -1;
++ ret = -1;
++ goto done;
+ }
+ if( strncmp((char*)sub_handling, "block",5 )==0)
+ {
+@@ -140,21 +151,19 @@ int pres_watcher_allowed(subs_t* subs)
+ if( strncmp((char*)sub_handling , "allow",5 )==0)
+ {
+ subs->status = ACTIVE_STATUS;
+- subs->reason.s = NULL;
+ }
+ else
+ {
+ LM_ERR("unknown subscription handling action\n");
+- xmlFree(sub_handling);
+- xmlFreeDoc(xcap_tree);
+- return -1;
++ ret = -1;
+ }
+
+- xmlFree(sub_handling);
++done:
++ if(sub_handling)
++ xmlFree(sub_handling);
+ xmlFreeDoc(xcap_tree);
+- return 0;
+-
+-}
++ return ret;
++}
+
+ xmlNodePtr get_rule_node(subs_t* subs, xmlDocPtr xcap_tree )
+ {
+--
+1.7.9.5
+
More information about the Pkg-voip-commits
mailing list