Update and correct to vendor version, removing deprecated module logic.

Thu, 01 Dec 2011 13:33:32 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 01 Dec 2011 13:33:32 +0100
changeset 397
c98ae03f4266
parent 396
610cba0674b9
child 398
08f5eb82b58f

Update and correct to vendor version, removing deprecated module logic.

opensips/opensips.cfg file | annotate | diff | comparison | revisions
opensips/opensips.patch file | annotate | diff | comparison | revisions
opensips/opensips.patch.lcr file | annotate | diff | comparison | revisions
opensips/opensips.patch.reg file | annotate | diff | comparison | revisions
opensips/opensips.patch.uac file | annotate | diff | comparison | revisions
opensips/opensips.spec file | annotate | diff | comparison | revisions
opensips/opensipsctlrc file | annotate | diff | comparison | revisions
opensips/osipsconsolerc file | annotate | diff | comparison | revisions
     1.1 --- a/opensips/opensips.cfg	Thu Dec 01 13:24:24 2011 +0100
     1.2 +++ b/opensips/opensips.cfg	Thu Dec 01 13:33:32 2011 +0100
     1.3 @@ -115,7 +115,6 @@
     1.4  modparam("usrloc|uri|auth_db", "db_url", "text://@l_prefix@/var/opensips/db")
     1.5  
     1.6  # ----- rr params -----
     1.7 -modparam("rr", "enable_full_lr", 1)  # add value to ;lr param for broken UAs
     1.8  modparam("rr", "append_fromtag", 1)  # important when using detect_direction
     1.9  
    1.10  # ----- usrloc params -----
    1.11 @@ -130,7 +129,6 @@
    1.12  modparam("acc", "db_url", "dbtext://@l_prefix@/var/opensips/db")
    1.13  #modparam("acc", "db_url", "flatstore:@l_prefix@/var/opensips/acc")
    1.14  modparam("acc", "early_media", 1)
    1.15 -modparam("acc", "report_ack", 1)
    1.16  modparam("acc", "report_cancels", 1)
    1.17  modparam("acc", "detect_direction", 1)
    1.18  modparam("acc", "log_level", 2)
     2.1 --- a/opensips/opensips.patch	Thu Dec 01 13:24:24 2011 +0100
     2.2 +++ b/opensips/opensips.patch	Thu Dec 01 13:33:32 2011 +0100
     2.3 @@ -2,7 +2,7 @@
     2.4  diff -Nau main.c.orig main.c
     2.5  --- main.c.orig	2009-12-10 14:11:03.590141302 +0100
     2.6  +++ main.c	2009-12-10 14:11:07.246237908 +0100
     2.7 -@@ -952,6 +952,10 @@
     2.8 +@@ -1038,6 +1038,10 @@
     2.9   	ret=-1;
    2.10   	my_argc=argc; my_argv=argv;
    2.11   
    2.12 @@ -13,7 +13,7 @@
    2.13   	/*init pkg mallocs (before parsing cfg or cmd line !)*/
    2.14   	if (init_pkg_mallocs()==-1)
    2.15   		goto error00;
    2.16 -@@ -1284,6 +1288,11 @@
    2.17 +@@ -1370,6 +1374,11 @@
    2.18   
    2.19   	/* init_daemon? */
    2.20   	if (!dont_fork){
    2.21 @@ -29,7 +29,7 @@
    2.22  diff -Nau Makefile.defs.orig Makefile.defs
    2.23  --- Makefile.defs.orig	2007-12-13 14:39:06.000000000 +0100
    2.24  +++ Makefile.defs	2008-01-14 16:48:02.811615000 +0100
    2.25 -@@ -216,7 +216,7 @@
    2.26 +@@ -220,7 +220,7 @@
    2.27   else
    2.28   	doc-dir = doc/$(MAIN_NAME)/
    2.29   	man-dir = man/
    2.30 @@ -38,7 +38,7 @@
    2.31   	LOCALBASE ?= $(SYSBASE)/local
    2.32   endif
    2.33   endif
    2.34 -@@ -1427,6 +1427,10 @@
    2.35 +@@ -1432,6 +1432,10 @@
    2.36   LIBS+= -lsctp
    2.37   endif
    2.38   
    2.39 @@ -74,7 +74,7 @@
    2.40   use IO::Socket;
    2.41   use Socket;
    2.42   #use Net::IP;
    2.43 -@@ -396,6 +395,12 @@
    2.44 +@@ -378,6 +377,12 @@
    2.45   			}		
    2.46   		}
    2.47   
    2.48 @@ -119,17 +119,17 @@
    2.49  diff -Nau modules/nathelper/nathelper.c.orig modules/nathelper/nathelper.c
    2.50  --- modules/nathelper/nathelper.c.orig	2010-12-20 14:33:50.000000000 +0100
    2.51  +++ modules/nathelper/nathelper.c	2011-01-26 17:48:40.685941382 +0100
    2.52 -@@ -273,6 +273,9 @@
    2.53 - #define MI_RECHECK_TICKS			"recheck_ticks"
    2.54 - #define MI_RECHECK_T_LEN			(sizeof(MI_RECHECK_TICKS)-1)
    2.55 +@@ -288,6 +288,9 @@
    2.56 + 	return 0;
    2.57 + }
    2.58   
    2.59  +/* MSvB macros */
    2.60  +#define OPENSIPS_NOOP ((void)0)
    2.61  +
    2.62   
    2.63   
    2.64 - /* Supported version of the RTP proxy command protocol */
    2.65 -@@ -1921,6 +1925,7 @@
    2.66 + 
    2.67 +@@ -805,6 +808,7 @@
    2.68   #define	FIX_MEDIP	0x02
    2.69   #define	ADD_ANORTPPROXY	0x04
    2.70   #define	FIX_ORGIP	0x08
    2.71 @@ -137,20 +137,7 @@
    2.72   
    2.73   #define	ADIRECTION	"a=direction:active"
    2.74   #define	ADIRECTION_LEN	(sizeof(ADIRECTION) - 1)
    2.75 -@@ -2050,6 +2055,12 @@
    2.76 - 			return -1;
    2.77 - 	}
    2.78 - 
    2.79 -+	if (level & FIX_RTCPIP) {
    2.80 -+		/* Iterate all a=rtcp: and replace ips in them. */
    2.81 -+		if (replace_sdp_ip(msg, &body, "a=rtcp:", str2?&ip:0)==-1)
    2.82 -+			return -1;
    2.83 -+	}
    2.84 -+
    2.85 - 	return 1;
    2.86 - }
    2.87 - 
    2.88 -@@ -2215,7 +2226,9 @@
    2.89 +@@ -821,7 +825,9 @@
    2.90   {
    2.91   	char *buf;
    2.92   	int offset;
    2.93 @@ -160,14 +147,14 @@
    2.94   	str omip, nip, oip;
    2.95   
    2.96   	/* check that updating mediaip is really necessary */
    2.97 -@@ -2246,7 +2259,19 @@
    2.98 +@@ -852,7 +858,19 @@
    2.99   		memcpy(buf, CRLF, CRLF_LEN);
   2.100   		memcpy(buf + CRLF_LEN, omip.s, omip.len);
   2.101   		memcpy(buf + CRLF_LEN + omip.len, oldip->s, oldip->len);
   2.102  -		if (insert_new_lump_after(anchor, buf,
   2.103  +
   2.104 -+       /* if the oldmediaip string is already */
   2.105 -+       /* in the body then don't add it again */
   2.106 ++		/* if the oldmediaip string is already */
   2.107 ++		/* in the body then don't add it again */
   2.108  +		binlump = 0;
   2.109  +		for (templump = msg->body_lumps; templump; templump = templump->next)
   2.110  +			if (templump->op == LUMP_ADD && strstr(templump->u.value, buf))
   2.111 @@ -181,6 +168,19 @@
   2.112   		    omip.len + oldip->len + CRLF_LEN, 0) == NULL) {
   2.113   			LM_ERR("insert_new_lump_after failed\n");
   2.114   			pkg_free(buf);
   2.115 +@@ -1038,6 +1056,12 @@
   2.116 + 		p= p->next;
   2.117 + 	}
   2.118 + 
   2.119 ++	if (level & FIX_RTCPIP) {
   2.120 ++		/* Iterate all a=rtcp: and replace ips in them. */
   2.121 ++		if (replace_sdp_ip(msg, &body, "a=rtcp:", str2?&ip:0)==-1)
   2.122 ++			return -1;
   2.123 ++	}
   2.124 ++
   2.125 + 	return 1;
   2.126 + }
   2.127 + 
   2.128  Index: parser/sdp/sdp_helpr_funcs.c
   2.129  diff -Nau parser/sdp/sdp_helpr_funcs.c.orig parser/sdp/sdp_helpr_funcs.c
   2.130  --- parser/sdp/sdp_helpr_funcs.c.orig	2010-12-08 15:14:06.000000000 +0100
     3.1 --- a/opensips/opensips.patch.lcr	Thu Dec 01 13:24:24 2011 +0100
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,384 +0,0 @@
     3.4 -Index: modules/lcr/lcr_mod.c
     3.5 -diff -Nau modules/lcr/lcr_mod.c.orig modules/lcr/lcr_mod.c
     3.6 ---- modules/lcr/lcr_mod.c.orig	2009-03-09 14:42:46.000000000 +0100
     3.7 -+++ modules/lcr/lcr_mod.c	2009-03-24 22:50:37.363366116 +0100
     3.8 -@@ -114,9 +114,18 @@
     3.9 - 
    3.10 - #define PRIORITY_COL "priority"
    3.11 - 
    3.12 -+#define USER_COL "usid"
    3.13 -+
    3.14 -+#define REALM_COL "realm"
    3.15 -+
    3.16 -+#define PASSWD_COL "passwd"
    3.17 -+
    3.18 - #define MAX_NO_OF_GWS 32
    3.19 - #define MAX_NO_OF_LCRS 256
    3.20 - #define MAX_PREFIX_LEN 256
    3.21 -+#define MAX_USER_LEN 64
    3.22 -+#define MAX_REALM_LEN 64
    3.23 -+#define MAX_PASSWD_LEN 64
    3.24 - #define MAX_TAG_LEN 16
    3.25 - #define MAX_FROM_URI_LEN 256
    3.26 - 
    3.27 -@@ -141,6 +150,12 @@
    3.28 -     char tag[MAX_TAG_LEN + 1];
    3.29 -     unsigned short tag_len;
    3.30 -     unsigned int flags;
    3.31 -+    char user[MAX_USER_LEN];
    3.32 -+    unsigned short user_len;
    3.33 -+    char realm[MAX_REALM_LEN];
    3.34 -+    unsigned short realm_len;
    3.35 -+    char passwd[MAX_PASSWD_LEN];
    3.36 -+    unsigned short passwd_len;
    3.37 - };
    3.38 - 
    3.39 - struct lcr_info {
    3.40 -@@ -196,6 +211,9 @@
    3.41 - static str prefix_col       = str_init(PREFIX_COL);
    3.42 - static str from_uri_col     = str_init(FROM_URI_COL);
    3.43 - static str priority_col     = str_init(PRIORITY_COL);
    3.44 -+static str user_col         = str_init(USER_COL);
    3.45 -+static str realm_col        = str_init(REALM_COL);
    3.46 -+static str passwd_col       = str_init(PASSWD_COL);
    3.47 - 
    3.48 - /* timer */
    3.49 - int fr_inv_timer      = DEF_FR_INV_TIMER;
    3.50 -@@ -208,6 +226,9 @@
    3.51 - static char *contact_avp_param = NULL;
    3.52 - static char *rpid_avp_param = NULL;
    3.53 - static char *flags_avp_param = NULL;
    3.54 -+static char *user_avp_param = NULL;
    3.55 -+static char *realm_avp_param = NULL;
    3.56 -+static char *passwd_avp_param = NULL;
    3.57 - 
    3.58 - /* prefix mode */
    3.59 - int prefix_mode_param = DEF_PREFIX_MODE;
    3.60 -@@ -239,6 +260,12 @@
    3.61 - static int_str rpid_avp;
    3.62 - static int     flags_avp_type;
    3.63 - static int_str flags_avp;
    3.64 -+static int     user_avp_type;
    3.65 -+static int_str user_avp;
    3.66 -+static int     realm_avp_type;
    3.67 -+static int_str realm_avp;
    3.68 -+static int     passwd_avp_type;
    3.69 -+static int_str passwd_avp;
    3.70 - 
    3.71 - struct gw_info **gws;	/* Pointer to current gw table pointer */
    3.72 - struct gw_info *gws_1;	/* Pointer to gw table 1 */
    3.73 -@@ -327,6 +354,12 @@
    3.74 - 	{"fr_inv_timer",             INT_PARAM, &fr_inv_timer },
    3.75 - 	{"fr_inv_timer_next",        INT_PARAM,	&fr_inv_timer_next },
    3.76 - 	{"prefix_mode",              INT_PARAM, &prefix_mode_param },
    3.77 -+	{"user_column",              STR_PARAM, &user_col.s },
    3.78 -+	{"realm_column",             STR_PARAM, &realm_col.s },
    3.79 -+	{"passwd_column",            STR_PARAM, &passwd_col.s },
    3.80 -+	{"auth_username_avp",        STR_PARAM, &user_avp_param },
    3.81 -+	{"auth_realm_avp",           STR_PARAM, &realm_avp_param },
    3.82 -+	{"auth_password_avp",        STR_PARAM, &passwd_avp_param },
    3.83 - 	{0, 0, 0}
    3.84 - };
    3.85 - 
    3.86 -@@ -438,6 +471,9 @@
    3.87 -     prefix_col.len = strlen(prefix_col.s);
    3.88 -     from_uri_col.len = strlen(from_uri_col.s);
    3.89 -     priority_col.len = strlen(priority_col.s);
    3.90 -+    user_col.len = strlen(user_col.s);
    3.91 -+    realm_col.len = strlen(realm_col.s);
    3.92 -+    passwd_col.len = strlen(passwd_col.s);
    3.93 - 
    3.94 -     /* Bind database */
    3.95 -     if (lcr_db_bind(&db_url)) {
    3.96 -@@ -563,6 +599,60 @@
    3.97 - 	return -1;
    3.98 -     }
    3.99 - 
   3.100 -+	if (user_avp_param && *user_avp_param) {
   3.101 -+	s.s = user_avp_param; s.len = strlen(s.s);
   3.102 -+	if (pv_parse_spec(&s, &avp_spec)==0
   3.103 -+	    || avp_spec.type!=PVT_AVP) {
   3.104 -+	    LM_ERR("Malformed or non AVP definition <%s>\n", user_avp_param);
   3.105 -+	    return -1;
   3.106 -+	}
   3.107 -+	
   3.108 -+	if(pv_get_avp_name(0, &(avp_spec.pvp), &user_avp, &avp_flags)!=0) {
   3.109 -+	    LM_ERR("Invalid AVP definition <%s>\n", user_avp_param);
   3.110 -+	    return -1;
   3.111 -+	}
   3.112 -+	user_avp_type = avp_flags;
   3.113 -+    } else {
   3.114 -+	LM_ERR("AVP user_avp has not been defined\n");
   3.115 -+	return -1;
   3.116 -+    }
   3.117 -+
   3.118 -+	if (realm_avp_param && *realm_avp_param) {
   3.119 -+	s.s = realm_avp_param; s.len = strlen(s.s);
   3.120 -+	if (pv_parse_spec(&s, &avp_spec)==0
   3.121 -+	    || avp_spec.type!=PVT_AVP) {
   3.122 -+	    LM_ERR("Malformed or non AVP definition <%s>\n", realm_avp_param);
   3.123 -+	    return -1;
   3.124 -+	}
   3.125 -+	
   3.126 -+	if(pv_get_avp_name(0, &(avp_spec.pvp), &realm_avp, &avp_flags)!=0) {
   3.127 -+	    LM_ERR("Invalid AVP definition <%s>\n", realm_avp_param);
   3.128 -+	    return -1;
   3.129 -+	}
   3.130 -+	realm_avp_type = avp_flags;
   3.131 -+    } else {
   3.132 -+	LM_ERR("AVP realm_avp has not been defined\n");
   3.133 -+	return -1;
   3.134 -+    }
   3.135 -+
   3.136 -+	if (passwd_avp_param && *passwd_avp_param) {
   3.137 -+	s.s = passwd_avp_param; s.len = strlen(s.s);
   3.138 -+	if (pv_parse_spec(&s, &avp_spec)==0
   3.139 -+	    || avp_spec.type!=PVT_AVP) {
   3.140 -+	    LM_ERR("Malformed or non AVP definition <%s>\n", passwd_avp_param);
   3.141 -+	    return -1;
   3.142 -+	}
   3.143 -+	
   3.144 -+	if(pv_get_avp_name(0, &(avp_spec.pvp), &passwd_avp, &avp_flags)!=0) {
   3.145 -+	    LM_ERR("Invalid AVP definition <%s>\n", passwd_avp_param);
   3.146 -+	    return -1;
   3.147 -+	}
   3.148 -+	passwd_avp_type = avp_flags;
   3.149 -+    } else {
   3.150 -+	LM_ERR("AVP passwd_avp has not been defined\n");
   3.151 -+	return -1;
   3.152 -+    }
   3.153 -+
   3.154 -     /* Check table version */
   3.155 - 	db_con_t* dbh;
   3.156 - 	if (lcr_dbf.init==0){
   3.157 -@@ -801,16 +891,17 @@
   3.158 - int reload_gws(void)
   3.159 - {
   3.160 -     unsigned int i, port, strip, tag_len, prefix_len, from_uri_len,
   3.161 --    grp_id, priority;
   3.162 -+    user_len, realm_len, passwd_len, grp_id, priority;
   3.163 -     struct in_addr ip_addr;
   3.164 -     unsigned int flags;
   3.165 -     uri_type scheme;
   3.166 -     uri_transport transport;
   3.167 -     db_con_t* dbh;
   3.168 -     char *tag, *prefix, *from_uri;
   3.169 -+    char *user, *realm, *passwd;
   3.170 -     db_res_t* res = NULL;
   3.171 -     db_row_t* row;
   3.172 --    db_key_t gw_cols[8];
   3.173 -+    db_key_t gw_cols[11];
   3.174 -     db_key_t lcr_cols[4];
   3.175 - 
   3.176 -     gw_cols[0] = &ip_addr_col;
   3.177 -@@ -823,6 +914,9 @@
   3.178 -        in the two tables? (ge vw lcr) */
   3.179 -     gw_cols[6] = &grp_id_col;
   3.180 -     gw_cols[7] = &flags_col;
   3.181 -+    gw_cols[8] = &user_col;
   3.182 -+    gw_cols[9] = &realm_col;
   3.183 -+    gw_cols[10] = &passwd_col;
   3.184 - 
   3.185 -     lcr_cols[0] = &prefix_col;
   3.186 -     lcr_cols[1] = &from_uri_col;
   3.187 -@@ -846,7 +940,7 @@
   3.188 - 	return -1;
   3.189 -     }
   3.190 - 
   3.191 --    if (lcr_dbf.query(dbh, NULL, 0, NULL, gw_cols, 0, 8, 0, &res) < 0) {
   3.192 -+    if (lcr_dbf.query(dbh, NULL, 0, NULL, gw_cols, 0, 11, 0, &res) < 0) {
   3.193 - 	    LM_ERR("Failed to query gw data\n");
   3.194 - 	    lcr_dbf.close(dbh);
   3.195 - 	    return -1;
   3.196 -@@ -938,6 +1032,45 @@
   3.197 - 	    lcr_dbf.close(dbh);
   3.198 - 	    return -1;
   3.199 - 	}
   3.200 -+	if (VAL_NULL(ROW_VALUES(row) + 8) == 1) {
   3.201 -+	    user_len = 0;
   3.202 -+	    user = (char *)0;
   3.203 -+	} else {
   3.204 -+	    user = (char *)VAL_STRING(ROW_VALUES(row) + 8);
   3.205 -+	    user_len = strlen(user);
   3.206 -+	    if (user_len > MAX_USER_LEN) {
   3.207 -+		LM_ERR("Too long gw user <%u>\n", user_len);
   3.208 -+		lcr_dbf.free_result(dbh, res);
   3.209 -+		lcr_dbf.close(dbh);
   3.210 -+		return -1;
   3.211 -+	    }
   3.212 -+	}
   3.213 -+	if (VAL_NULL(ROW_VALUES(row) + 9) == 1) {
   3.214 -+	    realm_len = 0;
   3.215 -+	    realm = (char *)0;
   3.216 -+	} else {
   3.217 -+	    realm = (char *)VAL_STRING(ROW_VALUES(row) + 9);
   3.218 -+	    realm_len = strlen(realm);
   3.219 -+	    if (realm_len > MAX_REALM_LEN) {
   3.220 -+		LM_ERR("Too long gw realm <%u>\n", realm_len);
   3.221 -+		lcr_dbf.free_result(dbh, res);
   3.222 -+		lcr_dbf.close(dbh);
   3.223 -+		return -1;
   3.224 -+	    }
   3.225 -+	}
   3.226 -+	if (VAL_NULL(ROW_VALUES(row) + 10) == 1) {
   3.227 -+	    passwd_len = 0;
   3.228 -+	    passwd = (char *)0;
   3.229 -+	} else {
   3.230 -+	    passwd = (char *)VAL_STRING(ROW_VALUES(row) + 10);
   3.231 -+	    passwd_len = strlen(passwd);
   3.232 -+	    if (passwd_len > MAX_PASSWD_LEN) {
   3.233 -+		LM_ERR("Too long gw passwd <%u>\n", passwd_len);
   3.234 -+		lcr_dbf.free_result(dbh, res);
   3.235 -+		lcr_dbf.close(dbh);
   3.236 -+		return -1;
   3.237 -+	    }
   3.238 -+	}
   3.239 - 	if (*gws == gws_1) {
   3.240 - 	    gws_2[i].ip_addr = (unsigned int)ip_addr.s_addr;
   3.241 - 	    gws_2[i].port = port;
   3.242 -@@ -949,6 +1082,15 @@
   3.243 - 	    gws_2[i].tag_len = tag_len;
   3.244 - 	    if (tag_len)
   3.245 - 		memcpy(&(gws_2[i].tag[0]), tag, tag_len);
   3.246 -+	    gws_2[i].user_len = user_len;
   3.247 -+	    if (user_len)
   3.248 -+	    memcpy(&(gws_2[i].user[0]), user, user_len);
   3.249 -+	    gws_2[i].realm_len = realm_len;
   3.250 -+	    if (realm_len)
   3.251 -+	    memcpy(&(gws_2[i].realm[0]), realm, realm_len);
   3.252 -+	    gws_2[i].passwd_len = passwd_len;
   3.253 -+	    if (passwd_len)
   3.254 -+	    memcpy(&(gws_2[i].passwd[0]), passwd, passwd_len);
   3.255 - 	} else {
   3.256 - 	    gws_1[i].ip_addr = (unsigned int)ip_addr.s_addr;
   3.257 - 	    gws_1[i].port = port;
   3.258 -@@ -960,6 +1102,15 @@
   3.259 - 	    gws_1[i].tag_len = tag_len;
   3.260 - 	    if (tag_len)
   3.261 - 		memcpy(&(gws_1[i].tag[0]), tag, tag_len);
   3.262 -+	    gws_1[i].user_len = user_len;
   3.263 -+	    if (user_len)
   3.264 -+	    memcpy(&(gws_1[i].user[0]), user, user_len);
   3.265 -+	    gws_1[i].realm_len = realm_len;
   3.266 -+	    if (realm_len)
   3.267 -+	    memcpy(&(gws_1[i].realm[0]), realm, realm_len);
   3.268 -+	    gws_1[i].passwd_len = passwd_len;
   3.269 -+	    if (passwd_len)
   3.270 -+	    memcpy(&(gws_1[i].passwd[0]), passwd, passwd_len);
   3.271 - 	}
   3.272 -     }
   3.273 - 
   3.274 -@@ -1141,6 +1292,21 @@
   3.275 - 	attr = add_mi_attr(node, MI_DUP_VALUE, "FLAGS", 5, p, len);
   3.276 - 	if(attr == NULL)
   3.277 - 	    return -1;
   3.278 -+
   3.279 -+	attr = add_mi_attr(node, MI_DUP_VALUE, "USER", 6,
   3.280 -+			   (*gws)[i].user, (*gws)[i].user_len );
   3.281 -+	if(attr == NULL)
   3.282 -+	    return -1;
   3.283 -+
   3.284 -+	attr = add_mi_attr(node, MI_DUP_VALUE, "REALM", 6,
   3.285 -+			   (*gws)[i].realm, (*gws)[i].realm_len );
   3.286 -+	if(attr == NULL)
   3.287 -+	    return -1;
   3.288 -+
   3.289 -+	attr = add_mi_attr(node, MI_DUP_VALUE, "PASSWD", 6,
   3.290 -+			   (*gws)[i].passwd, (*gws)[i].passwd_len );
   3.291 -+	if(attr == NULL)
   3.292 -+	    return -1;
   3.293 -     }
   3.294 - 
   3.295 -     for (i = 0; i < MAX_NO_OF_LCRS; i++) {
   3.296 -@@ -1184,6 +1350,9 @@
   3.297 -     char ruri[MAX_URI_SIZE];
   3.298 -     unsigned int i, j, k, index, addr, port, strip, gw_index,
   3.299 - 	duplicated_gw, flags, have_rpid_avp;
   3.300 -+    char *user;
   3.301 -+    char *realm;
   3.302 -+    char *passwd;
   3.303 -     uri_type scheme;
   3.304 -     uri_transport transport;
   3.305 -     struct ip_addr address;
   3.306 -@@ -1407,6 +1576,9 @@
   3.307 - 	transport = (*gws)[index].transport;
   3.308 - 	flags = (*gws)[index].flags;
   3.309 - 	strip = (*gws)[index].strip;
   3.310 -+	user = (*gws)[index].user;
   3.311 -+	realm = (*gws)[index].realm;
   3.312 -+	passwd = (*gws)[index].passwd;
   3.313 - 	if (strip > ruri_user.len) {
   3.314 - 	    LM_ERR("Strip count of gw is too large <%u>\n", strip);
   3.315 - 	    goto skip;
   3.316 -@@ -1476,6 +1648,25 @@
   3.317 - 	val.s = value;
   3.318 - 	add_avp(gw_uri_avp_type|AVP_VAL_STR, gw_uri_avp, val);
   3.319 - 	LM_DBG("Added gw_uri_avp <%.*s>\n", value.len, value.s);
   3.320 -+
   3.321 -+	value.s = user;
   3.322 -+	value.len = strlen(value.s);
   3.323 -+	val.s = value;
   3.324 -+	add_avp(user_avp_type|AVP_VAL_STR, user_avp, val);
   3.325 -+	LM_DBG("Added user_avp <%.*s>\n", value.len, value.s);
   3.326 -+
   3.327 -+	value.s = realm;
   3.328 -+	value.len = strlen(value.s);
   3.329 -+	val.s = value;
   3.330 -+	add_avp(realm_avp_type|AVP_VAL_STR, realm_avp, val);
   3.331 -+	LM_DBG("Added realm_avp <%.*s>\n", value.len, value.s);
   3.332 -+
   3.333 -+	value.s = passwd;
   3.334 -+	value.len = strlen(value.s);
   3.335 -+	val.s = value;
   3.336 -+	add_avp(passwd_avp_type|AVP_VAL_STR, passwd_avp, val);
   3.337 -+	LM_DBG("Added passwd_avp <%.*s>\n", value.len, value.s);
   3.338 -+
   3.339 -     skip:
   3.340 - 	continue;
   3.341 -     }
   3.342 -@@ -1558,7 +1749,8 @@
   3.343 - static int next_gw(struct sip_msg* _m, char* _s1, char* _s2)
   3.344 - {
   3.345 -     int_str gw_uri_val, ruri_user_val, val;
   3.346 --    struct usr_avp *gu_avp, *ru_avp;
   3.347 -+    int_str user_val, realm_val, passwd_val;
   3.348 -+    struct usr_avp *gu_avp, *ru_avp, *usr_avp, *rlm_avp, *pwd_avp;
   3.349 -     int rval;
   3.350 -     str new_ruri;
   3.351 -     char *at, *at_char, *strip_char, *endptr;
   3.352 -@@ -1575,6 +1767,35 @@
   3.353 -     gw_uri_val.s.len = gw_uri_val.s.len - (at - gw_uri_val.s.s);
   3.354 -     gw_uri_val.s.s = at;
   3.355 - 
   3.356 -+	/* Save gateway AVPs for use in script */
   3.357 -+	usr_avp = search_first_avp(user_avp_type, user_avp, &user_val, 0);
   3.358 -+	rlm_avp = search_first_avp(realm_avp_type, realm_avp, &realm_val, 0);
   3.359 -+	pwd_avp = search_first_avp(passwd_avp_type, passwd_avp, &passwd_val, 0);
   3.360 -+	if (!usr_avp) {
   3.361 -+		LM_DBG("User AVP no set\n");
   3.362 -+		return -1;
   3.363 -+	}
   3.364 -+	else {
   3.365 -+		add_avp(user_avp_type|AVP_VAL_STR, user_avp, user_val);
   3.366 -+		LM_DBG("Added user_avp <%.*s>\n", user_val.s.len, user_val.s.s);
   3.367 -+	}
   3.368 -+	if (!rlm_avp) {
   3.369 -+		LM_DBG("Realm AVP no set\n");
   3.370 -+		return -1;
   3.371 -+	}
   3.372 -+	else {
   3.373 -+		add_avp(realm_avp_type|AVP_VAL_STR, realm_avp, realm_val);
   3.374 -+		LM_DBG("Added realm_avp <%.*s>\n", realm_val.s.len, realm_val.s.s);
   3.375 -+	}
   3.376 -+	if (!pwd_avp) {
   3.377 -+		LM_DBG("Passwd AVP no set\n");
   3.378 -+		return -1;
   3.379 -+	}
   3.380 -+	else {
   3.381 -+		add_avp(passwd_avp_type|AVP_VAL_STR, passwd_avp, passwd_val);
   3.382 -+		LM_DBG("Added passwd_avp <%.*s>\n", passwd_val.s.len, passwd_val.s.s);
   3.383 -+	}
   3.384 -+
   3.385 - 	/* Create new Request-URI taking URI user from ruri_user AVP
   3.386 - 	   and other parts of from gateway URI AVP. */
   3.387 - 	ru_avp = search_first_avp(ruri_user_avp_type, ruri_user_avp,
     4.1 --- a/opensips/opensips.patch.reg	Thu Dec 01 13:24:24 2011 +0100
     4.2 +++ b/opensips/opensips.patch.reg	Thu Dec 01 13:33:32 2011 +0100
     4.3 @@ -2,7 +2,7 @@
     4.4  diff -Nau modules/registrar/save.c.orig modules/registrar/save.c
     4.5  --- modules/registrar/save.c.orig	2008-08-03 15:53:57.000000000 +0200
     4.6  +++ modules/registrar/save.c	2009-03-24 21:44:46.182865192 +0100
     4.7 -@@ -74,7 +74,7 @@
     4.8 +@@ -76,7 +76,7 @@
     4.9   struct save_ctx {
    4.10   	unsigned int flags;
    4.11   	str aor;
    4.12 @@ -11,7 +11,7 @@
    4.13   };
    4.14   
    4.15   
    4.16 -@@ -386,7 +386,7 @@
    4.17 +@@ -388,7 +388,7 @@
    4.18   		if (e == 0)
    4.19   			continue;
    4.20   
    4.21 @@ -20,7 +20,7 @@
    4.22   			if (_sctx->flags&REG_SAVE_FORCE_REG_FLAG) {
    4.23   				/* we are overflowing the number of maximum contacts,
    4.24   				   so remove the first (oldest) one to prevent this */
    4.25 -@@ -492,6 +492,7 @@
    4.26 +@@ -494,6 +494,7 @@
    4.27   										contact_t* _c, struct save_ctx *_sctx)
    4.28   {
    4.29   	ucontact_info_t *ci;
    4.30 @@ -28,7 +28,7 @@
    4.31   	ucontact_t* c;
    4.32   	int e;
    4.33   	unsigned int cflags;
    4.34 -@@ -552,7 +553,7 @@
    4.35 +@@ -554,7 +555,7 @@
    4.36   				continue;
    4.37   
    4.38   			/* we need to add a new contact -> too many ?? */
    4.39 @@ -37,7 +37,7 @@
    4.40   				if (_sctx->flags&REG_SAVE_FORCE_REG_FLAG) {
    4.41   					/* we are overflowing the number of maximum contacts,
    4.42   					   so remove the first (oldest) one to prevent this */
    4.43 -@@ -579,6 +580,23 @@
    4.44 +@@ -581,6 +582,23 @@
    4.45   				goto error;
    4.46   			}
    4.47   
     5.1 --- a/opensips/opensips.patch.uac	Thu Dec 01 13:24:24 2011 +0100
     5.2 +++ b/opensips/opensips.patch.uac	Thu Dec 01 13:33:32 2011 +0100
     5.3 @@ -2,7 +2,7 @@
     5.4  diff -Nau modules/uac/auth.c.orig modules/uac/auth.c
     5.5  --- modules/uac/auth.c.orig	2008-08-03 15:53:40.000000000 +0200
     5.6  +++ modules/uac/auth.c	2009-03-24 21:48:53.478867420 +0100
     5.7 -@@ -375,14 +375,172 @@
     5.8 +@@ -143,14 +143,172 @@
     5.9   	HASHHEX response;
    5.10   	str *new_hdr;
    5.11   
    5.12 @@ -70,7 +70,7 @@
    5.13  +			crd->passwd = pv_val.rs;
    5.14  +
    5.15  +		if (nret) { /* if not found, look into predefined credentials */
    5.16 -+			tst = lookup_realm(&crd->realm);
    5.17 ++			tst = uac_auth_api._lookup_realm(&crd->realm);
    5.18  +
    5.19  +			if (tst==0) { /* found? */
    5.20  +				LM_DBG("no credential for realm \"%.*s\"\n", \
    5.21 @@ -121,25 +121,25 @@
    5.22  +
    5.23  +		/* set the nonce from existing UAC message */
    5.24  +		tmp_hdr = msg->proxy_auth;
    5.25 -+		auth.nonce.len = 0;
    5.26 -+		auth.nonce.s = 0;
    5.27 ++		auth->nonce.len = 0;
    5.28 ++		auth->nonce.s = 0;
    5.29  +		while (tmp_hdr) {
    5.30  +			if(pv_get_spec_value(msg, &auth_realm_spec, &pv_val)==0 \
    5.31  +				&& pv_val.rs.len>0) /* ensure realm is the desired one */
    5.32  +				if (strncmp(crd->realm.s, pv_val.rs.s, crd->realm.len)==0) {
    5.33 -+					auth.nonce.s = strchr(strstr(tmp_hdr->body.s, "nonce="), '"') + 1;
    5.34 -+					auth.nonce.len = strchr(auth.nonce.s, '"') - auth.nonce.s;
    5.35 ++					auth->nonce.s = strchr(strstr(tmp_hdr->body.s, "nonce="), '"') + 1;
    5.36 ++					auth->nonce.len = strchr(auth->nonce.s, '"') - auth->nonce.s;
    5.37  +				}
    5.38  +			tmp_hdr = tmp_hdr->sibling;
    5.39  +		}
    5.40 -+		if (auth.nonce.s == 0) {
    5.41 ++		if (auth->nonce.s == 0) {
    5.42  +			LM_DBG("failed to retrieve nonce from UAC message\n");
    5.43  +			pkg_free(crd);
    5.44  +			goto error;
    5.45  +		}
    5.46  +
    5.47  +		/* do authentication */
    5.48 -+		do_uac_auth(msg, newuri, crd, &auth, response);
    5.49 ++		uac_auth_api._do_uac_auth(msg, newuri, crd, auth, &auth_nc_cnonce, response);
    5.50  +		if (response==0) {
    5.51  +			LM_ERR("failed to calculate challenge response\n");
    5.52  +			pkg_free(crd);
    5.53 @@ -147,7 +147,7 @@
    5.54  +		}
    5.55  +
    5.56  +		/* build the authorization header */
    5.57 -+		new_hdr = build_authorization_hdr(407, newuri, crd, &auth, response);
    5.58 ++		new_hdr = uac_auth_api._build_authorization_hdr(407, newuri, crd, auth, &auth_nc_cnonce, response);
    5.59  +		if (new_hdr==0) {
    5.60  +			LM_ERR("failed to build authorization hdr\n");
    5.61  +			pkg_free(crd);
    5.62 @@ -184,7 +184,7 @@
    5.63  diff -Nau modules/uac/uac.c.orig modules/uac/uac.c
    5.64  --- modules/uac/uac.c.orig	2008-08-03 15:53:40.000000000 +0200
    5.65  +++ modules/uac/uac.c	2009-03-24 21:49:48.922890737 +0100
    5.66 -@@ -106,7 +106,7 @@
    5.67 +@@ -117,7 +117,7 @@
    5.68   			REQUEST_ROUTE|BRANCH_ROUTE|FAILURE_ROUTE },
    5.69   	{"uac_auth",          (cmd_function)w_uac_auth,       0,
    5.70   			0, 0,
     6.1 --- a/opensips/opensips.spec	Thu Dec 01 13:24:24 2011 +0100
     6.2 +++ b/opensips/opensips.spec	Thu Dec 01 13:33:32 2011 +0100
     6.3 @@ -22,8 +22,6 @@
     6.4  ##
     6.5  
     6.6  #   package options
     6.7 -%define       V_major  1.6.4
     6.8 -%define       V_minor  2
     6.9  %define       V_rtpproxy  1.2.1
    6.10  
    6.11  #   package information
    6.12 @@ -36,8 +34,8 @@
    6.13  Class:        PLUS
    6.14  Group:        VoIP
    6.15  License:      GPL
    6.16 -Version:      %{V_major}.%{V_minor}
    6.17 -Release:      20111128
    6.18 +Version:      1.7.1
    6.19 +Release:      20111120
    6.20  
    6.21  #   package options
    6.22  %option       with_cons    yes
    6.23 @@ -59,7 +57,7 @@
    6.24  %option       with_dbgmem  no
    6.25  
    6.26  #   list of sources
    6.27 -Source0:      http://www.opensips.org/pub/opensips/%{V_major}/src/opensips-%{V_major}-%{V_minor}-tls_src.tar.gz
    6.28 +Source0:      http://www.opensips.org/pub/opensips/%{version}/src/opensips-%{version}_src.tar.gz
    6.29  Source1:      http://www.b2bua.org/chrome/site/rtpproxy-%{V_rtpproxy}.tar.gz
    6.30  Source2:      rc.opensips
    6.31  Source3:      fsl.opensips
    6.32 @@ -67,9 +65,8 @@
    6.33  Patch0:       opensips.patch
    6.34  Patch1:       opensips.patch.dict
    6.35  Patch2:       opensips.patch.uac
    6.36 -Patch3:       opensips.patch.lcr
    6.37 -Patch4:       opensips.patch.reg
    6.38 -Patch5:       opensips.patch.rtpproxy
    6.39 +Patch3:       opensips.patch.reg
    6.40 +Patch4:       opensips.patch.rtpproxy
    6.41  
    6.42  #   build information
    6.43  Prefix:       %{l_prefix}
    6.44 @@ -169,11 +166,11 @@
    6.45  
    6.46  %track
    6.47      prog opensips = {
    6.48 -        version   = %{V_major}-%{V_minor}
    6.49 +        version   = %{version}
    6.50          url       = http://www.opensips.org/pub/opensips/
    6.51          regex     = (\d+\.\d+\.\d+)/
    6.52          url       = http://www.opensips.org/pub/opensips/__NEWVER__/src/
    6.53 -        regex     = opensips-(__VER__)-tls_src\.tar\.gz
    6.54 +        regex     = opensips-(__VER__)_src\.tar\.gz
    6.55      }
    6.56      prog opensips:rtpproxy = {
    6.57          version   = %{V_rtpproxy}
    6.58 @@ -182,15 +179,14 @@
    6.59      }
    6.60  
    6.61  %prep
    6.62 -    %setup -q -n opensips-%{V_major}-%{V_minor}-tls
    6.63 -    %setup -q -n opensips-%{V_major}-%{V_minor}-tls -T -D -a 1
    6.64 +    %setup -q -n opensips-%{version}-tls
    6.65 +    %setup -q -n opensips-%{version}-tls -T -D -a 1
    6.66      %patch -p0
    6.67      %patch -p0 -P 1
    6.68      %patch -p0 -P 2
    6.69      %patch -p0 -P 3
    6.70 -    %patch -p0 -P 4
    6.71      ( cd rtpproxy-%{V_rtpproxy}
    6.72 -      %patch -p0 -P 5
    6.73 +      %patch -p0 -P 4
    6.74      ) || exit $?
    6.75      %{l_shtool} subst \
    6.76          -e 's;^#! */bin/sh;#! %{l_prefix}/bin/bash;' \
    6.77 @@ -254,9 +250,12 @@
    6.78          scripts/opensipsctl
    6.79      %{l_shtool} subst \
    6.80          -e 's;\(DB_PATH="\)[^"][^"]*;\1%{l_prefix}/var/opensips/db;' \
    6.81 +        -e 's;start opensips \(with 64MB share memory\).*;start \1 instead of default 32MB;' \
    6.82 +        -e 's;\(# STARTOPTIONS=.*\);\1"-m 64";' \
    6.83          scripts/osipsconsolerc \
    6.84          scripts/opensipsctlrc
    6.85      %{l_shtool} subst \
    6.86 +        -e 's;=/var/run/\(opensips.pid\);=%{l_prefix}/var/opensips/\1;g' \
    6.87          -e 's;/var/run/\(opensips.pid\);%{l_prefix}/var/opensips/\1;g' \
    6.88          -e 's;\(my \$fifo_reply_path\) = "/tmp/";\1 = "%{l_prefix}/var/opensips/";' \
    6.89          -e 's;\(my \$HISTORY_FILE\) = "/tmp/osipsconsole_history";\1 = "%{l_prefix}/var/opensips/osipsconsole_history";' \
    6.90 @@ -305,9 +304,6 @@
    6.91          -e 's;\(script_flags(int\));\1,null);' \
    6.92          scripts/dbtext/opensips/dialog
    6.93      %{l_shtool} subst \
    6.94 -        -e 's;\(gw_name(string).*\)  *$;\1 user(string,null) realm(string,null) passwd(string,null);' \
    6.95 -        scripts/dbtext/opensips/gw
    6.96 -    %{l_shtool} subst \
    6.97          -e 's;body(string);body(blob);' \
    6.98          -e 's;sender(string);sender(string,null);' \
    6.99          scripts/dbtext/opensips/presentity
   6.100 @@ -481,7 +477,7 @@
   6.101          utils
   6.102  
   6.103      #   build modules
   6.104 -    %{l_make} %{l_mflags} \
   6.105 +    %{l_make} %{l_mflags -O} \
   6.106          CC="%{l_cc}" \
   6.107  %if "%{with_sctp}" == "yes"
   6.108          SCTP=1 \
   6.109 @@ -511,7 +507,7 @@
   6.110      rm -rf $RPM_BUILD_ROOT
   6.111  
   6.112      #   select modules
   6.113 -    modslist='b2b_entities b2b_logic cpl-c db_http dialplan identity jabber perl perlvdb presence presence_dialoginfo presence_mwi presence_xml pua pua_bla pua_dialoginfo pua_mi pua_usrloc pua_xmpp regex rls tlsops xcap_client xmpp'
   6.114 +    modslist='b2b_entities b2b_logic cpl-c db_http identity jabber perl perlvdb presence presence_dialoginfo presence_mwi presence_xml pua pua_bla pua_dialoginfo pua_mi pua_usrloc pua_xmpp regex rls tlsops xcap_client xmpp'
   6.115  %if "%{with_croute}" == "yes"
   6.116      modslist="$modslist carrierroute"
   6.117  %endif
   6.118 @@ -579,16 +575,12 @@
   6.119          $RPM_BUILD_ROOT%{l_prefix}/etc/opensips
   6.120      %{l_shtool} install -c -m 644 %{l_value -s -a} \
   6.121          %{SOURCE opensips.cfg} \
   6.122 -        %{SOURCE opensipsctlrc} \
   6.123          $RPM_BUILD_ROOT%{l_prefix}/etc/opensips/
   6.124  
   6.125 -    #   conditionally install osipsconsole resources
   6.126 -%if "%{with_cons}" == "yes"
   6.127 -    %{l_shtool} install -c -m 644 %{l_value -s -a} \
   6.128 -        %{SOURCE osipsconsolerc} \
   6.129 -        $RPM_BUILD_ROOT%{l_prefix}/etc/opensips/
   6.130 -%else
   6.131 +    #   conditionally remove osipsconsole resources
   6.132 +%if "%{with_cons}" != "yes"
   6.133          rm $RPM_BUILD_ROOT%{l_prefix}/sbin/osipsconsole
   6.134 +        rm $RPM_BUILD_ROOT%{l_prefix}/etc/opensips/osipsconsolerc
   6.135  %endif
   6.136  
   6.137      #   install OSSP fsl configuration
     7.1 --- a/opensips/opensipsctlrc	Thu Dec 01 13:24:24 2011 +0100
     7.2 +++ b/opensips/opensipsctlrc	Thu Dec 01 13:33:32 2011 +0100
     7.3 @@ -131,4 +131,5 @@
     7.4  
     7.5  ## Extra start options - default is: not set
     7.6  # example: start opensips with 64MB share memory: STARTOPTIONS="-m 64"
     7.7 +#          ...as opposed to the 32MB share memory default value in 1.7
     7.8  # STARTOPTIONS=
     8.1 --- a/opensips/osipsconsolerc	Thu Dec 01 13:24:24 2011 +0100
     8.2 +++ b/opensips/osipsconsolerc	Thu Dec 01 13:33:32 2011 +0100
     8.3 @@ -95,4 +95,5 @@
     8.4  
     8.5  ## Extra start options - default is: not set
     8.6  # example: start opensips with 64MB share memory: STARTOPTIONS="-m 64"
     8.7 +#          ...as opposed to the 32MB share memory default value in 1.7
     8.8  # STARTOPTIONS=

mercurial