Hi All:
I have had NO success in registering my SIP ID via my SIP client, jitsi.
How do I debug this? Where do I look?
Steps do far...
I have successfully created a subscriber with
kamctl add romeo romeo123
I also see that the Siremis web interface has been updated correctly.
When I use jitsi to REGISTER the subscriber, I do not see any response.
The REGISTER request is hitting the server but I don't understand the routing code well enough to debug it.
The expectation was that something this basic would work out-of-the-box :(
I'm following instructions from the link below:
http://nil.uniza.sk/sip/kamailio/adding-mysql-support-kamailio-31-debian-le….
Please HELP.
-Auro
Hi All:
I have had no success in registering my SIP ID via my SIP client, jitsi.
How do I debug this? Where do I look?
Steps do far...
I have successfully created a subscriber with
kamctl add romeo romeo123
I also see that the Siremis web interface has been updated correctly.
When I use jitsi to REGISTER the subscriber, I do not see any response.
The request is hitting the server but I don't understand the routing code well enough to debug it.
The expectation was that something this basic should work out of the box :(
-Auro
I'm following instructions from the link below:
http://nil.uniza.sk/sip/kamailio/adding-mysql-support-kamailio-31-debian-le….
Please HELP.
From: Auro Tripathy
Sent: Monday, June 25, 2012 8:35 AM
To: miconda(a)gmail.com; Development mailing list of the sip-router project
Subject: RE: [sr-dev] Broken link to xmpp at Kamailio (OpenSER) Documentation Factory
Thank you for the right link.
I found it under http://www.kamailio.org/dokuwiki/doku.php. The broken link is in the tutorial section.
Is there a SIP/XMPP Gateway tutorial?
BTW, I'm interested in the upcoming adv training.
-Auro
From: Daniel-Constantin Mierla [mailto:miconda@gmail.com]<mailto:[mailto:miconda@gmail.com]>
Sent: Monday, June 25, 2012 1:41 AM
To: Development mailing list of the sip-router project
Cc: Auro Tripathy
Subject: Re: [sr-dev] Broken link to xmpp at Kamailio (OpenSER) Documentation Factory
Hello,
On 6/21/12 11:54 PM, Auro Tripathy wrote:
http://www.kamailio.org/docs/modules/devel/xmpp.html
where did you find the link? Now there are many folders holding modules, the right link is:
http://www.kamailio.org/docs/modules/devel/modules_k/xmpp.html
Cheers,
Daniel
--
Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, Seattle, USA, Sep 23-26, 2012 - http://asipto.com/u/katu
Kamailio Practical Workshop, Netherlands, Sep 10-12, 2012 - http://asipto.com/u/kpw
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
A new Flyspray task has been opened. Details are below.
User who did this - Bradley Watkins (Marquis42)
Attached to Project - sip-router
Summary - Incorrect error message in uac module
Task Type - Bug Report
Category - Modules kamailio
Status - Unconfirmed
Assigned To -
Operating System - All
Severity - Low
Priority - Normal
Reported Version - 3.3
Due in Version - Undecided
Due Date - Undecided
Details - In the uac module, the parameter from_restore_mode has been changed to just restore_mode. However, an error exists that says "[uac.c:292]: 'append_fromtag' RR param is not enabled - required by AUTO restore mode! Or you should set from_restore_mode param to 'none'". This can be confusing.
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=239
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
Module: sip-router
Branch: master
Commit: 8d649d042d43c4dc29b2cb747ba87c1f75590713
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=8d649d0…
Author: Anca Vamanu <anca.vamanu(a)1and1.ro>
Committer: Anca Vamanu <anca.vamanu(a)1and1.ro>
Date: Wed Jun 27 18:34:55 2012 +0300
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".
(cherry picked from commit 3abf967f61a1bd95c28d4e8a929a8bd5df00671d)
---
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 )
{
Module: sip-router
Branch: 3.3
Commit: 3abf967f61a1bd95c28d4e8a929a8bd5df00671d
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=3abf967…
Author: Anca Vamanu <anca.vamanu(a)1and1.ro>
Committer: Anca Vamanu <anca.vamanu(a)1and1.ro>
Date: Wed Jun 27 18:34:55 2012 +0300
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 )
{
Hello,
during the night of 26/27th of June, Central European Standard Time
(GMT+1, with daylight saving time on), the server hosting kamailio.org
and lists.sip-router.org will be down for approx 1 hour. This is a
planned maintenance work to upgrade the server to a new infrastructure.
Hopefully everything goes smooth and gets back online quickly, the work
should start about 2:00am on the 27th of June, but don't get nervous if
takes longer or happens at different time.
Among the most important affected services:
- the mailing lists (all mailed in this message)
- main website and kamailio's wiki systems
- download folders
- documentations (for modules and other html tutorials)
The sip-router.org server will NOT be affected, so next services will be
available:
- sip-router.org web site and its wiki
- GIT repository
- issue tracker system
If things are not going as expected, tomorrow we will post news about on
this server, at http://sip-router.org
This is a good opportunity to thank again to voztele.com for sponsoring
the server and taking care of the maintenance work.
Cheers,
Daniel
--
Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, Seattle, USA, Sep 23-26, 2012 - http://asipto.com/u/katu
Kamailio Practical Workshop, Netherlands, Sep 10-12, 2012 - http://asipto.com/u/kpw