Module: kamailio
Branch: master
Commit: 35fa264fe9a70627e9f17f75e0ce39ddbd3550ba
URL: https://github.com/kamailio/kamailio/commit/35fa264fe9a70627e9f17f75e0ce39d…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2016-02-07T19:54:47+01:00
auth_db: removed trailing spaces for sane git diff
---
Modified: modules/auth_db/auth_db_mod.c
Modified: modules/auth_db/authorize.c
---
Diff: https://github.com/kamailio/kamailio/commit/35fa264fe9a70627e9f17f75e0ce39d…
Patch: https://github.com/kamailio/kamailio/commit/35fa264fe9a70627e9f17f75e0ce39d…
---
diff --git a/modules/auth_db/auth_db_mod.c b/modules/auth_db/auth_db_mod.c
index abd9c29..3f22f4f 100644
--- a/modules/auth_db/auth_db_mod.c
+++ b/modules/auth_db/auth_db_mod.c
@@ -1,4 +1,4 @@
-/*
+/*
* Digest Authentication Module
*
* Copyright (C) 2001-2003 FhG Fokus
@@ -15,8 +15,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
@@ -134,7 +134,7 @@ static param_export_t params[] = {
* Module interface
*/
struct module_exports exports = {
- "auth_db",
+ "auth_db",
DEFAULT_DLFLAGS, /* dlopen flags */
cmds, /* Exported functions */
params, /* Exported parameters */
@@ -153,7 +153,7 @@ static int child_init(int rank)
{
if (rank==PROC_INIT || rank==PROC_MAIN || rank==PROC_TCP_MAIN)
return 0; /* do nothing for the main process */
-
+
auth_db_handle = auth_dbf.init(&db_url);
if (auth_db_handle == 0){
LM_ERR("unable to connect to the database\n");
@@ -220,7 +220,7 @@ static int w_is_subscriber(sip_msg_t *msg, char *_uri, char* _table,
{
str suri;
str stable;
- int iflags;
+ int iflags = 0;
int ret;
sip_uri_t puri;
@@ -356,7 +356,7 @@ int parse_aaa_pvs(char *definition, pv_elem_t **pv_def, int *cnt)
/* definition is between p and e */
/* search backwards because PV definition may contain '=' characters */
- for (sep = end; sep >= p && *sep != '='; sep--);
+ for (sep = end; sep >= p && *sep != '='; sep--);
if (sep > p) {
/* pv=column style */
/* set column name */
@@ -385,7 +385,7 @@ int parse_aaa_pvs(char *definition, pv_elem_t **pv_def, int *cnt)
goto parse_error;
}
pv.len = snprintf(pv.s, pve->text.len + 7, "$avp(%.*s)",
- pve->text.len, pve->text.s);
+ pve->text.len, pve->text.s);
}
/* create a pv spec */
diff --git a/modules/auth_db/authorize.c b/modules/auth_db/authorize.c
index 86e1cb7..c307326 100644
--- a/modules/auth_db/authorize.c
+++ b/modules/auth_db/authorize.c
@@ -15,8 +15,8 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
@@ -126,7 +126,7 @@ int fetch_credentials(sip_msg_t *msg, str *user, str* domain, str *table, int fl
}
static inline int get_ha1(struct username* _username, str* _domain,
- const str* _table, char* _ha1, db1_res_t** res)
+ const str* _table, char* _ha1, db1_res_t** res)
{
pv_elem_t *cred;
db_key_t keys[2];
@@ -496,10 +496,10 @@ int auth_check(struct sip_msg* _m, char* _realm, char* _table, char *_flags)
if(ret==AUTH_OK && hdr!=NULL && (iflags&AUTH_CHECK_ID_F)) {
srealm = ((auth_body_t*)(hdr->parsed))->digest.username.user;
-
+
if((furi=parse_from_uri(_m))==NULL)
return AUTH_ERROR;
-
+
if(_m->REQ_METHOD==METHOD_REGISTER || _m->REQ_METHOD==METHOD_PUBLISH) {
if((turi=parse_to_uri(_m))==NULL)
return AUTH_ERROR;
I noticed that active_watchers table now has a new flags field. The only
reference I found to it in README is this:
7.1. $subs(attr)
Access the attributes of handled subscription. It must be used after a
successful call of “handle_subscription()” or in the following events.
* tm:local-request - before notify is sent
* present:notify-reply - after notify is sent
The “attr” can be:
...
* flags
When I call handle_subscribe, how can I set the flags field?
-- Juha
Ps. There is a typo in above README text. The name of the function is
handle_subscribe.
Openend as a follow up of @camilleoudot comments (pasted next) to the pull request #454 by @armenb
"""
if the tcpops module is loaded but no tcp:closed route is defined, a debug log line will complain about it I think it would make sense to add a module parameter to globally enable or disable the event route lookup and execution
Besides, as many of the tcpops function can act on a per-socket basis, it would be nice to have this event route called or not called depending on the socket (eg using a tcp_connection flag and defining a new tcpops function to set/reset this flag)
What do you think?
"""
---
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/461
A few comments:
- Add a note about the need to load TLS module first (like I just did in http_client docs)
- modparam examples still have “async_http” in the docs
- http_set_ssl_cert should have “tls” instead of “ssl”. SSL is bad.
- The name of the statistics/counters is not complete in the doc file. Please check
- I still think we need to discuss the way you have to run functions to set parameters for a coming function call.
That’s new to Kamailio, a big change in how we do things. Usually that is handled by AVPs or XAVPs.
We should not add new ways of doing things without discussion - it’s about architecture and will affect
all users and how we train people in Kamailio. Personally I don’t like running a “function” that sets options
for the next function call to a particular function… What if that function doesn’t happen, will all these values
be reset for the next message processed in that process?
We’re moving forward!
/O
Hi,
after receiving a register the kamailio process ends up in a deadlock when calling the function:
```
res = ulget_urecord_by_ruid(domain, ulget_aorhash(c->aor), &(c->ruid),
&record, &_c);
(usrloc_cbc:264)
```
System setup:
Kamailio version 426 together with postgres
pua_reginfo module enabled (modparam publish_reginfo needs to be set to "1")
To reproduce it is enough to send a single registration
According the change notes the function to get the record was changed from "ulget_urecord" to "ulget_urecord_by_ruid" in release 426
http://wwwkamailioorg/pub/kamailio/426/ChangeLog
> commit 547f1489cb51a3c72dba72adaa1f6df5429f425e
> Author: Victor Seva <linuxmaniac@torreviejawirelessorg>
> Date: Wed Jul 15 16:00:03 2015 +0200
>
> pua_reginfo: use ruid to fix comparation of contact
>
> (ptr == c) is always false Using ruid instead
>
> (cherry picked from commit 7d31d78e3ac861cddfcb70c9940242ec7f3f0dbc)
>
> commit eb97d380a2fca3b9ce30596aad9493bc11cd5d8d
> Author: Victor Seva <linuxmaniac@torreviejawirelessorg>
> Date: Thu May 28 18:26:08 2015 +0200
>
> pua_reginfo: use ulget_urecord_by_ruid instead of ulget_urecord
>
> (cherry picked from commit 63bd356cc3c7aa64d64361283f630f88b8db88af)
>
A similair change was done in 43x and reverted short time later:
http://wwwkamailioorg/pub/kamailio/434/ChangeLog
> commit cb644d50f76c80f0f24b34e5adf8723d89aab636
> Author: Victor Seva <linuxmaniac@torreviejawirelessorg>
> Date: Thu Aug 6 15:22:34 2015 +0200
>
> Revert "pua_reginfo: use ulget_urecord_by_ruid instead of ulget_urecord"
>
> This reverts commit 9a6d8d2bffe13b442ed5e880fb0dd2c6572c29e2
>
Just by the change notes I cannot find out, why the commit was reverted in 432
As a workaround, we changed the used function back to "ulget_urecord" and have now running tests to verify the functionality At least the deadlock is fixed with this change
---
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/499