浏览代码

Merge remote-tracking branch 'upstream/master' into getifaddrs

Christian Kuehnke 9 年之前
父节点
当前提交
38d9cfa1fe

+ 1 - 1
Makefile.defs

@@ -97,7 +97,7 @@ INSTALL_FLAVOUR=$(FLAVOUR)
 VERSION = 4
 PATCHLEVEL = 4
 SUBLEVEL =  0
-EXTRAVERSION = -dev7
+EXTRAVERSION = -dev8
 
 # memory manager switcher
 # 0 - f_malloc (fast malloc)

+ 43 - 10
modules/cfgt/README

@@ -10,7 +10,7 @@ Victor Seva
 
    <[email protected]>
 
-   Copyright © 2015 Victor Seva (sipwise.com)
+   Copyright © 2015 Victor Seva (sipwise.com)
      __________________________________________________________________
 
    Table of Contents
@@ -29,6 +29,8 @@ Victor Seva
               3.2. mask (int)
               3.3. callid_prefix (string)
 
+        4. Usage
+
    List of Examples
 
    1.1. Set cfgtrace parameter
@@ -51,14 +53,16 @@ Chapter 1. Admin Guide
         3.2. mask (int)
         3.3. callid_prefix (string)
 
+   4. Usage
+
 1. Overview
 
    This module provides a report of the way Kamailio SIP Server Platform
    configuration has been executed as part of a unit test for different
    SIP scenarios.
 
-   In order to identify defferent scenarios a prefix string should be used
-   at Call-ID header.
+   In order to identify different scenarios a prefix string should be used
+   inside the Call-ID header.
 
 2. Dependencies
 
@@ -84,10 +88,10 @@ Chapter 1. Admin Guide
 
 3.1. basedir (string)
 
-   Control where the config reports should be stored. The dir must exists
-   and Kamailio SIP Server Platform must have perms to write on it.
+   Control where the config reports should be stored. The dir must exist
+   and Kamailio SIP Server Platform must have permissions to write on it.
 
-   Default value is "/tmp".
+   Default value is “/tmp�.
 
    Example 1.1. Set cfgtrace parameter
 ...
@@ -104,7 +108,7 @@ modparam("cfgt", "basedir", "/var/run/kamailio/cfgtest")
      * 16 - dump DP_OTHER vars
      * 32 - dump ALL vars
 
-   Default value is "32" (ALL).
+   Default value is “32� (ALL).
 
    Example 1.2. Set mask parameter
 ...
@@ -114,13 +118,42 @@ modparam("cfgt", "mask", 12)
 
 3.3. callid_prefix (string)
 
-   Prefix used to indentify test scenario messages. Last char of the
-   string will be used as delimiter.
+   Prefix used to identify test scenario messages. Last char of the string
+   will be used as delimiter for the scenario ID. With parameter set to
+   “NGCP%� and Call-ID “NGCP%123%456� the scenario identified will be
+   “123�.
 
-   Default value is "NGCP%" (using "%" as delimiter).
+   Default value is “NGCP%� (using “%� as delimiter).
 
    Example 1.3. Set callid_prefix parameter
 ...
 # using '%' as delimiter
 modparam("cfgt", "callid_prefix", "TEST-ID%")
 ...
+
+4. Usage
+
+   This module is used by the debugger module, so it must be loaded first.
+   To enable the generation of the reports, the debugger module must be
+   configured by setting the cfgtest parameter to "1".
+
+   Example of configuration:
+...
+#!ifdef WITH_DEBUG
+loadmodule "cfgt.so"
+loadmodule "debugger.so"
+#!endif
+...
+#!ifdef WITH_DEBUG
+# ----- cfgt params -----
+modparam("cfgt", "basedir", "/tmp/kamailio/cfgtest")
+modparam("cfgt", "callid_prefix", "TRACE-ID%")
+modparam("cfgt", "mask", 32)
+
+# ----- debugger params -----
+modparam("debugger", "cfgtrace", 1)
+modparam("debugger", "log_level_name", "exec")
+
+modparam("debugger", "cfgtest", 1)
+#!endif
+...

+ 35 - 10
modules/cfgt/doc/cfgt_admin.xml

@@ -22,8 +22,8 @@
 		SIP scenarios.
 	</para>
 	<para>
-		In order to identify defferent scenarios a prefix string should be
-		used at Call-ID header.
+		In order to identify different scenarios a prefix string should be
+		used inside the Call-ID header.
 	</para>
 	</section>
 	<section>
@@ -62,7 +62,7 @@
 		<title><varname>basedir</varname> (string)</title>
 		<para>
 			Control where the config reports should be stored. The dir must
-			exists and &kamailioname; must have perms to write on it.
+			exist and &kamailioname; must have permissions to write on it.
 		</para>
 		<para>
 		<emphasis>
@@ -125,8 +125,10 @@ modparam("cfgt", "mask", 12)
 	<section id="cfgt.p.callid_prefix">
 		<title><varname>callid_prefix</varname> (string)</title>
 		<para>
-			Prefix used to indentify test scenario messages. Last char of the
-			string will be used as delimiter.
+			Prefix used to identify test scenario messages. Last char of the
+			string will be used as delimiter for the scenario ID. With parameter
+			set to <quote>NGCP%</quote> and Call-ID <quote>NGCP%123%456</quote> 
+			the scenario identified will be <quote>123</quote>.
 		</para>
 		<para>
 		<emphasis>
@@ -146,13 +148,36 @@ modparam("cfgt", "callid_prefix", "TEST-ID%")
 	</section>
 
 	</section>
-
-<!--
 	<section>
 		<title>Usage</title>
 		<para>
-			TODO: add some more info of how this is been used
+		This module is used by the <emphasis>debugger</emphasis> module, so it must be loaded
+		first. To enable the generation of the reports, the <emphasis>debugger</emphasis> module
+		must be configured by setting the <emphasis>cfgtest</emphasis> parameter to "1".
 		</para>
-	</section>
--->
+		<para>
+		Example of configuration:
+		</para>
+<programlisting  format="linespecific">
+...
+#!ifdef WITH_DEBUG
+loadmodule "cfgt.so"
+loadmodule "debugger.so"
+#!endif
+...
+#!ifdef WITH_DEBUG
+# ----- cfgt params -----
+modparam("cfgt", "basedir", "/tmp/kamailio/cfgtest")
+modparam("cfgt", "callid_prefix", "TRACE-ID%")
+modparam("cfgt", "mask", 32)
+
+# ----- debugger params -----
+modparam("debugger", "cfgtrace", 1)
+modparam("debugger", "log_level_name", "exec")
+
+modparam("debugger", "cfgtest", 1)
+#!endif
+...
+</programlisting>
+    </section>
 </chapter>

+ 2 - 2
modules/db_text/dbt_lib.c

@@ -443,13 +443,13 @@ int dbt_is_neq_type(db_type_t _t0, db_type_t _t1)
 		case DB1_DOUBLE:
 			break;
 		case DB1_STRING:
-			if(_t0==DB1_STR)
+			if(_t0==DB1_STR || _t0==DB1_BLOB)
 				return 0;
 		case DB1_STR:
 			if(_t0==DB1_STRING || _t0==DB1_BLOB)
 				return 0;
 		case DB1_BLOB:
-			if(_t0==DB1_STR)
+			if(_t0==DB1_STR || _t0==DB1_STRING)
 				return 0;
 		case DB1_BITMAP:
 			if (_t0==DB1_INT)

+ 1 - 0
modules/dispatcher/README

@@ -1373,6 +1373,7 @@ modparam("dispatcher", "flags", 2)
 modparam("dispatcher", "dst_avp", "$avp(AVP_DST)")
 modparam("dispatcher", "grp_avp", "$avp(AVP_GRP)")
 modparam("dispatcher", "cnt_avp", "$avp(AVP_CNT)")
+modparam("dispatcher", "sock_avp", "$avp(AVP_SOCK)")
 
 ####### Routing Logic ########
 

+ 1 - 0
modules/dispatcher/doc/dispatcher.cfg

@@ -115,6 +115,7 @@ modparam("dispatcher", "flags", 2)
 modparam("dispatcher", "dst_avp", "$avp(AVP_DST)")
 modparam("dispatcher", "grp_avp", "$avp(AVP_GRP)")
 modparam("dispatcher", "cnt_avp", "$avp(AVP_CNT)")
+modparam("dispatcher", "sock_avp", "$avp(AVP_SOCK)")
 
 ####### Routing Logic ########
 

+ 7 - 4
modules/dmq_usrloc/usrloc_sync.c

@@ -56,10 +56,13 @@ static int add_contact(str aor, ucontact_info_t* ci)
 	str contact;
 	int res;
 
-        if (dmq_ul.get_udomain("location", &_d) < 0) {
-                LM_ERR("Failed to get domain\n");
-                return -1;
-        }
+	if (dmq_ul.get_udomain("location", &_d) < 0) {
+		LM_ERR("Failed to get domain\n");
+		return -1;
+	}
+
+	dmq_ul.lock_udomain(_d, &aor);
+
 	res = dmq_ul.get_urecord(_d, &aor, &r);
 	if (res < 0) {
 		LM_ERR("failed to retrieve record from usrloc\n");

+ 6 - 1
modules/presence/notify.c

@@ -1470,6 +1470,7 @@ int send_notify_request(subs_t* subs, subs_t * watcher_subs,
 	c_back_param *cb_param= NULL;
 	str* final_body= NULL;
 	uac_req_t uac_r;
+	str* aux_body = NULL;
 	
 	LM_DBG("dialog info:\n");
 	printf_subs(subs);
@@ -1532,7 +1533,11 @@ int send_notify_request(subs_t* subs, subs_t * watcher_subs,
 					/* call aux_body_processing if exists */
 					if(subs->event->aux_body_processing)
 					{
-						subs->event->aux_body_processing(subs, notify_body);
+						aux_body = subs->event->aux_body_processing(subs, notify_body);
+						if(aux_body) {
+							free_notify_body(notify_body, subs->event);
+							notify_body = aux_body;
+						}
 					}
 
 					/* apply authorization rules if exists */

+ 1 - 0
modules/presence_dialoginfo/add_events.c

@@ -57,6 +57,7 @@ int dlginfo_add_events(void)
 
 	/* modify XML body for each watcher to set the correct "version" */
     event.aux_body_processing = dlginfo_body_setversion;
+    event.aux_free_body = free_xml_body;
 
 	
     if (pres_add_event(&event) < 0) {

+ 36 - 2
modules/presence_dialoginfo/notify_body.c

@@ -538,6 +538,7 @@ str *dlginfo_body_setversion(subs_t *subs, str *body) {
 	char *version_start=0;
 	char version[MAX_INT_LEN + 2]; /* +2 becasue of trailing " and \0 */
 	int version_len;
+	str* aux_body = NULL;
 
 	if (!body) {
 		return NULL;
@@ -564,9 +565,29 @@ str *dlginfo_body_setversion(subs_t *subs, str *body) {
 	version_len = snprintf(version, MAX_INT_LEN + 2,"%d\"", subs->version);
 	if (version_len >= MAX_INT_LEN + 2) {
 		LM_ERR("failed to convert 'version' to string\n");
-		memcpy(version_start, "00000000000\"", 12);
 		return NULL;
 	}
+
+	aux_body= (str*)pkg_malloc(sizeof(str));
+	if(aux_body== NULL)
+	{
+		LM_ERR("error allocating memory for aux body str\n");
+		return NULL;
+	}
+	memset(aux_body, 0, sizeof(str));
+	aux_body->s= (char*)pkg_malloc( body->len * sizeof(char));
+	if(aux_body->s== NULL)
+	{
+		pkg_free(aux_body);
+		LM_ERR("error allocating memory for aux body buffer\n");
+		return NULL;
+	}
+	memcpy(aux_body->s, body->s, body->len);
+	aux_body->len= body->len;
+
+	/* again but on the copied str, no checks needed */
+	version_start = strstr(aux_body->s + 34, "version=");
+	version_start += 9;
 	/* Replace the placeholder 00000000000 with the version.
 	 * Put the padding behind the ""
 	 */
@@ -574,5 +595,18 @@ str *dlginfo_body_setversion(subs_t *subs, str *body) {
 	memcpy(version_start, version, version_len);
 	memset(version_start + version_len, ' ', 12 - version_len);
 
-	return NULL;
+	xmlDocPtr doc = xmlReadMemory(aux_body->s, aux_body->len, "noname.xml", NULL, 0);
+        if (doc == NULL) {
+		LM_ERR("error allocation xmldoc\n");
+		pkg_free(aux_body->s);
+		pkg_free(aux_body);
+		return NULL;
+	}
+	pkg_free(aux_body->s);
+        xmlDocDumpFormatMemory(doc,(xmlChar**)(void*)&aux_body->s, &aux_body->len, 1);
+
+        xmlCleanupParser();
+        xmlMemoryDump();
+
+	return aux_body;
 }

+ 1 - 1
modules/smsops/doc/smsops_admin.xml

@@ -77,7 +77,7 @@ if (isRPDATA())
 </programlisting>
 		</example>
 		</section>
-		<section id="smsops.f.isRPDATA">
+		<section id="smsops.f.smsdump">
 		<title><function moreinfo="none">smsdump()</function></title>
 		<para>Dumps the content of a 3GPP-SMS message to the Debug-Log.</para>
 		<para>Please make sure, to have debug-Log enabled. Otherwise, you won't see anything.</para>

+ 6 - 0
pkg/kamailio/deb/debian/changelog

@@ -1,3 +1,9 @@
+kamailio (4.4.0~dev8) unstable; urgency=medium
+
+  * update version to 4.4.0~dev8
+
+ -- Victor Seva <[email protected]>  Fri, 18 Dec 2015 11:42:59 +0100
+
 kamailio (4.4.0~dev6) unstable; urgency=medium
 
   * update version to 4.4.0~dev6

+ 6 - 0
pkg/kamailio/deb/jessie/changelog

@@ -1,3 +1,9 @@
+kamailio (4.4.0~dev8) unstable; urgency=medium
+
+  * update version to 4.4.0~dev8
+
+ -- Victor Seva <[email protected]>  Fri, 18 Dec 2015 11:42:59 +0100
+
 kamailio (4.4.0~dev6) unstable; urgency=medium
 
   * update version to 4.4.0~dev6

+ 1 - 1
pkg/kamailio/deb/jessie/kamailio.service

@@ -1,6 +1,6 @@
 [Unit]
 Description=Kamailio (OpenSER) - the Open Source SIP Server
-After=syslog.target network.target
+After=network.target
 
 [Service]
 Type=forking

+ 6 - 0
pkg/kamailio/deb/precise/changelog

@@ -1,3 +1,9 @@
+kamailio (4.4.0~dev8) unstable; urgency=medium
+
+  * update version to 4.4.0~dev8
+
+ -- Victor Seva <[email protected]>  Fri, 18 Dec 2015 11:42:59 +0100
+
 kamailio (4.4.0~dev6) unstable; urgency=medium
 
   * update version to 4.4.0~dev6

+ 6 - 0
pkg/kamailio/deb/sid/changelog

@@ -1,3 +1,9 @@
+kamailio (4.4.0~dev8) unstable; urgency=medium
+
+  * update version to 4.4.0~dev8
+
+ -- Victor Seva <[email protected]>  Fri, 18 Dec 2015 11:42:59 +0100
+
 kamailio (4.4.0~dev6) unstable; urgency=medium
 
   * update version to 4.4.0~dev6

+ 1 - 1
pkg/kamailio/deb/sid/kamailio.service

@@ -1,6 +1,6 @@
 [Unit]
 Description=Kamailio (OpenSER) - the Open Source SIP Server
-After=syslog.target network.target
+After=network.target
 
 [Service]
 Type=forking

+ 6 - 0
pkg/kamailio/deb/squeeze/changelog

@@ -1,3 +1,9 @@
+kamailio (4.4.0~dev8) unstable; urgency=medium
+
+  * update version to 4.4.0~dev8
+
+ -- Victor Seva <[email protected]>  Fri, 18 Dec 2015 11:42:59 +0100
+
 kamailio (4.4.0~dev6) unstable; urgency=medium
 
   * update version to 4.4.0~dev6

+ 6 - 0
pkg/kamailio/deb/stretch/changelog

@@ -1,3 +1,9 @@
+kamailio (4.4.0~dev8) unstable; urgency=medium
+
+  * update version to 4.4.0~dev8
+
+ -- Victor Seva <[email protected]>  Fri, 18 Dec 2015 11:42:59 +0100
+
 kamailio (4.4.0~dev6) unstable; urgency=medium
 
   * update version to 4.4.0~dev6

+ 1 - 1
pkg/kamailio/deb/stretch/kamailio.service

@@ -1,6 +1,6 @@
 [Unit]
 Description=Kamailio (OpenSER) - the Open Source SIP Server
-After=syslog.target network.target
+After=network.target
 
 [Service]
 Type=forking

+ 6 - 0
pkg/kamailio/deb/trusty/changelog

@@ -1,3 +1,9 @@
+kamailio (4.4.0~dev8) unstable; urgency=medium
+
+  * update version to 4.4.0~dev8
+
+ -- Victor Seva <[email protected]>  Fri, 18 Dec 2015 11:42:59 +0100
+
 kamailio (4.4.0~dev6) unstable; urgency=medium
 
   * update version to 4.4.0~dev6

+ 6 - 0
pkg/kamailio/deb/wheezy/changelog

@@ -1,3 +1,9 @@
+kamailio (4.4.0~dev8) unstable; urgency=medium
+
+  * update version to 4.4.0~dev8
+
+ -- Victor Seva <[email protected]>  Fri, 18 Dec 2015 11:42:59 +0100
+
 kamailio (4.4.0~dev6) unstable; urgency=medium
 
   * update version to 4.4.0~dev6