diff --git a/.gitignore b/.gitignore index 31919ed..2d74e4e 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ opensips-1.6.3-tls_src.tar.gz /opensips-1.10.5_src.tar.gz /opensips-1.11.6.tar.gz /opensips-1.11.8.tar.gz +/opensips-1.11.9.tar.gz diff --git a/opensips-0018-Fix-potential-100-Trying-duplicates.patch b/opensips-0018-Fix-potential-100-Trying-duplicates.patch deleted file mode 100644 index 856525f..0000000 --- a/opensips-0018-Fix-potential-100-Trying-duplicates.patch +++ /dev/null @@ -1,360 +0,0 @@ -From: Bogdan-Andrei Iancu -Date: Mon, 23 May 2016 15:57:23 +0300 -Subject: [PATCH] Fix potential 100 Trying duplicates. - -Added the "auto_100trying" module parameter to allow the script writter to take control (from script level) over when the 100 Trying reply is to be sent back. -By default, the reply is automatically generated when the INVITE transaction is created (see 908ce1be3766d9c27bfb576e5e0cc3b4eecbee31) -Fixes #833 - -(cherry picked from commit b023c93a8c476e70b1550da4f46c91d6e2679442) -(cherry picked from commit 71b527446b00fc4e3886d8d02c7d03d313dbee05) -(cherry picked from commit 248c836280bca280d46a5468acf89a590fb58d29) - -diff --git a/modules/tm/README b/modules/tm/README -index 55172ee..b2ebac9 100644 ---- a/modules/tm/README -+++ b/modules/tm/README -@@ -60,6 +60,7 @@ Ovidiu Sas - 1.3.16. enable_stats (integer) - 1.3.17. minor_branch_flag (string/integer) - 1.3.18. own_timer_proc (integer) -+ 1.3.19. auto_100trying (integer) - - 1.4. Exported Functions - -@@ -145,24 +146,25 @@ Ovidiu Sas - 1.16. Set enable_stats parameter - 1.17. Set minor_branch_flag parameter - 1.18. Set own_timer_proc parameter -- 1.19. t_relay usage -+ 1.19. Set auto_100trying parameter - 1.20. t_relay usage -- 1.21. t_reply usage -- 1.22. t_reply_with_body usage -- 1.23. t_newtran usage -- 1.24. t_check_trans usage -- 1.25. t_check_status usage -- 1.26. t_local_replied usage -- 1.27. t_was_cancelled usage -- 1.28. t_cancel_branch usage -- 1.29. t_new_request usage -- 1.30. t_on_failure usage -- 1.31. t_on_reply usage -- 1.32. t_on_branch usage -- 1.33. t_add_hdrs usage -- 1.34. t_replicate usage -- 1.35. t_write_req/unix usage -- 1.36. t_flush_flags usage -+ 1.21. t_relay usage -+ 1.22. t_reply usage -+ 1.23. t_reply_with_body usage -+ 1.24. t_newtran usage -+ 1.25. t_check_trans usage -+ 1.26. t_check_status usage -+ 1.27. t_local_replied usage -+ 1.28. t_was_cancelled usage -+ 1.29. t_cancel_branch usage -+ 1.30. t_new_request usage -+ 1.31. t_on_failure usage -+ 1.32. t_on_reply usage -+ 1.33. t_on_branch usage -+ 1.34. t_add_hdrs usage -+ 1.35. t_replicate usage -+ 1.36. t_write_req/unix usage -+ 1.37. t_flush_flags usage - - Chapter 1. Admin Guide - -@@ -609,6 +611,23 @@ modparam("tm", "minor_branch_flag", "MINOR_BFLAG") - modparam("tm", "own_timer_proc", 2) - ... - -+1.3.19. auto_100trying (integer) -+ -+ This parameter controls if the TM module should automatically -+ generate an 100 Trying stateful reply when an INVITE -+ transaction is created. -+ -+ You may want to disable this behavior if you want to control -+ from script level when the 100 Trying is to be sent out. -+ -+ Default value is 1 (enabled). -+ -+ Example 1.19. Set auto_100trying parameter -+... -+# Disable automatic 100 Trying -+modparam("tm", "auto_100trying", 0) -+... -+ - 1.4. Exported Functions - - 1.4.1. t_relay([flags]) -@@ -662,7 +681,7 @@ modparam("tm", "own_timer_proc", 2) - - This function can be used from REQUEST_ROUTE, FAILURE_ROUTE. - -- Example 1.19. t_relay usage -+ Example 1.20. t_relay usage - ... - if (!t_relay()) { - sl_reply_error(); -@@ -684,7 +703,7 @@ if (!t_relay()) { - - This functions can be used from REQUEST_ROUTE, FAILURE_ROUTE. - -- Example 1.20. t_relay usage -+ Example 1.21. t_relay usage - ... - t_relay("tcp:192.168.1.10:5060"); - t_relay("mydomain.com:5070","0x1"); -@@ -704,7 +723,7 @@ t_relay("udp:mydomain.com"); - - This function can be used from REQUEST_ROUTE, FAILURE_ROUTE. - -- Example 1.21. t_reply usage -+ Example 1.22. t_reply usage - ... - t_reply("404", "Use $rU not found"); - ... -@@ -723,7 +742,7 @@ t_reply("404", "Use $rU not found"); - - This function can be used from REQUEST_ROUTE, FAILURE_ROUTE. - -- Example 1.22. t_reply_with_body usage -+ Example 1.23. t_reply_with_body usage - ... - if(is_method("INVITE")) - { -@@ -747,7 +766,7 @@ Warning - - This function can be used from REQUEST_ROUTE. - -- Example 1.23. t_newtran usage -+ Example 1.24. t_newtran usage - ... - if (t_newtran()) { - log("UAS logic"); -@@ -779,7 +798,7 @@ if (t_newtran()) { - - This function can be used from REQUEST_ROUTE and BRANCH_ROUTE. - -- Example 1.24. t_check_trans usage -+ Example 1.25. t_check_trans usage - ... - if ( is_method("CANCEL") ) { - if ( t_check_trans() ) -@@ -800,7 +819,7 @@ if ( is_method("CANCEL") ) { - This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE, - FAILURE_ROUTE and BRANCH_ROUTE . - -- Example 1.25. t_check_status usage -+ Example 1.26. t_check_status usage - ... - if (t_check_status("(487)|(408)")) { - log("487 or 408 negative reply\n"); -@@ -817,7 +836,7 @@ if (t_check_status("(487)|(408)")) { - This function can be used from REQUEST_ROUTE, BRANCH_ROUTE, - FAILURE_ROUTE and ONREPLY_ROUTE. - -- Example 1.26. t_local_replied usage -+ Example 1.27. t_local_replied usage - ... - if (t_local_replied("all")) { - log ("no reply received\n"); -@@ -831,7 +850,7 @@ if (t_local_replied("all")) { - - This function can be used from ONREPLY_ROUTE, FAILURE_ROUTE. - -- Example 1.27. t_was_cancelled usage -+ Example 1.28. t_was_cancelled usage - ... - if (t_was_cancelled()) { - log("transaction was cancelled by UAC\n"); -@@ -853,7 +872,7 @@ if (t_was_cancelled()) { - - This function can be used from ONREPLY_ROUTE. - -- Example 1.28. t_cancel_branch usage -+ Example 1.29. t_cancel_branch usage - onreply_route[3] { - ... - if (t_check_status("183")) { -@@ -882,7 +901,7 @@ onreply_route[3] { - transaction as an AVP with name "uac_ctx" (it may be - visible in local route) - -- Example 1.29. t_new_request usage -+ Example 1.30. t_new_request usage - ... - # send a MESSAGE request - t_new_request("MESSAGE","sip:alice@192.168.2.2","BOB sip:userB@m -@@ -917,7 +936,7 @@ ydomain.net","ALICE sip:userA@mydomain.net","text/plain Hello Alice!")) - This function can be used from REQUEST_ROUTE, BRANCH_ROUTE, - ONREPLY_ROUTE and FAILURE_ROUTE. - -- Example 1.30. t_on_failure usage -+ Example 1.31. t_on_failure usage - ... - route { - t_on_failure("1"); -@@ -966,7 +985,7 @@ failure_route[1] { - This function can be used from REQUEST_ROUTE, BRANCH_ROUTE, - ONREPLY_ROUTE and FAILURE_ROUTE. - -- Example 1.31. t_on_reply usage -+ Example 1.32. t_on_reply usage - ... - route { - seturi("sip:bob@opensips.org"); # first branch -@@ -1023,7 +1042,7 @@ onreply_route[global] { - This function can be used from REQUEST_ROUTE, BRANCH_ROUTE, - ONREPLY_ROUTE and FAILURE_ROUTE. - -- Example 1.32. t_on_branch usage -+ Example 1.33. t_on_branch usage - ... - route { - t_on_branch("1"); -@@ -1047,7 +1066,7 @@ branch_route[1] { - headers will be appended to all requests related to the - transaction (outgoing branches, local ACKS, CANCELs). - -- Example 1.33. t_add_hdrs usage -+ Example 1.34. t_add_hdrs usage - ... - t_add_hdrs("X-origin: 1.1.1.1\r\n"); - ... -@@ -1069,7 +1088,7 @@ t_add_hdrs("X-origin: 1.1.1.1\r\n"); - - This functions can be used from REQUEST_ROUTE. - -- Example 1.34. t_replicate usage -+ Example 1.35. t_replicate usage - ... - t_replicate("sip:1.2.3.4:5060"); - t_replicate("sip:1.2.3.4:5060;transport=tcp"); -@@ -1085,7 +1104,7 @@ t_replicate("sip:1.2.3.4","0x4"); - This functions can be used from REQUEST_ROUTE, FAILURE_ROUTE - and BRANCH_ROUTE. - -- Example 1.35. t_write_req/unix usage -+ Example 1.36. t_write_req/unix usage - ... - modparam("tm","tw_append","append1:Email=$avp(email);UA=$ua") - modparam("tm","tw_append","append2:body=$rb") -@@ -1104,7 +1123,7 @@ t_write_unix("logger/append2","/var/run/logger.sock"); - - This function can be used from REQUEST_ROUTE and BRANCH_ROUTE . - -- Example 1.36. t_flush_flags usage -+ Example 1.37. t_flush_flags usage - ... - t_flush_flags(); - ... -@@ -1279,14 +1298,14 @@ Chapter 3. Frequently Asked Questions - - 3.1. - -- What happened with old cancel_call() function -+ What happened with old cancel_call() function - -- The function was replace (as functionality) by -- cancel_branch("a") - cancel all braches. -+ The function was replace (as functionality) by -+ cancel_branch("a") - cancel all braches. - - 3.2. - -- How can I report a bug? -+ How can I report a bug? - -- Please follow the guidelines provided at: -- https://github.com/OpenSIPS/opensips/issues. -+ Please follow the guidelines provided at: -+ https://github.com/OpenSIPS/opensips/issues. -diff --git a/modules/tm/doc/tm_admin.xml b/modules/tm/doc/tm_admin.xml -index 3d228db..8b5fa0d 100644 ---- a/modules/tm/doc/tm_admin.xml -+++ b/modules/tm/doc/tm_admin.xml -@@ -689,6 +689,33 @@ modparam("tm", "own_timer_proc", 2) - - - -+
-+ <varname>auto_100trying</varname> (integer) -+ -+ This parameter controls if the TM module should automatically -+ generate an 100 Trying stateful reply when an INVITE transaction -+ is created. -+ -+ -+ You may want to disable this behavior if you want to control from -+ script level when the 100 Trying is to be sent out. -+ -+ -+ -+ Default value is 1 (enabled). -+ -+ -+ -+ Set <varname>auto_100trying</varname> parameter -+ -+... -+# Disable automatic 100 Trying -+modparam("tm", "auto_100trying", 0) -+... -+ -+ -+
-+ - - - -diff --git a/modules/tm/t_lookup.c b/modules/tm/t_lookup.c -index 70322a4..2c4333c 100644 ---- a/modules/tm/t_lookup.c -+++ b/modules/tm/t_lookup.c -@@ -128,6 +128,9 @@ - int ruri_matching=1; - int via1_matching=1; - -+/* by default we automaticaly send 100 Trying on trasacation creation */ -+int auto_100trying=1; -+ - /* this is a global variable which keeps pointer to - transaction currently processed by a process; it it - set by t_lookup_request or t_reply_matching; don't -@@ -1104,7 +1107,7 @@ int t_newtran( struct sip_msg* p_msg ) - return E_BAD_VIA; - } - -- if (p_msg->REQ_METHOD==METHOD_INVITE) { -+ if (auto_100trying && p_msg->REQ_METHOD==METHOD_INVITE) { - t_reply( T, p_msg , 100 , &relay_reason_100); - } - -diff --git a/modules/tm/t_lookup.h b/modules/tm/t_lookup.h -index fec6c49..b065bf3 100644 ---- a/modules/tm/t_lookup.h -+++ b/modules/tm/t_lookup.h -@@ -40,6 +40,7 @@ - extern unsigned int global_msg_id; - extern int ruri_matching; - extern int via1_matching; -+extern int auto_100trying; - - void init_t(); - int init_rb( struct retr_buf *rb, struct sip_msg *msg ); -diff --git a/modules/tm/tm.c b/modules/tm/tm.c -index 1db8dbc..65d343a 100644 ---- a/modules/tm/tm.c -+++ b/modules/tm/tm.c -@@ -274,6 +274,8 @@ static param_export_t params[]={ - &minor_branch_flag }, - { "own_timer_proc", INT_PARAM, - &own_timer_proc }, -+ { "auto_100trying", INT_PARAM, -+ &auto_100trying }, - {0,0,0} - }; - diff --git a/opensips-0019-Fix-script-varibles-for-providing-port-and-proto-as-.patch b/opensips-0019-Fix-script-varibles-for-providing-port-and-proto-as-.patch deleted file mode 100644 index 4b0c07b..0000000 --- a/opensips-0019-Fix-script-varibles-for-providing-port-and-proto-as-.patch +++ /dev/null @@ -1,101 +0,0 @@ -From: Bogdan-Andrei Iancu -Date: Fri, 24 Jun 2016 11:01:15 +0300 -Subject: [PATCH] Fix script varibles for providing port and proto (as part of - SIP URI). - -If the SIP URI does not have an explicit port or proto, determine the default port/proto in a SIP wise manner (rather than returning 5060 / UDP) (Ex: sip:example.com;transport=tls has default port 5061 and not 5060 ; or sips:example.com has default proto TLS and not UDP). - -Affected variables are $dp, $rp, $op and $dP, $rP, $oP - -(cherry picked from commit 6cc850e34dcd022f1ed354bd50d9a1809518fa1f) - -diff --git a/pvar.c b/pvar.c -index 3362d6d..7c1921e 100644 ---- a/pvar.c -+++ b/pvar.c -@@ -87,9 +87,6 @@ static str str_null = { _str_null_hlp, 6 }; - static char _str_empty_hlp[1] = { 0 }; - static str str_empty = { _str_empty_hlp, 0 }; - --static char _str_5060_hlp[5] = {'5','0','6','0',0}; --static str str_5060 = { _str_5060_hlp, 4 }; -- - static char _str_udp_hlp[4] = {'u','d','p',0}; - static str str_udp = { _str_udp_hlp, 3 }; - -@@ -227,16 +224,6 @@ int pv_get_null(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) - res->flags = PV_VAL_NULL; - return 0; - } --static int pv_get_udp(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) --{ -- return pv_get_strintval(msg, param, res, &str_udp, (int)PROTO_UDP); --} -- --static int pv_get_5060(struct sip_msg *msg, pv_param_t *param, pv_value_t *res) --{ -- return pv_get_strintval(msg, param, res, &str_5060, 5060); --} -- - - /************************************************************/ - static int pv_get_pid(struct sip_msg *msg, pv_param_t *param, -@@ -448,6 +435,9 @@ static int pv_get_ouri(struct sip_msg *msg, pv_param_t *param, - static int pv_get_xuri_attr(struct sip_msg *msg, struct sip_uri *parsed_uri, - pv_param_t *param, pv_value_t *res) - { -+ unsigned short proto; -+ str proto_s; -+ - if(param->pvn.u.isname.name.n==1) /* username */ - { - if(parsed_uri->user.s==NULL || parsed_uri->user.len<=0) -@@ -459,12 +449,17 @@ static int pv_get_xuri_attr(struct sip_msg *msg, struct sip_uri *parsed_uri, - return pv_get_strval(msg, param, res, &parsed_uri->host); - } else if(param->pvn.u.isname.name.n==3) /* port */ { - if(parsed_uri->port.s==NULL) -- return pv_get_5060(msg, param, res); -+ return pv_get_uintval(msg, param, res, -+ get_uri_port( parsed_uri, &proto)); - return pv_get_strintval(msg, param, res, &parsed_uri->port, - (int)parsed_uri->port_no); - } else if(param->pvn.u.isname.name.n==4) /* protocol */ { -- if(parsed_uri->transport_val.s==NULL) -- return pv_get_udp(msg, param, res); -+ if(parsed_uri->transport_val.s==NULL) { -+ get_uri_port(parsed_uri, &proto); -+ proto_s.s = get_proto_name(proto); -+ proto_s.len = strlen(proto_s.s); -+ return pv_get_strintval(msg, param, res, &proto_s, (int)proto); -+ } - return pv_get_strintval(msg, param, res, &parsed_uri->transport_val, - (int)parsed_uri->proto); - } -@@ -1334,6 +1329,8 @@ static int pv_get_dsturi_attr(struct sip_msg *msg, pv_param_t *param, - pv_value_t *res) - { - struct sip_uri uri; -+ unsigned short proto; -+ str proto_s; - - if(msg==NULL) - return -1; -@@ -1356,11 +1353,15 @@ static int pv_get_dsturi_attr(struct sip_msg *msg, pv_param_t *param, - return pv_get_strval(msg, param, res, &uri.host); - } else if(param->pvn.u.isname.name.n==2) /* port */ { - if(uri.port.s==NULL) -- return pv_get_5060(msg, param, res); -+ return pv_get_uintval(msg, param, res, get_uri_port(&uri, &proto)); - return pv_get_strintval(msg, param, res, &uri.port, (int)uri.port_no); - } else if(param->pvn.u.isname.name.n==3) /* proto */ { -- if(uri.transport_val.s==NULL) -- return pv_get_udp(msg, param, res); -+ if(uri.transport_val.s==NULL) { -+ get_uri_port(&uri, &proto); -+ proto_s.s = get_proto_name(proto); -+ proto_s.len = strlen(proto_s.s); -+ return pv_get_strintval(msg, param, res, &proto_s, (int)proto); -+ } - return pv_get_strintval(msg, param, res, &uri.transport_val, - (int)uri.proto); - } diff --git a/opensips-0020-Fix-undefined-function.patch b/opensips-0020-Fix-undefined-function.patch deleted file mode 100644 index a063f92..0000000 --- a/opensips-0020-Fix-undefined-function.patch +++ /dev/null @@ -1,71 +0,0 @@ -From: Liviu Chircu -Date: Sat, 25 Jun 2016 17:05:35 +0300 -Subject: [PATCH] Fix undefined function - -Thanks to Nick Altmann for the quick report - -diff --git a/socket_info.c b/socket_info.c -index 3b3019e..299dcb4 100644 ---- a/socket_info.c -+++ b/socket_info.c -@@ -169,32 +169,6 @@ static void free_sock_info(struct socket_info* si) - } - - -- --static char* get_proto_name(unsigned short proto) --{ -- switch(proto){ -- case PROTO_NONE: -- return "*"; -- case PROTO_UDP: -- return "udp"; --#ifdef USE_TCP -- case PROTO_TCP: -- return "tcp"; --#endif --#ifdef USE_TLS -- case PROTO_TLS: -- return "tls"; --#endif --#ifdef USE_SCTP -- case PROTO_SCTP: -- return "sctp"; --#endif -- default: -- return "unknown"; -- } --} -- -- - /* checks if the proto: host:port is one of the address we listen on - * and returns the corresponding socket_info structure. - * if port==0, the port number is ignored -diff --git a/socket_info.h b/socket_info.h -index 7ba987e..294f659 100644 ---- a/socket_info.h -+++ b/socket_info.h -@@ -124,6 +124,23 @@ struct socket_info* find_si(struct ip_addr* ip, unsigned short port, - } \ - } while(0) - -+static inline char *get_proto_name(enum sip_protos proto) -+{ -+ switch (proto) { -+ case PROTO_NONE: -+ return "*"; -+ case PROTO_UDP: -+ return "udp"; -+ case PROTO_TCP: -+ return "tcp"; -+ case PROTO_TLS: -+ return "tls"; -+ case PROTO_SCTP: -+ return "sctp"; -+ default: -+ return "unknown"; -+ } -+} - - static inline struct socket_info** get_sock_info_list(unsigned short proto) - { diff --git a/opensips-0021-Fix-dialplan-module-when-using-db_text-backend.patch b/opensips-0021-Fix-dialplan-module-when-using-db_text-backend.patch deleted file mode 100644 index a3eb1f0..0000000 --- a/opensips-0021-Fix-dialplan-module-when-using-db_text-backend.patch +++ /dev/null @@ -1,189 +0,0 @@ -From: Bogdan-Andrei Iancu -Date: Fri, 24 Jun 2016 10:16:18 -0400 -Subject: [PATCH] Fix dialplan module when using db_text backend. - -The db_text makes no difference between NULL or "empty string" values in DB -> both are internally translated as NULL . The dialplan module, in a very abusive way, forces "not null" (in DB schema and in the code for data validation) even for columns that are optional (like subst_exp, repl_exp, timerec and attrs). Besides being bogus (if a column is not to be used, you have to set it to empty string rather than let it NULL), it makes impossible the usage of db_text with dialplan. -This fix allows (DB and code) the mentioned DB columns to be also NULL. -The change is backward compatible, it should not break any existing usage of the dialplan module. - -(cherry picked from commit 8f548976389ee3968bf06f649b54d88db694f949) -(cherry picked from commit 618ff9254472e6f4e3c4af6f49b7513bbd49593d) - -diff --git a/db/schema/dialplan.xml b/db/schema/dialplan.xml -index 9b6d783..206becc 100644 ---- a/db/schema/dialplan.xml -+++ b/db/schema/dialplan.xml -@@ -66,21 +66,23 @@ - subst_exp - string - 64 -- Substitution expresion. -+ -+ Substitution expression. - - - - repl_exp - string - 32 -- Replacement expresion (sed like). -+ -+ Replacement expression (sed like). - - - - disabled - int - 11 -- 0 -+ 0 - Specifies if the command can be used, or is disabled. - - -@@ -88,6 +90,7 @@ - attrs - string - 32 -+ - General attributes string to be returned in case of rule matching. - - -diff --git a/modules/dialplan/dialplan.c b/modules/dialplan/dialplan.c -index 0981bf5..fea7bc2 100644 ---- a/modules/dialplan/dialplan.c -+++ b/modules/dialplan/dialplan.c -@@ -311,7 +311,7 @@ static int dp_translate_f(struct sip_msg *msg, char *str1, char *str2, - /* we are done reading -> unref the data */ - lock_stop_read( table->ref_lock ); - -- if (attr_spec) { -+ if (attr_spec && attrs.s && attrs.len) { - pval.flags = PV_VAL_STR; - pval.rs = attrs; - -diff --git a/modules/dialplan/dp_db.c b/modules/dialplan/dp_db.c -index a2161f5..0353241 100644 ---- a/modules/dialplan/dp_db.c -+++ b/modules/dialplan/dp_db.c -@@ -48,14 +48,20 @@ str attrs_column = str_init(ATTRS_COL); - static db_con_t* dp_db_handle = 0; /* database connection handle */ - static db_func_t dp_dbf; - --#define GET_STR_VALUE(_res, _values, _index)\ -+#define GET_STR_VALUE(_res, _values, _index, _null)\ - do{\ -- if ( VAL_NULL((_values)+ (_index)) ) { \ -- LM_ERR(" values %d is NULL - not allowed\n",_index);\ -- goto err;\ -- } \ -- (_res).s = VAL_STR((_values)+ (_index)).s;\ -- (_res).len = strlen(VAL_STR((_values)+ (_index)).s);\ -+ if ( VAL_NULL((_values)+ (_index))) { \ -+ if ( !_null) { \ -+ LM_ERR(" values %d is NULL - not allowed\n",_index);\ -+ goto err;\ -+ } else { \ -+ (_res).s = NULL; \ -+ (_res).len = 0; \ -+ } \ -+ } else { \ -+ (_res).s = VAL_STR((_values)+ (_index)).s;\ -+ (_res).len = strlen(VAL_STR((_values)+ (_index)).s);\ -+ }\ - }while(0); - - void destroy_rule(dpl_node_t * rule); -@@ -342,7 +348,7 @@ dpl_node_t * build_rule(db_val_t * values) - repl_comp = 0; - new_rule = 0; - -- GET_STR_VALUE(match_exp, values, 3); -+ GET_STR_VALUE(match_exp, values, 3, 0); - if(matchop == REGEX_OP){ - - LM_DBG("Compiling %.*s expression with flag: %d\n", -@@ -358,8 +364,8 @@ dpl_node_t * build_rule(db_val_t * values) - } - - LM_DBG("building subst rule\n"); -- GET_STR_VALUE(subst_exp, values, 5); -- if(subst_exp.s && subst_exp.len){ -+ GET_STR_VALUE(subst_exp, values, 5, 1); -+ if(!VAL_NULL(values+5) && subst_exp.s && subst_exp.len){ - /* subst regexp */ - subst_comp = wrap_pcre_compile(subst_exp.s, VAL_INT(values+4)); - if(subst_comp == NULL){ -@@ -369,8 +375,8 @@ dpl_node_t * build_rule(db_val_t * values) - } - - /* replace exp */ -- GET_STR_VALUE(repl_exp, values, 6); -- if(repl_exp.len && repl_exp.s){ -+ GET_STR_VALUE(repl_exp, values, 6, 1); -+ if(!VAL_NULL(values+6) && repl_exp.len && repl_exp.s){ - repl_comp = repl_exp_parse(repl_exp); - if(!repl_comp){ - LM_ERR("failed to compile replacing expression %.*s\n", -@@ -416,12 +422,15 @@ dpl_node_t * build_rule(db_val_t * values) - new_rule->pr = VAL_INT(values+1); - new_rule->match_flags = VAL_INT(values+4); - new_rule->matchop = matchop; -- GET_STR_VALUE(attrs, values, 7); -- if(str_to_shm(attrs, &new_rule->attrs)!=0) -- goto err; - -- LM_DBG("attrs are %.*s\n", -- new_rule->attrs.len, new_rule->attrs.s); -+ /* attributes */ -+ GET_STR_VALUE(attrs, values, 7, 1); -+ if( !VAL_NULL(values+7) && attrs.len && attrs.s) { -+ if(str_to_shm(attrs, &new_rule->attrs)!=0) -+ goto err; -+ LM_DBG("attrs are %.*s\n", -+ new_rule->attrs.len, new_rule->attrs.s); -+ } - - if (match_comp) - new_rule->match_comp = match_comp; -diff --git a/scripts/dbtext/opensips/dialplan b/scripts/dbtext/opensips/dialplan -index 105f64c..0fbd5c8 100644 ---- a/scripts/dbtext/opensips/dialplan -+++ b/scripts/dbtext/opensips/dialplan -@@ -1 +1 @@ --id(int,auto) dpid(int) pr(int) match_op(int) match_exp(string) match_flags(int) subst_exp(string) repl_exp(string) disabled(int) attrs(string) -+id(int,auto) dpid(int) pr(int) match_op(int) match_exp(string) match_flags(int) subst_exp(string,null) repl_exp(string,null) disabled(int) attrs(string,null) -diff --git a/scripts/mysql/dialplan-create.sql b/scripts/mysql/dialplan-create.sql -index 9c7b8e7..d3cfae9 100644 ---- a/scripts/mysql/dialplan-create.sql -+++ b/scripts/mysql/dialplan-create.sql -@@ -6,9 +6,9 @@ CREATE TABLE dialplan ( - match_op INT(11) NOT NULL, - match_exp CHAR(64) NOT NULL, - match_flags INT(11) NOT NULL, -- subst_exp CHAR(64) NOT NULL, -- repl_exp CHAR(32) NOT NULL, -+ subst_exp CHAR(64), -+ repl_exp CHAR(32), - disabled INT(11) DEFAULT 0 NOT NULL, -- attrs CHAR(32) NOT NULL -+ attrs CHAR(32) - ) ENGINE=MyISAM; - -diff --git a/scripts/postgres/dialplan-create.sql b/scripts/postgres/dialplan-create.sql -index d77eee7..a014ab0 100644 ---- a/scripts/postgres/dialplan-create.sql -+++ b/scripts/postgres/dialplan-create.sql -@@ -6,10 +6,10 @@ CREATE TABLE dialplan ( - match_op INTEGER NOT NULL, - match_exp VARCHAR(64) NOT NULL, - match_flags INTEGER NOT NULL, -- subst_exp VARCHAR(64) NOT NULL, -- repl_exp VARCHAR(32) NOT NULL, -+ subst_exp VARCHAR(64), -+ repl_exp VARCHAR(32), - disabled INTEGER DEFAULT 0 NOT NULL, -- attrs VARCHAR(32) NOT NULL -+ attrs VARCHAR(32) - ); - - ALTER SEQUENCE dialplan_id_seq MAXVALUE 2147483647 CYCLE; diff --git a/opensips-0022-permissions-fix-get_source_group-return.patch b/opensips-0022-permissions-fix-get_source_group-return.patch deleted file mode 100644 index 1e9d8b8..0000000 --- a/opensips-0022-permissions-fix-get_source_group-return.patch +++ /dev/null @@ -1,41 +0,0 @@ -From: Razvan Crainea -Date: Mon, 4 Jul 2016 15:04:16 +0300 -Subject: [PATCH] permissions: fix get_source_group() return - -In case a group is not found, return -1 instead of true - -(cherry picked from commit e7f8d1b9290d7ca54460efb3c7905209152dbc80) - -diff --git a/modules/permissions/address.c b/modules/permissions/address.c -index c07c038..695562d 100644 ---- a/modules/permissions/address.c -+++ b/modules/permissions/address.c -@@ -657,20 +657,21 @@ int get_source_group(struct sip_msg* msg, char *pvar) { - group = find_group_in_hash_table(*hash_table, - ip, - msg->rcv.src_port); -- -- LM_DBG("Found <%d>\n", group); -- - if (group == -1) { - - LM_DBG("Looking for <%x, %u> in subnet table\n", - msg->rcv.src_ip.u.addr32[0], msg->rcv.src_port); - - group = find_group_in_subnet_table(*subnet_table, -- ip, -- msg->rcv.src_port); -- -- LM_DBG("Found <%d>\n", group); -+ ip, -+ msg->rcv.src_port); -+ if (group == -1) { -+ LM_DBG("IP <%.*s:%u> not found in any group\n", -+ str_ip.len, str_ip.s, msg->rcv.src_port); -+ return -1; -+ } - } -+ LM_DBG("Found <%d>\n", group); - - pvt.flags = PV_VAL_INT|PV_TYPE_INT; - pvt.rs.s = NULL; diff --git a/opensips-0023-acc-Fix-incorrect-Request-URI-handling.patch b/opensips-0023-acc-Fix-incorrect-Request-URI-handling.patch deleted file mode 100644 index 4b15a86..0000000 --- a/opensips-0023-acc-Fix-incorrect-Request-URI-handling.patch +++ /dev/null @@ -1,26 +0,0 @@ -From: Liviu Chircu -Date: Fri, 1 Jul 2016 13:55:54 +0300 -Subject: [PATCH] acc: Fix incorrect Request-URI handling - -If the config script does not include any Request-URI altering logic -(e.g. no lookup() or $ru manipulation), the acc module would incorrectly fill -in a "msg->new_uri" field which should NOT be freed into the SIP request -structure, leading to the memory pool being corrupted upon transaction release. - -Credits to Guillaume Lacroix for reporting - -(cherry picked from commit 02cb9f048d0a5e1f988aa9ccae1691216ed16ee5) - -diff --git a/modules/acc/acc_logic.c b/modules/acc/acc_logic.c -index f717639..d791d0a 100644 ---- a/modules/acc/acc_logic.c -+++ b/modules/acc/acc_logic.c -@@ -462,7 +462,7 @@ static inline void on_missed(struct cell *t, struct sip_msg *req, - */ - reset_acc_flag( req, flags_to_reset ); - -- if (new_uri_bk.s) { -+ if (t->nr_of_outgoings) { - req->new_uri = new_uri_bk; - req->dst_uri = dst_uri_bk; - req->parsed_uri_ok = 0; diff --git a/opensips-0024-Fix-error-message-when-a-route-is-not-defined.patch b/opensips-0024-Fix-error-message-when-a-route-is-not-defined.patch deleted file mode 100644 index eabfc12..0000000 --- a/opensips-0024-Fix-error-message-when-a-route-is-not-defined.patch +++ /dev/null @@ -1,22 +0,0 @@ -From: Bogdan-Andrei Iancu -Date: Thu, 7 Jul 2016 13:27:47 +0300 -Subject: [PATCH] Fix error message when a route is not defined. - -Print the name of the route too - the ID is irrelevant for the script writter. - -(cherry picked from commit 409481818148d7951e1520c9dd4eb715c2bec7c6) - -diff --git a/route.c b/route.c -index a750ad5..b09c1d3 100644 ---- a/route.c -+++ b/route.c -@@ -281,7 +281,8 @@ static int fix_actions(struct action* a) - goto error; - } - if ( rlist[t->elem[0].u.number].a==NULL ) { -- LM_ERR("called route %d is not defined\n", -+ LM_ERR("called route [%s] (id=%d) is not defined\n", -+ rlist[t->elem[0].u.number].name, - (int)t->elem[0].u.number); - ret = E_CFG; - goto error; diff --git a/opensips-0025-dialog-advance-to-next-cell-in-case-of-error.patch b/opensips-0025-dialog-advance-to-next-cell-in-case-of-error.patch deleted file mode 100644 index 85adfe9..0000000 --- a/opensips-0025-dialog-advance-to-next-cell-in-case-of-error.patch +++ /dev/null @@ -1,34 +0,0 @@ -From: Razvan Crainea -Date: Fri, 8 Jul 2016 11:20:38 +0300 -Subject: [PATCH] dialog: advance to next cell in case of error - -(cherry picked from commit 70db2cfcdb0c74e6437db2aa9663fd0a5000ecdd) - -diff --git a/modules/dialog/dlg_db_handler.c b/modules/dialog/dlg_db_handler.c -index 0b75395..53ec0ba 100644 ---- a/modules/dialog/dlg_db_handler.c -+++ b/modules/dialog/dlg_db_handler.c -@@ -1381,6 +1381,7 @@ void dialog_update_db(unsigned int ticks, void * param) - if((dialog_dbf.insert(dialog_db_handle, insert_keys, - values, DIALOG_TABLE_TOTAL_COL_NO)) !=0){ - LM_ERR("could not add another dialog to db\n"); -+ cell = cell->next; - continue; - } - -@@ -1422,6 +1423,7 @@ void dialog_update_db(unsigned int ticks, void * param) - if((dialog_dbf.update(dialog_db_handle, (insert_keys), 0, - (values), (insert_keys+15), (values+15), 1, 10)) !=0) { - LM_ERR("could not update database info\n"); -+ cell = cell->next; - continue; - } - -@@ -1441,6 +1443,7 @@ void dialog_update_db(unsigned int ticks, void * param) - if((dialog_dbf.update(dialog_db_handle, (insert_keys), 0, - (values), (insert_keys+21), (values+21), 1, 3)) !=0) { - LM_ERR("could not update database info\n"); -+ cell = cell->next; - continue; - } - diff --git a/opensips-0026-acc-bugfix-check-if-database-loaded-before-using-its.patch b/opensips-0026-acc-bugfix-check-if-database-loaded-before-using-its.patch deleted file mode 100644 index a8a51fd..0000000 --- a/opensips-0026-acc-bugfix-check-if-database-loaded-before-using-its.patch +++ /dev/null @@ -1,38 +0,0 @@ -From: ionutrazvanionita -Date: Mon, 11 Jul 2016 11:42:07 +0300 -Subject: [PATCH] [acc][bugfix] check if database loaded before using its - handler - -(cherry picked from commit 8dd10d85b408947576223e75a67228ed7c7abd91) - -Conflicts: - modules/acc/acc.c - -diff --git a/modules/acc/acc.c b/modules/acc/acc.c -index 37a763a..a8a10e3 100644 ---- a/modules/acc/acc.c -+++ b/modules/acc/acc.c -@@ -557,6 +557,11 @@ int acc_db_request( struct sip_msg *rq, struct sip_msg *rpl, - int n; - int i; - -+ if (!acc_dbf.use_table || !acc_dbf.insert) { -+ LM_ERR("database not loaded! Probably database url not defined!\n"); -+ return -1; -+ } -+ - /* formated database columns */ - m = core2strar( rq, val_arr ); - -@@ -610,6 +615,11 @@ int acc_db_cdrs(struct dlg_cell *dlg, struct sip_msg *msg) - static db_ps_t my_ps = NULL; - static query_list_t *ins_list = NULL; - -+ if (!acc_dbf.use_table || !acc_dbf.insert) { -+ LM_ERR("database not loaded! Probably database url not defined!\n"); -+ return -1; -+ } -+ - core_s.s = extra_s.s = leg_s.s = 0; - - ret = prebuild_core_arr(dlg, &core_s, &start_time); diff --git a/opensips-0027-Fix-populating-blacklists.patch b/opensips-0027-Fix-populating-blacklists.patch deleted file mode 100644 index 2733601..0000000 --- a/opensips-0027-Fix-populating-blacklists.patch +++ /dev/null @@ -1,70 +0,0 @@ -From: Bogdan-Andrei Iancu -Date: Mon, 11 Jul 2016 23:39:41 +0300 -Subject: [PATCH] Fix populating blacklists. - -When creating the blacklists, use the port and protocol of the destination too, otherwise the rules may conflict or be too wide to be used (like 2 destinations with same IP but different ports). - -(cherry picked from commit 0495faa7d96f92da13102480ca43cd1befd37ba0) - -diff --git a/modules/dispatcher/dispatch.c b/modules/dispatcher/dispatch.c -index 0edd6e8..26cffce 100644 ---- a/modules/dispatcher/dispatch.c -+++ b/modules/dispatcher/dispatch.c -@@ -246,6 +246,7 @@ int add_dest2list(int id, str uri, struct socket_info *sock, int state, - } - hostent2ip_addr( &dp->ips[0], &proxy->host, proxy->addr_idx); - dp->ports[0] = proxy->port; -+ dp->protos[0] = proxy->proto; - dp->ips_cnt = 1; - LM_DBG("first gw ip addr [%s]:%d\n", - ip_addr2a(&dp->ips[0]), dp->ports[0]); -@@ -253,8 +254,10 @@ int add_dest2list(int id, str uri, struct socket_info *sock, int state, - while (dp->ips_cntips[dp->ips_cnt], &sau); - dp->ports[dp->ips_cnt] = proxy->port; -- LM_DBG("additional gw ip addr [%s]:%d\n", -- ip_addr2a(&dp->ips[dp->ips_cnt]), dp->ports[dp->ips_cnt]); -+ dp->protos[dp->ips_cnt] = proxy->proto; -+ LM_DBG("additional gw ip addr [%s]:%d, proto %d\n", -+ ip_addr2a(&dp->ips[dp->ips_cnt]), -+ dp->ports[dp->ips_cnt], dp->protos[dp->ips_cnt]); - /* one more IP found */ - dp->ips_cnt++; - } -diff --git a/modules/dispatcher/dispatch.h b/modules/dispatcher/dispatch.h -index 77955fd..aa07feb 100644 ---- a/modules/dispatcher/dispatch.h -+++ b/modules/dispatcher/dispatch.h -@@ -76,6 +76,7 @@ typedef struct _ds_dest - struct socket_info *sock; - struct ip_addr ips[DS_MAX_IPS]; /* IP-Address of the entry */ - unsigned short int ports[DS_MAX_IPS]; /* Port of the request URI */ -+ unsigned short int protos[DS_MAX_IPS]; /* Protocol of the request URI */ - unsigned short ips_cnt; - unsigned short failure_count; - void *param; -diff --git a/modules/dispatcher/ds_bl.c b/modules/dispatcher/ds_bl.c -index 291e891..89b0388 100644 ---- a/modules/dispatcher/ds_bl.c -+++ b/modules/dispatcher/ds_bl.c -@@ -177,7 +177,8 @@ int populate_ds_bls( ds_set_t *sets) - /* search if any set matches the one above */ - for( set=sets ; set ; set = set->next) { - if (set->id == dsbl->sets[i]) { -- LM_DBG("Set [%d] matches. Adding all destinations:\n", set->id); -+ LM_DBG("Set [%d] matches. Adding all destinations:\n", -+ set->id); - for (dst = set->dlist; dst; dst = dst->next) { - /* and add all IPs for each destination */ - for( k=0 ; kips_cnt ; k++ ) { -@@ -192,8 +193,8 @@ int populate_ds_bls( ds_set_t *sets) - add_rule_to_list( &dsbl_first, &dsbl_last, - set_net, - NULL/*body*/, -- 0/*port*/, -- PROTO_NONE/*proto*/, -+ dst->ports[k], -+ dst->protos[k], - 0/*flags*/); - pkg_free(set_net); - } diff --git a/opensips-0028-Fix-populating-blacklists.patch b/opensips-0028-Fix-populating-blacklists.patch deleted file mode 100644 index d6818fb..0000000 --- a/opensips-0028-Fix-populating-blacklists.patch +++ /dev/null @@ -1,65 +0,0 @@ -From: Bogdan-Andrei Iancu -Date: Mon, 11 Jul 2016 23:59:02 +0300 -Subject: [PATCH] Fix populating blacklists. - -When creating the blacklists, use the port and protocol of the destination too, otherwise the rules may conflict or be too wide to be used (like 2 destinations with same IP but different ports). - -(cherry picked from commit 97f309c34c7333270a3f0f997868bdb9b94107f1) - -diff --git a/modules/drouting/dr_bl.c b/modules/drouting/dr_bl.c -index 1630584..a62bc01 100644 ---- a/modules/drouting/dr_bl.c -+++ b/modules/drouting/dr_bl.c -@@ -186,12 +186,14 @@ int populate_dr_bls(pgw_t *pgwa) - continue; - } - /* add this destination to the BL */ -- add_rule_to_list( &drbl_first, &drbl_last, -- gw_net, -- NULL/*body*/, -- 0/*port*/, -- PROTO_NONE/*proto*/, -- 0/*flags*/); -+ if( add_rule_to_list( &drbl_first, &drbl_last, -+ gw_net, -+ NULL/*body*/, -+ gw->ports[j], -+ gw->protos[j], -+ 0/*flags*/) != 0) { -+ LM_ERR("Something went wrong in add_rule_to_list\n"); -+ } - pkg_free(gw_net); - } - } -diff --git a/modules/drouting/prefix_tree.h b/modules/drouting/prefix_tree.h -index b7fa589..c952fe1 100644 ---- a/modules/drouting/prefix_tree.h -+++ b/modules/drouting/prefix_tree.h -@@ -81,6 +81,7 @@ typedef struct pgw_ { - /* addres and port */ - struct ip_addr ips[DR_MAX_IPS]; - unsigned short ports[DR_MAX_IPS]; -+ unsigned short protos[DR_MAX_IPS]; - unsigned short ips_no; - struct pgw_ *next; - int flags; -diff --git a/modules/drouting/routing.c b/modules/drouting/routing.c -index 8aeea6e..cf74ada 100644 ---- a/modules/drouting/routing.c -+++ b/modules/drouting/routing.c -@@ -574,6 +574,7 @@ add_dst( - } - hostent2ip_addr( &pgw->ips[0], &proxy->host, proxy->addr_idx); - pgw->ports[0] = proxy->port; -+ pgw->protos[0] = proxy->proto; - LM_DBG("first gw ip addr [%s]\n", ip_addr2a(&pgw->ips[0])); - - pgw->ips_no = 1; -@@ -581,6 +582,7 @@ add_dst( - while (pgw->ips_noips[pgw->ips_no], &sau); - pgw->ports[pgw->ips_no] = proxy->port; -+ pgw->protos[pgw->ips_no] = proxy->proto; - LM_DBG("additional gw ip addr [%s]\n", - ip_addr2a( &pgw->ips[pgw->ips_no] ) ); - pgw->ips_no++; diff --git a/opensips-0029-Fix-populating-blacklists.patch b/opensips-0029-Fix-populating-blacklists.patch deleted file mode 100644 index fe77833..0000000 --- a/opensips-0029-Fix-populating-blacklists.patch +++ /dev/null @@ -1,60 +0,0 @@ -From: Bogdan-Andrei Iancu -Date: Tue, 12 Jul 2016 00:11:50 +0300 -Subject: [PATCH] Fix populating blacklists. - -When creating the blacklists, use the port and protocol of the destination too, otherwise the rules may conflict or be too wide to be used (like 2 destinations with same IP but different ports). - -(cherry picked from commit 7fa9cee5037af26fd1c63b70710f2bc03e6a31f4) - -diff --git a/modules/load_balancer/lb_bl.c b/modules/load_balancer/lb_bl.c -index 97ba000..c02cd0c 100644 ---- a/modules/load_balancer/lb_bl.c -+++ b/modules/load_balancer/lb_bl.c -@@ -190,8 +190,8 @@ int populate_lb_bls(struct lb_dst *dest_list) - add_rule_to_list( &lbbl_first, &lbbl_last, - group_net, - NULL/*body*/, -- 0/*port*/, -- PROTO_NONE/*proto*/, -+ dst->ports[j], -+ dst->protos[j], - 0/*flags*/); - pkg_free(group_net); - } -diff --git a/modules/load_balancer/lb_data.c b/modules/load_balancer/lb_data.c -index 1cf1721..aeeee8e 100644 ---- a/modules/load_balancer/lb_data.c -+++ b/modules/load_balancer/lb_data.c -@@ -303,6 +303,7 @@ int add_lb_dsturi( struct lb_data *data, int id, int group, char *uri, - } - hostent2ip_addr( &dst->ips[0], &proxy->host, proxy->addr_idx); - dst->ports[0] = proxy->port; -+ dst->protos[0] = proxy->proto; - dst->ips_cnt = 1; - LM_DBG("first dst ip addr [%s]:%d\n", - ip_addr2a(&dst->ips[0]), dst->ports[0]); -@@ -310,8 +311,10 @@ int add_lb_dsturi( struct lb_data *data, int id, int group, char *uri, - while (dst->ips_cntips[dst->ips_cnt], &sau); - dst->ports[dst->ips_cnt] = proxy->port; -- LM_DBG("additional dst ip addr [%s]:%d\n", -- ip_addr2a(&dst->ips[dst->ips_cnt]), dst->ports[dst->ips_cnt]); -+ dst->protos[dst->ips_cnt] = proxy->proto; -+ LM_DBG("additional dst ip addr [%s]:%d, proto %d\n", -+ ip_addr2a(&dst->ips[dst->ips_cnt]), -+ dst->ports[dst->ips_cnt], dst->protos[dst->ips_cnt] ); - /* one more IP found */ - dst->ips_cnt++; - } -diff --git a/modules/load_balancer/lb_data.h b/modules/load_balancer/lb_data.h -index 33a4688..38c942a 100644 ---- a/modules/load_balancer/lb_data.h -+++ b/modules/load_balancer/lb_data.h -@@ -73,6 +73,7 @@ struct lb_dst { - struct lb_resource_map *rmap; - struct ip_addr ips[LB_MAX_IPS]; /* IP-Address of the entry */ - unsigned short int ports[LB_MAX_IPS]; /* Port of the request URI */ -+ unsigned short int protos[LB_MAX_IPS]; /* Protocol of the request URI */ - unsigned short ips_cnt; - struct lb_dst *next; - }; diff --git a/opensips-0030-Fix-advertised-port-and-address-per-branch.patch b/opensips-0030-Fix-advertised-port-and-address-per-branch.patch deleted file mode 100644 index d63a4ab..0000000 --- a/opensips-0030-Fix-advertised-port-and-address-per-branch.patch +++ /dev/null @@ -1,148 +0,0 @@ -From: Bogdan-Andrei Iancu -Date: Tue, 12 Jul 2016 15:26:12 +0300 -Subject: [PATCH] Fix advertised port and address per branch. - -Before the advertised_port/address are preserved only in the UAS part of the transaction - that means it is only one value and it is from the setting done in Request Route; whatever later setting done in Failure Route or Branch Route are not preserved at transaction level (even if they are used on the spot, for sending out the INVITE). -So, when we have to build a local request (ACK or CANCEL), we do not remember which specific address/port were advertised for that particular UAC (branch). - -Fixes #917. - -(cherry picked from commit eb850a22f0af83bf75e75dfadbe1320e8b92784b) - -diff --git a/modules/tm/h_table.c b/modules/tm/h_table.c -index e14a305..6263311 100644 ---- a/modules/tm/h_table.c -+++ b/modules/tm/h_table.c -@@ -178,6 +178,12 @@ void free_cell( struct cell* dead_cell ) - if (dead_cell->uac[i].path_vec.s) { - __shm_free(dead_cell->uac[i].path_vec.s); - } -+ if (dead_cell->uac[i].adv_address.s) { -+ __shm_free(dead_cell->uac[i].adv_address.s); -+ } -+ if (dead_cell->uac[i].adv_port.s) { -+ __shm_free(dead_cell->uac[i].adv_port.s); -+ } - if (dead_cell->uac[i].duri.s) { - __shm_free(dead_cell->uac[i].duri.s); - } -diff --git a/modules/tm/h_table.h b/modules/tm/h_table.h -index 1661f94..a06fc8c 100644 ---- a/modules/tm/h_table.h -+++ b/modules/tm/h_table.h -@@ -149,6 +149,10 @@ typedef struct ua_client - str duri; - /* the path vector used for this branch */ - str path_vec; -+ /* the advertised address used for this branch */ -+ str adv_address; -+ /* the advertised port used for this branch */ -+ str adv_port; - /* number of RR headers that were locally added for this branch */ - unsigned int added_rr; - /* if we store a reply (branch picking), this is where it is */ -diff --git a/modules/tm/t_fwd.c b/modules/tm/t_fwd.c -index 9ebf909..489f9e2 100644 ---- a/modules/tm/t_fwd.c -+++ b/modules/tm/t_fwd.c -@@ -118,6 +118,33 @@ static inline int pre_print_uac_request( struct cell *t, int branch, - request->path_vec.len+1); - } - -+ /* do the same for the advertised port & address */ -+ if (request->set_global_address.len) { -+ t->uac[branch].adv_address.s = shm_resize(t->uac[branch].adv_address.s, -+ request->set_global_address.len+1); -+ if (t->uac[branch].adv_address.s==NULL) { -+ LM_ERR("shm_resize failed for storing the advertised address " -+ "(len=%d)\n",request->set_global_address.len); -+ goto error; -+ } -+ t->uac[branch].adv_address.len = request->set_global_address.len; -+ memcpy( t->uac[branch].adv_address.s, request->set_global_address.s, -+ request->set_global_address.len+1); -+ } -+ if (request->set_global_port.len) { -+ t->uac[branch].adv_port.s = shm_resize(t->uac[branch].adv_port.s, -+ request->set_global_port.len+1); -+ if (t->uac[branch].adv_port.s==NULL) { -+ LM_ERR("shm_resize failed for storing the advertised port " -+ "(len=%d)\n",request->set_global_port.len); -+ goto error; -+ } -+ t->uac[branch].adv_port.len = request->set_global_port.len; -+ memcpy( t->uac[branch].adv_port.s, request->set_global_port.s, -+ request->set_global_port.len+1); -+ } -+ -+ - /********** run route & callback ************/ - - /* run branch route, if any; run it before RURI's DNS lookup -@@ -426,6 +453,10 @@ error01: - destroy_avp_list(&t->uac[branch].user_avps); - if (t->uac[branch].path_vec.s) - shm_free(t->uac[branch].path_vec.s); -+ if (t->uac[branch].adv_address.s) -+ shm_free(t->uac[branch].adv_address.s); -+ if (t->uac[branch].adv_port.s) -+ shm_free(t->uac[branch].adv_port.s); - if (t->uac[branch].duri.s) - shm_free(t->uac[branch].duri.s); - memset(&t->uac[branch],0,sizeof(t->uac[branch])); -@@ -443,6 +474,8 @@ int e2e_cancel_branch( struct sip_msg *cancel_msg, struct cell *t_cancel, - unsigned int len; - str bk_dst_uri; - str bk_path_vec; -+ str bk_adv_address; -+ str bk_adv_port; - - if (t_cancel->uac[branch].request.buffer.s) { - LM_CRIT("buffer rewrite attempt\n"); -@@ -454,9 +487,13 @@ int e2e_cancel_branch( struct sip_msg *cancel_msg, struct cell *t_cancel, - cancel_msg->parsed_uri_ok=0; - bk_dst_uri = cancel_msg->dst_uri; - bk_path_vec = cancel_msg->path_vec; -+ bk_adv_address = cancel_msg->set_global_address; -+ bk_adv_port = cancel_msg->set_global_port; - -- /* force same path as for request */ -+ /* force same path & advertising as for request */ - cancel_msg->path_vec = t_invite->uac[branch].path_vec; -+ cancel_msg->set_global_address = t_invite->uac[branch].adv_address; -+ cancel_msg->set_global_port = t_invite->uac[branch].adv_port; - - if ( pre_print_uac_request( t_cancel, branch, cancel_msg)!= 0 ) { - ret = -1; -@@ -498,6 +535,8 @@ error01: - &bk_dst_uri); - cancel_msg->dst_uri = bk_dst_uri; - cancel_msg->path_vec = bk_path_vec; -+ cancel_msg->set_global_address = bk_adv_address; -+ cancel_msg->set_global_port = bk_adv_port; - error: - return ret; - } -@@ -623,6 +662,7 @@ int t_forward_nonack( struct cell *t, struct sip_msg* p_msg , - bk_sock = p_msg->force_send_socket; - bk_br_flags = getb0flags(); - bk_path = p_msg->path_vec; -+ /* advertised address/port are not changed */ - - /* check if the UAS retranmission port needs to be updated */ - if ( (p_msg->msg_flags ^ t->uas.request->msg_flags) & FL_FORCE_RPORT ) -diff --git a/modules/tm/t_msgbuilder.c b/modules/tm/t_msgbuilder.c -index 9ce0cd6..6de9a4b 100644 ---- a/modules/tm/t_msgbuilder.c -+++ b/modules/tm/t_msgbuilder.c -@@ -150,6 +150,10 @@ char *build_local(struct cell *Trans,unsigned int branch, - if (!t_calc_branch(Trans, branch, branch_str.s, &branch_str.len )) - goto error; - set_hostport(&hp, (is_local(Trans))?0:req); -+ if (Trans->uac[branch].adv_address.len) -+ hp.host = &Trans->uac[branch].adv_address; -+ if (Trans->uac[branch].adv_port.len) -+ hp.port = &Trans->uac[branch].adv_port; - via=via_builder(&via_len, Trans->uac[branch].request.dst.send_sock, - &branch_str, 0, Trans->uac[branch].request.dst.proto, &hp ); - if (!via){ diff --git a/opensips-0031-Fix-building-Via-Branch-in-stateless-mode.patch b/opensips-0031-Fix-building-Via-Branch-in-stateless-mode.patch deleted file mode 100644 index ee552f4..0000000 --- a/opensips-0031-Fix-building-Via-Branch-in-stateless-mode.patch +++ /dev/null @@ -1,133 +0,0 @@ -From: Bogdan-Andrei Iancu -Date: Mon, 11 Jul 2016 19:28:16 +0300 -Subject: [PATCH] Fix building Via Branch in stateless mode - -Instead of copying the branch value from a previous statefull Via header (which may lead to overflow as OpenSIPS has a maximum value for the built branch), we generate a new branch value based on the previous Via branch - in this way, we have full controll over the length of the resulting Branch and we also inherit the uniqueness of the branch value (from the prev Via hdr). - -Reported by Gupta, Rahul and Elliott, Ray - -(cherry picked from commit 482e643469b351d12418ff54c96beee7b27dca94) - -diff --git a/forward.c b/forward.c -index 736f647..849b07b 100644 ---- a/forward.c -+++ b/forward.c -@@ -65,6 +65,7 @@ - - #include "forward.h" - #include "parser/msg_parser.h" -+#include "parser/parse_from.h" - #include "dprint.h" - #include "ut.h" - #include "dset.h" -@@ -78,6 +79,8 @@ - #include "core_stats.h" - #include "blacklists.h" - #include "msg_callbacks.h" -+#include "md5utils.h" -+ - - - /*************************** callback functions ***************************/ -@@ -316,13 +319,13 @@ found: - - - --static inline str* get_sl_branch(struct sip_msg* msg) -+static inline int set_sl_branch(struct sip_msg* msg) - { -- static str default_branch = str_init("0"); - struct hdr_field *h_via; - struct via_body *b_via; - str *branch; - int via_parsed; -+ char b_md5[MD5_LEN]; - - via_parsed = 0; - branch = 0; -@@ -348,7 +351,7 @@ static inline str* get_sl_branch(struct sip_msg* msg) - if (!via_parsed) { - if ( parse_headers(msg,HDR_EOH_F,0)<0 ) { - LM_ERR("failed to parse all hdrs\n"); -- return 0; -+ return -1; - } - via_parsed = 1; - } -@@ -356,14 +359,45 @@ static inline str* get_sl_branch(struct sip_msg* msg) - - /* no statefull branch :(.. -> use the branch from the last via */ - found: -- if (branch) { -- if (branch->len>(int)MAX_BRANCH_PARAM_LEN) -- branch->len = MAX_BRANCH_PARAM_LEN; -- } else { -- /* no branch found/...use a default one*/ -- branch = &default_branch; -+ if (branch==NULL) { -+ /* no branch found :(.. -> try to use the From TAG param as -+ * a value to seed the MD5 - the From TAG is per call, so it gives -+ * a bit of uniqueness; if this is empty, as a last resort, use the -+ * FROM URI (it cannot mis) */ -+ if ( parse_from_header(msg)!=0 ) -+ { -+ LM_ERR("failed to extract FROM header\n"); -+ return -1; -+ } -+ if ( get_from(msg)->tag_value.len ) -+ branch = &get_from(msg)->tag_value; -+ else -+ branch = &get_from(msg)->uri; -+ } -+ -+ /* make an MD5 over the found branch, to ensure a controlable -+ * length of the resulting branch */ -+ MD5StringArray ( b_md5, branch, 1 ); -+ /* and make a hash over transaction-related values */ -+ if ( parse_headers(msg, HDR_CALLID_F|HDR_CSEQ_F,0)==-1 || -+ msg->callid==NULL || msg->cseq==NULL ) -+ { -+ LM_ERR("failed to extract CALLID or CSEQ hdr from SIP msg\n"); -+ return -1; - } -- return branch; -+ /* build the new branch */ -+ if (branch_builder( -+ core_hash( &msg->callid->body, &get_cseq(msg)->number, 1<<16 ), -+ 0 /*labled - not used here */, -+ b_md5, -+ 0 /*branch - not used here */, -+ msg->add_to_branch_s, &msg->add_to_branch_len )==0 ) -+ { -+ LM_ERR("branch_builder failed to construct the branch\n"); -+ return -1; -+ } -+ -+ return 0; - } - - -@@ -375,7 +409,6 @@ int forward_request( struct sip_msg* msg, struct proxy_l * p) - char* buf; - struct socket_info* send_sock; - struct socket_info* last_sock; -- str *branch; - - buf=0; - -@@ -385,13 +418,10 @@ int forward_request( struct sip_msg* msg, struct proxy_l * p) - * on the topic, you should reuse the latest statefull branch - * --bogdan */ - if ( msg->add_to_branch_len==0 ) { -- branch = get_sl_branch(msg); -- if (branch==0) { -- LM_ERR("unable to compute branch\n"); -+ if (set_sl_branch(msg)!=0) { -+ LM_ERR("unable to compute and add stateless VIA branch\n"); - goto error; - } -- msg->add_to_branch_len = branch->len; -- memcpy( msg->add_to_branch_s, branch->s, branch->len); - } - - msg_callback_process(msg, REQ_PRE_FORWARD, (void *)p); diff --git a/opensips-0032-rest_client-Fix-incorrect-trim-operation.patch b/opensips-0032-rest_client-Fix-incorrect-trim-operation.patch deleted file mode 100644 index 073f77c..0000000 --- a/opensips-0032-rest_client-Fix-incorrect-trim-operation.patch +++ /dev/null @@ -1,59 +0,0 @@ -From: Liviu Chircu -Date: Fri, 15 Jul 2016 16:21:35 +0300 -Subject: [PATCH] rest_client: Fix incorrect trim operation - -(cherry picked from commit d8bf10da34152612e7835a64cedbb7593b8fc57b) - -Conflicts: - modules/rest_client/rest_methods.c - -diff --git a/modules/rest_client/rest_methods.c b/modules/rest_client/rest_methods.c -index c2763b0..d670365 100644 ---- a/modules/rest_client/rest_methods.c -+++ b/modules/rest_client/rest_methods.c -@@ -59,7 +59,7 @@ int rest_get_method(struct sip_msg *msg, char *url, - long http_rc; - pv_value_t pv_val; - str st = { print_buff, 0 }; -- str body = { 0, 0 }; -+ str body = { NULL, 0 }, tbody; - - handle = curl_easy_init(); - if (!handle) { -@@ -114,10 +114,11 @@ int rest_get_method(struct sip_msg *msg, char *url, - goto error; - } - -- trim(&body); -+ tbody = body; -+ trim(&tbody); - - pv_val.flags = PV_VAL_STR; -- pv_val.rs = body; -+ pv_val.rs = tbody; - - if (pv_set_value(msg, body_pv, 0, &pv_val) != 0) { - LM_ERR("Set body pv value failed!\n"); -@@ -163,7 +164,7 @@ int rest_post_method(struct sip_msg *msg, char *url, char *ctype, char *body, - long http_rc; - struct curl_slist *list = NULL; - str st = { print_buff, 0 }; -- str res_body = { 0, 0 }; -+ str res_body = { NULL, 0 }, tbody; - pv_value_t pv_val; - - handle = curl_easy_init(); -@@ -229,10 +230,11 @@ int rest_post_method(struct sip_msg *msg, char *url, char *ctype, char *body, - goto error; - } - -- trim(&res_body); -+ tbody = res_body; -+ trim(&tbody); - - pv_val.flags = PV_VAL_STR; -- pv_val.rs = res_body; -+ pv_val.rs = tbody; - - if (pv_set_value(msg, body_pv, 0, &pv_val) != 0) { - LM_ERR("Set body pv value failed!\n"); diff --git a/opensips-0033-flatstore-escape-delimiter.patch b/opensips-0033-flatstore-escape-delimiter.patch deleted file mode 100644 index 1a41128..0000000 --- a/opensips-0033-flatstore-escape-delimiter.patch +++ /dev/null @@ -1,145 +0,0 @@ -From: Razvan Crainea -Date: Wed, 21 May 2014 20:13:44 +0300 -Subject: [PATCH] flatstore: escape delimiter - -(cherry picked from commit 7b5ce3909ac4d4b0002454129ed3cb654e9de279) - -diff --git a/modules/db_flatstore/flatstore.c b/modules/db_flatstore/flatstore.c -index 58eb53d..60d707a 100644 ---- a/modules/db_flatstore/flatstore.c -+++ b/modules/db_flatstore/flatstore.c -@@ -264,6 +264,41 @@ static int flat_prepare_iovec(const int n) - FLAT_INC(aux.len); \ - } while(0) - -+#define FLAT_COPY(_i, _s, _l) \ -+ do { \ -+ str aux; \ -+ int len = 0; \ -+ int l = _l; \ -+ const char *s = _s; \ -+ const char *p = _s; \ -+ while (l--) { \ -+ if ( !(isprint((int)*s) && *s != '\\' && *s != flat_delimiter[0])) { \ -+ aux.len = snprintf(FLAT_BUF, FLAT_LEN,"%.*s\\x%02X", \ -+ (int)(s-p),p,(*s & 0xff)); \ -+ p = s+1; \ -+ if (aux.len < 0) { \ -+ LM_ERR("error while writing blob %d\n", i); \ -+ aux.len = 0; \ -+ } \ -+ len += aux.len; \ -+ FLAT_INC(aux.len); \ -+ } \ -+ ++s; \ -+ } \ -+ if (p!=s) { \ -+ aux.len = snprintf(FLAT_BUF, FLAT_LEN,"%.*s", (int)(s-p), p); \ -+ if (aux.len < 0) { \ -+ LM_ERR("error while writing blob %d\n", i); \ -+ aux.len = 0; \ -+ } \ -+ len += aux.len; \ -+ FLAT_INC(aux.len); \ -+ } \ -+ FLAT_SET_LEN(i, len); \ -+ } while (0) -+ -+ -+ - - /* - * Insert a row into specified table -@@ -277,9 +312,8 @@ int flat_db_insert(const db_con_t* h, const db_key_t* k, const db_val_t* v, - { - FILE* f; - int i; -- int l, len; -+ int auxl; - str aux; -- char *s, *p; - char * begin = flat_iov_buf.s; - - if (local_timestamp < *flat_rotate) { -@@ -326,13 +360,14 @@ int flat_db_insert(const db_con_t* h, const db_key_t* k, const db_val_t* v, - break; - - case DB_STRING: -- FLAT_SET_STR(i, (char *)VAL_STRING(v + i)); -- FLAT_SET_LEN(i, strlen(VAL_STRING(v + i))); -+ auxl = strlen(VAL_STRING(v + i)); -+ FLAT_ALLOC(auxl * 4); -+ FLAT_COPY(i, VAL_STRING(v + i), auxl); - break; - - case DB_STR: -- FLAT_SET_STR(i, VAL_STR(v + i).s); -- FLAT_SET_LEN(i, VAL_STR(v + i).len); -+ FLAT_ALLOC(VAL_STR(v + i).len * 4); -+ FLAT_COPY(i, VAL_STR(v + i).s, VAL_STR(v + i).len); - break; - - case DB_DATETIME: -@@ -342,35 +377,10 @@ int flat_db_insert(const db_con_t* h, const db_key_t* k, const db_val_t* v, - break; - - case DB_BLOB: -- l = VAL_BLOB(v+i).len; -- s = p = VAL_BLOB(v+i).s; -+ auxl = VAL_BLOB(v+i).len; - /* the maximum size is 4l - if all chars were not printable */ -- FLAT_ALLOC(4 * l); -- len = 0; -- while (l--) { -- if ( !(isprint((int)*s) && *s != '\\' && *s != '|')) { -- aux.len = snprintf(FLAT_BUF, FLAT_LEN,"%.*s\\x%02X", -- (int)(s-p),p,(*s & 0xff)); -- p = s+1; -- if (aux.len < 0) { -- LM_ERR("error while writing blob %d\n", i); -- aux.len = 0; -- } -- len += aux.len; -- FLAT_INC(aux.len); -- } -- ++s; -- } -- if (p!=s) { -- aux.len = snprintf(FLAT_BUF, FLAT_LEN,"%.*s", (int)(s-p), p); -- if (aux.len < 0) { -- LM_ERR("error while writing blob %d\n", i); -- aux.len = 0; -- } -- len += aux.len; -- FLAT_INC(aux.len); -- } -- FLAT_SET_LEN(i, len); -+ FLAT_ALLOC(4 * auxl); -+ FLAT_COPY(i, VAL_BLOB(v+i).s, auxl); - break; - - case DB_BITMAP: -@@ -384,8 +394,7 @@ int flat_db_insert(const db_con_t* h, const db_key_t* k, const db_val_t* v, - if (flat_iov_buf.s != begin && flat_iov_buf.len) { - FLAT_RESET(); - for (i = 0; i < n; i++) { -- if (!VAL_NULL(v + i) && VAL_TYPE(v + i) != DB_STRING && -- VAL_TYPE(v + i) != DB_STR) { -+ if (!VAL_NULL(v + i)) { - FLAT_SET_STR(i, FLAT_BUF); - FLAT_INC(FLAT_GET_LEN(i)); - } -@@ -393,10 +402,10 @@ int flat_db_insert(const db_con_t* h, const db_key_t* k, const db_val_t* v, - } - - do { -- l = writev(fileno(f), flat_iov, 2 * n); -- } while (l < 0 && errno == EINTR); -+ auxl = writev(fileno(f), flat_iov, 2 * n); -+ } while (auxl < 0 && errno == EINTR); - -- if (l < 0) { -+ if (auxl < 0) { - LM_ERR("unable to write to file: %s - %d\n", strerror(errno), errno); - return -1; - } diff --git a/opensips-0034-Fix-db_url-setting-do-not-make-it-mandatory-if-no-db.patch b/opensips-0034-Fix-db_url-setting-do-not-make-it-mandatory-if-no-db.patch deleted file mode 100644 index 695190a..0000000 --- a/opensips-0034-Fix-db_url-setting-do-not-make-it-mandatory-if-no-db.patch +++ /dev/null @@ -1,93 +0,0 @@ -From: Bogdan-Andrei Iancu -Date: Fri, 22 Jul 2016 13:11:03 +0300 -Subject: [PATCH] Fix db_url setting - do not make it mandatory if no db is - used - - -diff --git a/modules/siptrace/siptrace.c b/modules/siptrace/siptrace.c -index 54d5217..422f062 100644 ---- a/modules/siptrace/siptrace.c -+++ b/modules/siptrace/siptrace.c -@@ -267,7 +267,6 @@ static int mod_init(void) - pv_spec_t avp_spec; - int i; - -- init_db_url( db_url , 0 /*cannot be null*/); - siptrace_table.len = strlen(siptrace_table.s); - date_column.len = strlen(date_column.s); - callid_column.len = strlen(callid_column.s); -@@ -298,21 +297,22 @@ static int mod_init(void) - return -1; - - trace_to_database_flag = (int*)shm_malloc(sizeof(int)); -- if(trace_to_database_flag==NULL) { -- LM_ERR("no more shm memory left\n"); -- return -1; -- } -+ if(trace_to_database_flag==NULL) { -+ LM_ERR("no more shm memory left\n"); -+ return -1; -+ } - - *trace_to_database_flag = trace_to_database; - -- if(trace_to_database_flag!=NULL && *trace_to_database_flag!=0) { -+ if(*trace_to_database_flag!=0) { -+ init_db_url( db_url , 0 /*cannot be null*/); - /* Find a database module */ - if (db_bind_mod(&db_url, &db_funcs)) - { - LM_ERR("unable to bind database module\n"); - return -1; - } -- if (trace_to_database_flag && !DB_CAPABILITY(db_funcs, DB_CAP_INSERT)) -+ if (!DB_CAPABILITY(db_funcs, DB_CAP_INSERT)) - { - LM_ERR("database modules does not provide all functions needed by module\n"); - return -1; -@@ -555,7 +555,7 @@ static int save_siptrace(struct sip_msg *msg,struct usr_avp *avp, - db_vals[0].val.blob_val.len); - - -- if(trace_to_database_flag!=NULL && *trace_to_database_flag!=0) { -+ if(*trace_to_database_flag!=0) { - LM_DBG("saving siptrace\n"); - db_funcs.use_table(db_con, siptrace_get_table()); - -@@ -576,7 +576,7 @@ static int save_siptrace(struct sip_msg *msg,struct usr_avp *avp, - static int child_init(int rank) - { - -- if(trace_to_database_flag!=NULL && *trace_to_database_flag!=0) { -+ if(*trace_to_database_flag!=0) { - db_con = db_funcs.init(&db_url); - if (!db_con) - { -@@ -1565,21 +1565,17 @@ static struct mi_root* trace_to_database_mi (struct mi_root* cmd_tree, void* par - } - return rpl_tree ; - } -- if(trace_to_database_flag==NULL) -- return init_mi_tree( 500, MI_SSTR(MI_INTERNAL_ERR)); - - if ( node->value.len==2 && - (node->value.s[0]=='o'|| node->value.s[0]=='O') && - (node->value.s[1]=='n'|| node->value.s[1]=='N')) - { -- if (db_con!=NULL) { -- *trace_to_database_flag = 1; -- return init_mi_tree( 200, MI_SSTR(MI_OK)); -- } -- else { -- return init_mi_tree( 501, MI_SSTR(MI_INTERNAL_ERR)); -- } -- -+ if (db_con!=NULL) { -+ *trace_to_database_flag = 1; -+ return init_mi_tree( 200, MI_SSTR(MI_OK)); -+ } else { -+ return init_mi_tree( 501, MI_SSTR(MI_INTERNAL_ERR)); -+ } - } else if ( node->value.len==3 && - (node->value.s[0]=='o'|| node->value.s[0]=='O') && - (node->value.s[1]=='f'|| node->value.s[1]=='F') && diff --git a/opensips-0035-fix-pthread_mutex-should-be-process-shared.patch b/opensips-0035-fix-pthread_mutex-should-be-process-shared.patch deleted file mode 100644 index 7a7c1f2..0000000 --- a/opensips-0035-fix-pthread_mutex-should-be-process-shared.patch +++ /dev/null @@ -1,49 +0,0 @@ -From: wxf -Date: Tue, 26 Jul 2016 16:33:31 +0800 -Subject: [PATCH] fix: pthread_mutex should be process-shared - - -diff --git a/Makefile.defs b/Makefile.defs -index 1a5b0bb..9bc4470 100644 ---- a/Makefile.defs -+++ b/Makefile.defs -@@ -1466,6 +1466,9 @@ ifeq ($(OS), linux) - DEFS+= -DUSE_POSIX_SEM # try posix sems - found_lock_method=yes - endif -+ ifneq (,$(findstring USE_PTHREAD_MUTEX, $(DEFS))) -+ LIBS += -pthread -+ endif - # check for >= 2.5.44 - ifeq ($(shell [ $(OSREL_N) -ge 2005044 ] && echo has_epoll), has_epoll) - ifeq ($(NO_EPOLL),) -diff --git a/lock_ops.h b/lock_ops.h -index 9102374..5453e10 100644 ---- a/lock_ops.h -+++ b/lock_ops.h -@@ -100,8 +100,23 @@ typedef pthread_mutex_t gen_lock_t; - - inline static gen_lock_t* lock_init(gen_lock_t* lock) - { -- if (pthread_mutex_init(lock, 0)==0) return lock; -- else return 0; -+ pthread_mutexattr_t attr; -+ -+ if (pthread_mutexattr_init(&attr) != 0) -+ return 0; -+ -+ if (pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED) != 0) { -+ pthread_mutexattr_destroy(&attr); -+ return 0; -+ } -+ -+ if (pthread_mutex_init(lock, &attr) != 0) { -+ pthread_mutexattr_destroy(&attr); -+ return 0; -+ } -+ -+ pthread_mutexattr_destroy(&attr); -+ return lock; - } - - #define lock_get(lock) pthread_mutex_lock(lock) diff --git a/opensips-0036-Fix-bug-in-evaluating-the-port-spec-in-lb_count_call.patch b/opensips-0036-Fix-bug-in-evaluating-the-port-spec-in-lb_count_call.patch deleted file mode 100644 index 2bcba76..0000000 --- a/opensips-0036-Fix-bug-in-evaluating-the-port-spec-in-lb_count_call.patch +++ /dev/null @@ -1,27 +0,0 @@ -From: Bogdan-Andrei Iancu -Date: Fri, 5 Aug 2016 13:12:18 +0300 -Subject: [PATCH] Fix bug in evaluating the port spec in lb_count_call - -(cherry picked from commit e7319c1c8eb5632da28a5c1971b6fa9f7495df89) - -diff --git a/modules/load_balancer/load_balancer.c b/modules/load_balancer/load_balancer.c -index 4238f26..9c747b8 100644 ---- a/modules/load_balancer/load_balancer.c -+++ b/modules/load_balancer/load_balancer.c -@@ -612,15 +612,10 @@ static int w_count_call(struct sip_msg *req, char *ip, char *port, char *grp, - - /* get the port */ - if (port) { -- if (pv_get_spec_value( req, (pv_spec_t*)port, &val)!=0) { -+ if (fixup_get_ivalue( req, (gparam_p)port, &port_no)!=0) { - LM_ERR("failed to get PORT value from PV\n"); - return -1; - } -- if ( (val.flags&PV_VAL_INT)==0 ) { -- LM_ERR("PORT PV val is not integer\n"); -- return -1; -- } -- port_no = val.ri; - } else { - port_no = 0; - } diff --git a/opensips-0037-Do-not-delete-any-internal-AVP-if-C-flag-is-used.patch b/opensips-0037-Do-not-delete-any-internal-AVP-if-C-flag-is-used.patch deleted file mode 100644 index 0268eed..0000000 --- a/opensips-0037-Do-not-delete-any-internal-AVP-if-C-flag-is-used.patch +++ /dev/null @@ -1,48 +0,0 @@ -From: Bogdan-Andrei Iancu -Date: Wed, 17 Aug 2016 18:04:24 +0300 -Subject: [PATCH] Do not delete any internal AVP if "C" flag is used. - -When calling do_routing() with "C" flag (only check the prefix, without actually doing any routing), do not remove any AVP (in the beginning) as we do not add any (after prefix matching) -> no adding, so no deleting. -This allows you to safely call do_routing("C") while looping throuhg the GWs of another do_routing(). - -diff --git a/modules/drouting/drouting.c b/modules/drouting/drouting.c -index a78d02d..0e24765 100644 ---- a/modules/drouting/drouting.c -+++ b/modules/drouting/drouting.c -@@ -1542,20 +1542,22 @@ static int do_routing(struct sip_msg* msg, dr_group_t *drg, int flags, - goto error1; - } - -- /* do some cleanup first */ -- destroy_avps( 0, ruri_avp, 1); -- destroy_avps( 0, gw_id_avp, 1); -- destroy_avps( 0, gw_sock_avp, 1); -- destroy_avps( 0, rule_attrs_avp, 1); -- destroy_avps( 0, gw_attrs_avp, 1); -- destroy_avps( 0, carrier_attrs_avp, 1); -- -- if (gw_priprefix_avp!=-1) -- destroy_avps( 0, gw_priprefix_avp, 1); -- if (rule_id_avp!=-1) -- destroy_avps( 0, rule_id_avp, 1); -- if (rule_prefix_avp!=-1) -- destroy_avps( 0, rule_prefix_avp, 1); -+ /* do some cleanup first (if without the CHECK_ONLY flag) */ -+ if ((flags & DR_PARAM_ONLY_CHECK) == 0) { -+ destroy_avps( 0, ruri_avp, 1); -+ destroy_avps( 0, gw_id_avp, 1); -+ destroy_avps( 0, gw_sock_avp, 1); -+ destroy_avps( 0, rule_attrs_avp, 1); -+ destroy_avps( 0, gw_attrs_avp, 1); -+ destroy_avps( 0, carrier_attrs_avp, 1); -+ -+ if (gw_priprefix_avp!=-1) -+ destroy_avps( 0, gw_priprefix_avp, 1); -+ if (rule_id_avp!=-1) -+ destroy_avps( 0, rule_id_avp, 1); -+ if (rule_prefix_avp!=-1) -+ destroy_avps( 0, rule_prefix_avp, 1); -+ } - - if ( !(flags & DR_PARAM_INTERNAL_TRIGGERED) ) { - /* not internally triggered, so get data from SIP msg */ diff --git a/opensips-0038-Fix-calling-trace_dialog-after-t_newtran.patch b/opensips-0038-Fix-calling-trace_dialog-after-t_newtran.patch deleted file mode 100644 index 636900a..0000000 --- a/opensips-0038-Fix-calling-trace_dialog-after-t_newtran.patch +++ /dev/null @@ -1,35 +0,0 @@ -From: Bogdan-Andrei Iancu -Date: Wed, 17 Aug 2016 18:45:49 +0300 -Subject: [PATCH] Fix calling trace_dialog() after t_newtran(). - -The tracing relies on the REQUEST_IN callback - and this callback is triggered by t_newtran() before we decide (at script level) to do any tracing, so it will a try triggering (with no action). -The fix is to check (in trace_dialog()) if the tranaction exists (meaning the REQUEST_IN callback was already triggered) and if so, we trigger it again after setting all the tracing flags (to force the callback to actually do the job). - -diff --git a/modules/siptrace/siptrace.c b/modules/siptrace/siptrace.c -index 422f062..1678220 100644 ---- a/modules/siptrace/siptrace.c -+++ b/modules/siptrace/siptrace.c -@@ -680,6 +680,8 @@ static int trace_dialog(struct sip_msg *msg) - struct usr_avp *avp; - static int_str avp_value; - str *name; -+ struct cell *t; -+ struct tmcb_params ps; - - if (!msg) { - LM_ERR("no msg specified\n"); -@@ -744,6 +746,14 @@ static int trace_dialog(struct sip_msg *msg) - /* trace current request */ - sip_trace(msg); - -+ /* if transaction is found already created, it means our REQUEST_IN -+ tm callback was triggered dry (we did not do anything as no -+ tracing was set at that time) -> let's do this again now */ -+ if ((t = tmb.t_gett())) { -+ ps.req = msg; -+ trace_onreq_in(t, TMCB_REQUEST_IN, &ps); -+ } -+ - do_dlg_siptrace=1; - return 1; - } diff --git a/opensips.spec b/opensips.spec index df182b7..d211071 100644 --- a/opensips.spec +++ b/opensips.spec @@ -4,7 +4,7 @@ Summary: Open Source SIP Server Name: opensips -Version: 1.11.8 +Version: 1.11.9 Release: 1%{?dist} License: GPLv2+ Group: System Environment/Daemons @@ -32,27 +32,7 @@ Patch16: opensips-0016-Better-err-logging.patch Patch17: opensips-0017-Make-rtpengine-retry-sending-command-on-UDP-fragment.patch # These patches were taken from origin/1.11 branch -Patch18: opensips-0018-Fix-potential-100-Trying-duplicates.patch -Patch19: opensips-0019-Fix-script-varibles-for-providing-port-and-proto-as-.patch -Patch20: opensips-0020-Fix-undefined-function.patch -Patch21: opensips-0021-Fix-dialplan-module-when-using-db_text-backend.patch -Patch22: opensips-0022-permissions-fix-get_source_group-return.patch -Patch23: opensips-0023-acc-Fix-incorrect-Request-URI-handling.patch -Patch24: opensips-0024-Fix-error-message-when-a-route-is-not-defined.patch -Patch25: opensips-0025-dialog-advance-to-next-cell-in-case-of-error.patch -Patch26: opensips-0026-acc-bugfix-check-if-database-loaded-before-using-its.patch -Patch27: opensips-0027-Fix-populating-blacklists.patch -Patch28: opensips-0028-Fix-populating-blacklists.patch -Patch29: opensips-0029-Fix-populating-blacklists.patch -Patch30: opensips-0030-Fix-advertised-port-and-address-per-branch.patch -Patch31: opensips-0031-Fix-building-Via-Branch-in-stateless-mode.patch -Patch32: opensips-0032-rest_client-Fix-incorrect-trim-operation.patch -Patch33: opensips-0033-flatstore-escape-delimiter.patch -Patch34: opensips-0034-Fix-db_url-setting-do-not-make-it-mandatory-if-no-db.patch -Patch35: opensips-0035-fix-pthread_mutex-should-be-process-shared.patch -Patch36: opensips-0036-Fix-bug-in-evaluating-the-port-spec-in-lb_count_call.patch -Patch37: opensips-0037-Do-not-delete-any-internal-AVP-if-C-flag-is-used.patch -Patch38: opensips-0038-Fix-calling-trace_dialog-after-t_newtran.patch +# -= none =- URL: https://opensips.org @@ -715,28 +695,6 @@ rm -f modules/db_oracle/asynch.h %patch16 -p1 %patch17 -p1 -%patch18 -p1 -%patch19 -p1 -%patch20 -p1 -%patch21 -p1 -%patch22 -p1 -%patch23 -p1 -%patch24 -p1 -%patch25 -p1 -%patch26 -p1 -%patch27 -p1 -%patch28 -p1 -%patch29 -p1 -%patch30 -p1 -%patch31 -p1 -%patch32 -p1 -%patch33 -p1 -%patch34 -p1 -%patch35 -p1 -%patch36 -p1 -%patch37 -p1 -%patch38 -p1 - %build LOCALBASE=/usr NICER=0 CFLAGS="%{optflags} -fgnu89-inline" LDFLAGS="%{?__global_ldflags}" %{?_with_oracle:ORAHOME="$ORACLE_HOME"} %{__make} all %{?_smp_mflags} TLS=1 \ exclude_modules="%EXCLUDE_MODULES" \ @@ -1296,6 +1254,9 @@ useradd -r -g %{name} -d %{_localstatedir}/run/%{name} -s /sbin/nologin \ %doc docdir/README.xmpp %changelog +* Thu Oct 20 2016 Peter Lemenkov - 1.11.9-1 +- Ver. 1.11.9 + * Tue Sep 6 2016 Peter Lemenkov - 1.11.8-1 - Ver. 1.11.8 - Switch to freeradius-client from radiusclient-ng diff --git a/sources b/sources index d1db3b5..8932462 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -0d517ed8b148b74d5cf4162f71c83652 opensips-1.11.8.tar.gz +f6ff8834f1ad824b399ef4e24a155586 opensips-1.11.9.tar.gz