[sr-dev] git:master:9d5c7509: ims_isc: Allow Regex in RURI-Field

2017-03-22 Thread Carsten Bock
Module: kamailio
Branch: master
Commit: 9d5c7509cb5aadea98bfcabbd70f17668fc34a58
URL: 
https://github.com/kamailio/kamailio/commit/9d5c7509cb5aadea98bfcabbd70f17668fc34a58

Author: Carsten Bock 
Committer: Carsten Bock 
Date: 2017-03-22T22:54:30+01:00

ims_isc: Allow Regex in RURI-Field

---

Modified: src/modules/ims_isc/checker.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/9d5c7509cb5aadea98bfcabbd70f17668fc34a58.diff
Patch: 
https://github.com/kamailio/kamailio/commit/9d5c7509cb5aadea98bfcabbd70f17668fc34a58.patch

---

diff --git a/src/modules/ims_isc/checker.c b/src/modules/ims_isc/checker.c
index dd927c6..4461182 100644
--- a/src/modules/ims_isc/checker.c
+++ b/src/modules/ims_isc/checker.c
@@ -182,6 +182,40 @@ static int isc_check_session_desc(ims_spt *spt, struct 
sip_msg *msg) {
 }
 
 /**
+ * Check if a Service Point Trigger for RURI matches the RURI of a message
+ * @param spt - the service point trigger
+ * @param msg - the message
+ * @returns - 1 on success, 0 on failure
+ */
+static int isc_check_ruri(ims_spt *spt, struct sip_msg *msg) {
+   char buf[256];
+   regex_t comp;
+
+   if (spt->request_uri.len >= sizeof(buf)) {
+   LM_ERR("RURI \"%.*s\" is to long to be processed (max %d bytes)\n", 
spt->request_uri.len, spt->request_uri.s, (int) (sizeof(buf) - 1));
+   return FALSE;
+   }
+
+   /* compile the regex for content */
+   memcpy(buf, spt->request_uri.s, spt->request_uri.len);
+   buf[spt->request_uri.len] = 0;
+   if(regcomp(&(comp), buf, REG_ICASE | REG_EXTENDED) != 0) {
+   LM_ERR("Error compiling the following regexp for RURI content: 
%.*s\n", spt->request_uri.len, spt->request_uri.s);
+   return FALSE;
+   }
+
+   if (regexec(&(comp), buf, 0, NULL, 0) == 0) //regex match
+   {
+   regfree(&(comp));
+   return TRUE;
+   }
+   regfree(&(comp));
+   return FALSE;
+}
+
+
+
+/**
  * Check if a Service Point Trigger matches a message 
  * @param spt - the service point trigger
  * @param msg - the message
@@ -198,8 +232,7 @@ static int isc_check_spt(ims_spt *spt, struct sip_msg *msg, 
char direction,
spt->type, spt->request_uri.len, 
spt->request_uri.s);
LM_DBG("ifc_check_spt:   Found Request URI %.*s \n",
msg->first_line.u.request.uri.len, 
msg->first_line.u.request.uri.s);
-   r = (strncasecmp(spt->request_uri.s, 
msg->first_line.u.request.uri.s,
-   spt->request_uri.len) == 0);
+   r = isc_check_ruri(spt, msg);
break;
case IFC_METHOD:
LM_DBG("ifc_check_spt: SPT type %d -> Method == 
%.*s ?\n",


___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] db_postgress: insert_update() with DO NOTHING (#1039)

2017-03-22 Thread Julien Chavanton
I am working on OPTION2, where not modification is required outside of 
db_postgres, if you think this is not an option or not valuable enough let me 
know ?

If you do not want to merge DO NOTHING because it can be confusing / misleading 
then we can clause this PR. 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1039#issuecomment-288493936___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] git:master:3525d6ec: ims_registrar_pcscf: Fix check for following Service-Routes (Route Header present, but only pointing locally)

2017-03-22 Thread Carsten Bock
Module: kamailio
Branch: master
Commit: 3525d6ec7f9fc719651a97e8a9779f13eb14d0fd
URL: 
https://github.com/kamailio/kamailio/commit/3525d6ec7f9fc719651a97e8a9779f13eb14d0fd

Author: Carsten Bock 
Committer: Carsten Bock 
Date: 2017-03-22T13:57:14+01:00

ims_registrar_pcscf: Fix check for following Service-Routes (Route Header 
present, but only pointing locally)

---

Modified: src/modules/ims_registrar_pcscf/service_routes.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/3525d6ec7f9fc719651a97e8a9779f13eb14d0fd.diff
Patch: 
https://github.com/kamailio/kamailio/commit/3525d6ec7f9fc719651a97e8a9779f13eb14d0fd.patch

---

diff --git a/src/modules/ims_registrar_pcscf/service_routes.c 
b/src/modules/ims_registrar_pcscf/service_routes.c
index dfb1627..9c5eba8 100644
--- a/src/modules/ims_registrar_pcscf/service_routes.c
+++ b/src/modules/ims_registrar_pcscf/service_routes.c
@@ -413,6 +413,10 @@ int check_service_routes(struct sip_msg* _m, udomain_t* 
_d) {
}

LM_DBG("num_routes is %d\n", num_routes);
+   if (num_routes == 0) {
+   LM_DBG("Request doesn't have any route headers 
(except those pointing here), to check service-route...ignoring\n");
 
+   goto error;
+   }
for (i=0; ihttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] Problem with topos together with track_cseq_updates (#1038)

2017-03-22 Thread lamSteven
version: kamailio 4.4.5 (x86_64/linux) 
>From the "http://deb.kamailio.org/kamailio44 jessie  main" repository.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1038#issuecomment-288368710___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] Problem with topos together with track_cseq_updates (#1038)

2017-03-22 Thread Daniel-Constantin Mierla
What version of kamailio are you using (get the output of `kamailio -v`)?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1038#issuecomment-288368158___
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev