# HG changeset patch # User Michael Schloh von Bennewitz # Date 1322742812 -3600 # Node ID c98ae03f426677991a9be26bca5e091d4bef1f02 # Parent 610cba0674b974ddefd301ef87f9364663b6cc6f Update and correct to vendor version, removing deprecated module logic. diff -r 610cba0674b9 -r c98ae03f4266 opensips/opensips.cfg --- a/opensips/opensips.cfg Thu Dec 01 13:24:24 2011 +0100 +++ b/opensips/opensips.cfg Thu Dec 01 13:33:32 2011 +0100 @@ -115,7 +115,6 @@ modparam("usrloc|uri|auth_db", "db_url", "text://@l_prefix@/var/opensips/db") # ----- rr params ----- -modparam("rr", "enable_full_lr", 1) # add value to ;lr param for broken UAs modparam("rr", "append_fromtag", 1) # important when using detect_direction # ----- usrloc params ----- @@ -130,7 +129,6 @@ modparam("acc", "db_url", "dbtext://@l_prefix@/var/opensips/db") #modparam("acc", "db_url", "flatstore:@l_prefix@/var/opensips/acc") modparam("acc", "early_media", 1) -modparam("acc", "report_ack", 1) modparam("acc", "report_cancels", 1) modparam("acc", "detect_direction", 1) modparam("acc", "log_level", 2) diff -r 610cba0674b9 -r c98ae03f4266 opensips/opensips.patch --- a/opensips/opensips.patch Thu Dec 01 13:24:24 2011 +0100 +++ b/opensips/opensips.patch Thu Dec 01 13:33:32 2011 +0100 @@ -2,7 +2,7 @@ diff -Nau main.c.orig main.c --- main.c.orig 2009-12-10 14:11:03.590141302 +0100 +++ main.c 2009-12-10 14:11:07.246237908 +0100 -@@ -952,6 +952,10 @@ +@@ -1038,6 +1038,10 @@ ret=-1; my_argc=argc; my_argv=argv; @@ -13,7 +13,7 @@ /*init pkg mallocs (before parsing cfg or cmd line !)*/ if (init_pkg_mallocs()==-1) goto error00; -@@ -1284,6 +1288,11 @@ +@@ -1370,6 +1374,11 @@ /* init_daemon? */ if (!dont_fork){ @@ -29,7 +29,7 @@ diff -Nau Makefile.defs.orig Makefile.defs --- Makefile.defs.orig 2007-12-13 14:39:06.000000000 +0100 +++ Makefile.defs 2008-01-14 16:48:02.811615000 +0100 -@@ -216,7 +216,7 @@ +@@ -220,7 +220,7 @@ else doc-dir = doc/$(MAIN_NAME)/ man-dir = man/ @@ -38,7 +38,7 @@ LOCALBASE ?= $(SYSBASE)/local endif endif -@@ -1427,6 +1427,10 @@ +@@ -1432,6 +1432,10 @@ LIBS+= -lsctp endif @@ -74,7 +74,7 @@ use IO::Socket; use Socket; #use Net::IP; -@@ -396,6 +395,12 @@ +@@ -378,6 +377,12 @@ } } @@ -119,17 +119,17 @@ diff -Nau modules/nathelper/nathelper.c.orig modules/nathelper/nathelper.c --- modules/nathelper/nathelper.c.orig 2010-12-20 14:33:50.000000000 +0100 +++ modules/nathelper/nathelper.c 2011-01-26 17:48:40.685941382 +0100 -@@ -273,6 +273,9 @@ - #define MI_RECHECK_TICKS "recheck_ticks" - #define MI_RECHECK_T_LEN (sizeof(MI_RECHECK_TICKS)-1) +@@ -288,6 +288,9 @@ + return 0; + } +/* MSvB macros */ +#define OPENSIPS_NOOP ((void)0) + - /* Supported version of the RTP proxy command protocol */ -@@ -1921,6 +1925,7 @@ + +@@ -805,6 +808,7 @@ #define FIX_MEDIP 0x02 #define ADD_ANORTPPROXY 0x04 #define FIX_ORGIP 0x08 @@ -137,20 +137,7 @@ #define ADIRECTION "a=direction:active" #define ADIRECTION_LEN (sizeof(ADIRECTION) - 1) -@@ -2050,6 +2055,12 @@ - return -1; - } - -+ if (level & FIX_RTCPIP) { -+ /* Iterate all a=rtcp: and replace ips in them. */ -+ if (replace_sdp_ip(msg, &body, "a=rtcp:", str2?&ip:0)==-1) -+ return -1; -+ } -+ - return 1; - } - -@@ -2215,7 +2226,9 @@ +@@ -821,7 +825,9 @@ { char *buf; int offset; @@ -160,14 +147,14 @@ str omip, nip, oip; /* check that updating mediaip is really necessary */ -@@ -2246,7 +2259,19 @@ +@@ -852,7 +858,19 @@ memcpy(buf, CRLF, CRLF_LEN); memcpy(buf + CRLF_LEN, omip.s, omip.len); memcpy(buf + CRLF_LEN + omip.len, oldip->s, oldip->len); - if (insert_new_lump_after(anchor, buf, + -+ /* if the oldmediaip string is already */ -+ /* in the body then don't add it again */ ++ /* if the oldmediaip string is already */ ++ /* in the body then don't add it again */ + binlump = 0; + for (templump = msg->body_lumps; templump; templump = templump->next) + if (templump->op == LUMP_ADD && strstr(templump->u.value, buf)) @@ -181,6 +168,19 @@ omip.len + oldip->len + CRLF_LEN, 0) == NULL) { LM_ERR("insert_new_lump_after failed\n"); pkg_free(buf); +@@ -1038,6 +1056,12 @@ + p= p->next; + } + ++ if (level & FIX_RTCPIP) { ++ /* Iterate all a=rtcp: and replace ips in them. */ ++ if (replace_sdp_ip(msg, &body, "a=rtcp:", str2?&ip:0)==-1) ++ return -1; ++ } ++ + return 1; + } + Index: parser/sdp/sdp_helpr_funcs.c diff -Nau parser/sdp/sdp_helpr_funcs.c.orig parser/sdp/sdp_helpr_funcs.c --- parser/sdp/sdp_helpr_funcs.c.orig 2010-12-08 15:14:06.000000000 +0100 diff -r 610cba0674b9 -r c98ae03f4266 opensips/opensips.patch.lcr --- a/opensips/opensips.patch.lcr Thu Dec 01 13:24:24 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,384 +0,0 @@ -Index: modules/lcr/lcr_mod.c -diff -Nau modules/lcr/lcr_mod.c.orig modules/lcr/lcr_mod.c ---- modules/lcr/lcr_mod.c.orig 2009-03-09 14:42:46.000000000 +0100 -+++ modules/lcr/lcr_mod.c 2009-03-24 22:50:37.363366116 +0100 -@@ -114,9 +114,18 @@ - - #define PRIORITY_COL "priority" - -+#define USER_COL "usid" -+ -+#define REALM_COL "realm" -+ -+#define PASSWD_COL "passwd" -+ - #define MAX_NO_OF_GWS 32 - #define MAX_NO_OF_LCRS 256 - #define MAX_PREFIX_LEN 256 -+#define MAX_USER_LEN 64 -+#define MAX_REALM_LEN 64 -+#define MAX_PASSWD_LEN 64 - #define MAX_TAG_LEN 16 - #define MAX_FROM_URI_LEN 256 - -@@ -141,6 +150,12 @@ - char tag[MAX_TAG_LEN + 1]; - unsigned short tag_len; - unsigned int flags; -+ char user[MAX_USER_LEN]; -+ unsigned short user_len; -+ char realm[MAX_REALM_LEN]; -+ unsigned short realm_len; -+ char passwd[MAX_PASSWD_LEN]; -+ unsigned short passwd_len; - }; - - struct lcr_info { -@@ -196,6 +211,9 @@ - static str prefix_col = str_init(PREFIX_COL); - static str from_uri_col = str_init(FROM_URI_COL); - static str priority_col = str_init(PRIORITY_COL); -+static str user_col = str_init(USER_COL); -+static str realm_col = str_init(REALM_COL); -+static str passwd_col = str_init(PASSWD_COL); - - /* timer */ - int fr_inv_timer = DEF_FR_INV_TIMER; -@@ -208,6 +226,9 @@ - static char *contact_avp_param = NULL; - static char *rpid_avp_param = NULL; - static char *flags_avp_param = NULL; -+static char *user_avp_param = NULL; -+static char *realm_avp_param = NULL; -+static char *passwd_avp_param = NULL; - - /* prefix mode */ - int prefix_mode_param = DEF_PREFIX_MODE; -@@ -239,6 +260,12 @@ - static int_str rpid_avp; - static int flags_avp_type; - static int_str flags_avp; -+static int user_avp_type; -+static int_str user_avp; -+static int realm_avp_type; -+static int_str realm_avp; -+static int passwd_avp_type; -+static int_str passwd_avp; - - struct gw_info **gws; /* Pointer to current gw table pointer */ - struct gw_info *gws_1; /* Pointer to gw table 1 */ -@@ -327,6 +354,12 @@ - {"fr_inv_timer", INT_PARAM, &fr_inv_timer }, - {"fr_inv_timer_next", INT_PARAM, &fr_inv_timer_next }, - {"prefix_mode", INT_PARAM, &prefix_mode_param }, -+ {"user_column", STR_PARAM, &user_col.s }, -+ {"realm_column", STR_PARAM, &realm_col.s }, -+ {"passwd_column", STR_PARAM, &passwd_col.s }, -+ {"auth_username_avp", STR_PARAM, &user_avp_param }, -+ {"auth_realm_avp", STR_PARAM, &realm_avp_param }, -+ {"auth_password_avp", STR_PARAM, &passwd_avp_param }, - {0, 0, 0} - }; - -@@ -438,6 +471,9 @@ - prefix_col.len = strlen(prefix_col.s); - from_uri_col.len = strlen(from_uri_col.s); - priority_col.len = strlen(priority_col.s); -+ user_col.len = strlen(user_col.s); -+ realm_col.len = strlen(realm_col.s); -+ passwd_col.len = strlen(passwd_col.s); - - /* Bind database */ - if (lcr_db_bind(&db_url)) { -@@ -563,6 +599,60 @@ - return -1; - } - -+ if (user_avp_param && *user_avp_param) { -+ s.s = user_avp_param; s.len = strlen(s.s); -+ if (pv_parse_spec(&s, &avp_spec)==0 -+ || avp_spec.type!=PVT_AVP) { -+ LM_ERR("Malformed or non AVP definition <%s>\n", user_avp_param); -+ return -1; -+ } -+ -+ if(pv_get_avp_name(0, &(avp_spec.pvp), &user_avp, &avp_flags)!=0) { -+ LM_ERR("Invalid AVP definition <%s>\n", user_avp_param); -+ return -1; -+ } -+ user_avp_type = avp_flags; -+ } else { -+ LM_ERR("AVP user_avp has not been defined\n"); -+ return -1; -+ } -+ -+ if (realm_avp_param && *realm_avp_param) { -+ s.s = realm_avp_param; s.len = strlen(s.s); -+ if (pv_parse_spec(&s, &avp_spec)==0 -+ || avp_spec.type!=PVT_AVP) { -+ LM_ERR("Malformed or non AVP definition <%s>\n", realm_avp_param); -+ return -1; -+ } -+ -+ if(pv_get_avp_name(0, &(avp_spec.pvp), &realm_avp, &avp_flags)!=0) { -+ LM_ERR("Invalid AVP definition <%s>\n", realm_avp_param); -+ return -1; -+ } -+ realm_avp_type = avp_flags; -+ } else { -+ LM_ERR("AVP realm_avp has not been defined\n"); -+ return -1; -+ } -+ -+ if (passwd_avp_param && *passwd_avp_param) { -+ s.s = passwd_avp_param; s.len = strlen(s.s); -+ if (pv_parse_spec(&s, &avp_spec)==0 -+ || avp_spec.type!=PVT_AVP) { -+ LM_ERR("Malformed or non AVP definition <%s>\n", passwd_avp_param); -+ return -1; -+ } -+ -+ if(pv_get_avp_name(0, &(avp_spec.pvp), &passwd_avp, &avp_flags)!=0) { -+ LM_ERR("Invalid AVP definition <%s>\n", passwd_avp_param); -+ return -1; -+ } -+ passwd_avp_type = avp_flags; -+ } else { -+ LM_ERR("AVP passwd_avp has not been defined\n"); -+ return -1; -+ } -+ - /* Check table version */ - db_con_t* dbh; - if (lcr_dbf.init==0){ -@@ -801,16 +891,17 @@ - int reload_gws(void) - { - unsigned int i, port, strip, tag_len, prefix_len, from_uri_len, -- grp_id, priority; -+ user_len, realm_len, passwd_len, grp_id, priority; - struct in_addr ip_addr; - unsigned int flags; - uri_type scheme; - uri_transport transport; - db_con_t* dbh; - char *tag, *prefix, *from_uri; -+ char *user, *realm, *passwd; - db_res_t* res = NULL; - db_row_t* row; -- db_key_t gw_cols[8]; -+ db_key_t gw_cols[11]; - db_key_t lcr_cols[4]; - - gw_cols[0] = &ip_addr_col; -@@ -823,6 +914,9 @@ - in the two tables? (ge vw lcr) */ - gw_cols[6] = &grp_id_col; - gw_cols[7] = &flags_col; -+ gw_cols[8] = &user_col; -+ gw_cols[9] = &realm_col; -+ gw_cols[10] = &passwd_col; - - lcr_cols[0] = &prefix_col; - lcr_cols[1] = &from_uri_col; -@@ -846,7 +940,7 @@ - return -1; - } - -- if (lcr_dbf.query(dbh, NULL, 0, NULL, gw_cols, 0, 8, 0, &res) < 0) { -+ if (lcr_dbf.query(dbh, NULL, 0, NULL, gw_cols, 0, 11, 0, &res) < 0) { - LM_ERR("Failed to query gw data\n"); - lcr_dbf.close(dbh); - return -1; -@@ -938,6 +1032,45 @@ - lcr_dbf.close(dbh); - return -1; - } -+ if (VAL_NULL(ROW_VALUES(row) + 8) == 1) { -+ user_len = 0; -+ user = (char *)0; -+ } else { -+ user = (char *)VAL_STRING(ROW_VALUES(row) + 8); -+ user_len = strlen(user); -+ if (user_len > MAX_USER_LEN) { -+ LM_ERR("Too long gw user <%u>\n", user_len); -+ lcr_dbf.free_result(dbh, res); -+ lcr_dbf.close(dbh); -+ return -1; -+ } -+ } -+ if (VAL_NULL(ROW_VALUES(row) + 9) == 1) { -+ realm_len = 0; -+ realm = (char *)0; -+ } else { -+ realm = (char *)VAL_STRING(ROW_VALUES(row) + 9); -+ realm_len = strlen(realm); -+ if (realm_len > MAX_REALM_LEN) { -+ LM_ERR("Too long gw realm <%u>\n", realm_len); -+ lcr_dbf.free_result(dbh, res); -+ lcr_dbf.close(dbh); -+ return -1; -+ } -+ } -+ if (VAL_NULL(ROW_VALUES(row) + 10) == 1) { -+ passwd_len = 0; -+ passwd = (char *)0; -+ } else { -+ passwd = (char *)VAL_STRING(ROW_VALUES(row) + 10); -+ passwd_len = strlen(passwd); -+ if (passwd_len > MAX_PASSWD_LEN) { -+ LM_ERR("Too long gw passwd <%u>\n", passwd_len); -+ lcr_dbf.free_result(dbh, res); -+ lcr_dbf.close(dbh); -+ return -1; -+ } -+ } - if (*gws == gws_1) { - gws_2[i].ip_addr = (unsigned int)ip_addr.s_addr; - gws_2[i].port = port; -@@ -949,6 +1082,15 @@ - gws_2[i].tag_len = tag_len; - if (tag_len) - memcpy(&(gws_2[i].tag[0]), tag, tag_len); -+ gws_2[i].user_len = user_len; -+ if (user_len) -+ memcpy(&(gws_2[i].user[0]), user, user_len); -+ gws_2[i].realm_len = realm_len; -+ if (realm_len) -+ memcpy(&(gws_2[i].realm[0]), realm, realm_len); -+ gws_2[i].passwd_len = passwd_len; -+ if (passwd_len) -+ memcpy(&(gws_2[i].passwd[0]), passwd, passwd_len); - } else { - gws_1[i].ip_addr = (unsigned int)ip_addr.s_addr; - gws_1[i].port = port; -@@ -960,6 +1102,15 @@ - gws_1[i].tag_len = tag_len; - if (tag_len) - memcpy(&(gws_1[i].tag[0]), tag, tag_len); -+ gws_1[i].user_len = user_len; -+ if (user_len) -+ memcpy(&(gws_1[i].user[0]), user, user_len); -+ gws_1[i].realm_len = realm_len; -+ if (realm_len) -+ memcpy(&(gws_1[i].realm[0]), realm, realm_len); -+ gws_1[i].passwd_len = passwd_len; -+ if (passwd_len) -+ memcpy(&(gws_1[i].passwd[0]), passwd, passwd_len); - } - } - -@@ -1141,6 +1292,21 @@ - attr = add_mi_attr(node, MI_DUP_VALUE, "FLAGS", 5, p, len); - if(attr == NULL) - return -1; -+ -+ attr = add_mi_attr(node, MI_DUP_VALUE, "USER", 6, -+ (*gws)[i].user, (*gws)[i].user_len ); -+ if(attr == NULL) -+ return -1; -+ -+ attr = add_mi_attr(node, MI_DUP_VALUE, "REALM", 6, -+ (*gws)[i].realm, (*gws)[i].realm_len ); -+ if(attr == NULL) -+ return -1; -+ -+ attr = add_mi_attr(node, MI_DUP_VALUE, "PASSWD", 6, -+ (*gws)[i].passwd, (*gws)[i].passwd_len ); -+ if(attr == NULL) -+ return -1; - } - - for (i = 0; i < MAX_NO_OF_LCRS; i++) { -@@ -1184,6 +1350,9 @@ - char ruri[MAX_URI_SIZE]; - unsigned int i, j, k, index, addr, port, strip, gw_index, - duplicated_gw, flags, have_rpid_avp; -+ char *user; -+ char *realm; -+ char *passwd; - uri_type scheme; - uri_transport transport; - struct ip_addr address; -@@ -1407,6 +1576,9 @@ - transport = (*gws)[index].transport; - flags = (*gws)[index].flags; - strip = (*gws)[index].strip; -+ user = (*gws)[index].user; -+ realm = (*gws)[index].realm; -+ passwd = (*gws)[index].passwd; - if (strip > ruri_user.len) { - LM_ERR("Strip count of gw is too large <%u>\n", strip); - goto skip; -@@ -1476,6 +1648,25 @@ - val.s = value; - add_avp(gw_uri_avp_type|AVP_VAL_STR, gw_uri_avp, val); - LM_DBG("Added gw_uri_avp <%.*s>\n", value.len, value.s); -+ -+ value.s = user; -+ value.len = strlen(value.s); -+ val.s = value; -+ add_avp(user_avp_type|AVP_VAL_STR, user_avp, val); -+ LM_DBG("Added user_avp <%.*s>\n", value.len, value.s); -+ -+ value.s = realm; -+ value.len = strlen(value.s); -+ val.s = value; -+ add_avp(realm_avp_type|AVP_VAL_STR, realm_avp, val); -+ LM_DBG("Added realm_avp <%.*s>\n", value.len, value.s); -+ -+ value.s = passwd; -+ value.len = strlen(value.s); -+ val.s = value; -+ add_avp(passwd_avp_type|AVP_VAL_STR, passwd_avp, val); -+ LM_DBG("Added passwd_avp <%.*s>\n", value.len, value.s); -+ - skip: - continue; - } -@@ -1558,7 +1749,8 @@ - static int next_gw(struct sip_msg* _m, char* _s1, char* _s2) - { - int_str gw_uri_val, ruri_user_val, val; -- struct usr_avp *gu_avp, *ru_avp; -+ int_str user_val, realm_val, passwd_val; -+ struct usr_avp *gu_avp, *ru_avp, *usr_avp, *rlm_avp, *pwd_avp; - int rval; - str new_ruri; - char *at, *at_char, *strip_char, *endptr; -@@ -1575,6 +1767,35 @@ - gw_uri_val.s.len = gw_uri_val.s.len - (at - gw_uri_val.s.s); - gw_uri_val.s.s = at; - -+ /* Save gateway AVPs for use in script */ -+ usr_avp = search_first_avp(user_avp_type, user_avp, &user_val, 0); -+ rlm_avp = search_first_avp(realm_avp_type, realm_avp, &realm_val, 0); -+ pwd_avp = search_first_avp(passwd_avp_type, passwd_avp, &passwd_val, 0); -+ if (!usr_avp) { -+ LM_DBG("User AVP no set\n"); -+ return -1; -+ } -+ else { -+ add_avp(user_avp_type|AVP_VAL_STR, user_avp, user_val); -+ LM_DBG("Added user_avp <%.*s>\n", user_val.s.len, user_val.s.s); -+ } -+ if (!rlm_avp) { -+ LM_DBG("Realm AVP no set\n"); -+ return -1; -+ } -+ else { -+ add_avp(realm_avp_type|AVP_VAL_STR, realm_avp, realm_val); -+ LM_DBG("Added realm_avp <%.*s>\n", realm_val.s.len, realm_val.s.s); -+ } -+ if (!pwd_avp) { -+ LM_DBG("Passwd AVP no set\n"); -+ return -1; -+ } -+ else { -+ add_avp(passwd_avp_type|AVP_VAL_STR, passwd_avp, passwd_val); -+ LM_DBG("Added passwd_avp <%.*s>\n", passwd_val.s.len, passwd_val.s.s); -+ } -+ - /* Create new Request-URI taking URI user from ruri_user AVP - and other parts of from gateway URI AVP. */ - ru_avp = search_first_avp(ruri_user_avp_type, ruri_user_avp, diff -r 610cba0674b9 -r c98ae03f4266 opensips/opensips.patch.reg --- a/opensips/opensips.patch.reg Thu Dec 01 13:24:24 2011 +0100 +++ b/opensips/opensips.patch.reg Thu Dec 01 13:33:32 2011 +0100 @@ -2,7 +2,7 @@ diff -Nau modules/registrar/save.c.orig modules/registrar/save.c --- modules/registrar/save.c.orig 2008-08-03 15:53:57.000000000 +0200 +++ modules/registrar/save.c 2009-03-24 21:44:46.182865192 +0100 -@@ -74,7 +74,7 @@ +@@ -76,7 +76,7 @@ struct save_ctx { unsigned int flags; str aor; @@ -11,7 +11,7 @@ }; -@@ -386,7 +386,7 @@ +@@ -388,7 +388,7 @@ if (e == 0) continue; @@ -20,7 +20,7 @@ if (_sctx->flags®_SAVE_FORCE_REG_FLAG) { /* we are overflowing the number of maximum contacts, so remove the first (oldest) one to prevent this */ -@@ -492,6 +492,7 @@ +@@ -494,6 +494,7 @@ contact_t* _c, struct save_ctx *_sctx) { ucontact_info_t *ci; @@ -28,7 +28,7 @@ ucontact_t* c; int e; unsigned int cflags; -@@ -552,7 +553,7 @@ +@@ -554,7 +555,7 @@ continue; /* we need to add a new contact -> too many ?? */ @@ -37,7 +37,7 @@ if (_sctx->flags®_SAVE_FORCE_REG_FLAG) { /* we are overflowing the number of maximum contacts, so remove the first (oldest) one to prevent this */ -@@ -579,6 +580,23 @@ +@@ -581,6 +582,23 @@ goto error; } diff -r 610cba0674b9 -r c98ae03f4266 opensips/opensips.patch.uac --- a/opensips/opensips.patch.uac Thu Dec 01 13:24:24 2011 +0100 +++ b/opensips/opensips.patch.uac Thu Dec 01 13:33:32 2011 +0100 @@ -2,7 +2,7 @@ diff -Nau modules/uac/auth.c.orig modules/uac/auth.c --- modules/uac/auth.c.orig 2008-08-03 15:53:40.000000000 +0200 +++ modules/uac/auth.c 2009-03-24 21:48:53.478867420 +0100 -@@ -375,14 +375,172 @@ +@@ -143,14 +143,172 @@ HASHHEX response; str *new_hdr; @@ -70,7 +70,7 @@ + crd->passwd = pv_val.rs; + + if (nret) { /* if not found, look into predefined credentials */ -+ tst = lookup_realm(&crd->realm); ++ tst = uac_auth_api._lookup_realm(&crd->realm); + + if (tst==0) { /* found? */ + LM_DBG("no credential for realm \"%.*s\"\n", \ @@ -121,25 +121,25 @@ + + /* set the nonce from existing UAC message */ + tmp_hdr = msg->proxy_auth; -+ auth.nonce.len = 0; -+ auth.nonce.s = 0; ++ auth->nonce.len = 0; ++ auth->nonce.s = 0; + while (tmp_hdr) { + if(pv_get_spec_value(msg, &auth_realm_spec, &pv_val)==0 \ + && pv_val.rs.len>0) /* ensure realm is the desired one */ + if (strncmp(crd->realm.s, pv_val.rs.s, crd->realm.len)==0) { -+ auth.nonce.s = strchr(strstr(tmp_hdr->body.s, "nonce="), '"') + 1; -+ auth.nonce.len = strchr(auth.nonce.s, '"') - auth.nonce.s; ++ auth->nonce.s = strchr(strstr(tmp_hdr->body.s, "nonce="), '"') + 1; ++ auth->nonce.len = strchr(auth->nonce.s, '"') - auth->nonce.s; + } + tmp_hdr = tmp_hdr->sibling; + } -+ if (auth.nonce.s == 0) { ++ if (auth->nonce.s == 0) { + LM_DBG("failed to retrieve nonce from UAC message\n"); + pkg_free(crd); + goto error; + } + + /* do authentication */ -+ do_uac_auth(msg, newuri, crd, &auth, response); ++ uac_auth_api._do_uac_auth(msg, newuri, crd, auth, &auth_nc_cnonce, response); + if (response==0) { + LM_ERR("failed to calculate challenge response\n"); + pkg_free(crd); @@ -147,7 +147,7 @@ + } + + /* build the authorization header */ -+ new_hdr = build_authorization_hdr(407, newuri, crd, &auth, response); ++ new_hdr = uac_auth_api._build_authorization_hdr(407, newuri, crd, auth, &auth_nc_cnonce, response); + if (new_hdr==0) { + LM_ERR("failed to build authorization hdr\n"); + pkg_free(crd); @@ -184,7 +184,7 @@ diff -Nau modules/uac/uac.c.orig modules/uac/uac.c --- modules/uac/uac.c.orig 2008-08-03 15:53:40.000000000 +0200 +++ modules/uac/uac.c 2009-03-24 21:49:48.922890737 +0100 -@@ -106,7 +106,7 @@ +@@ -117,7 +117,7 @@ REQUEST_ROUTE|BRANCH_ROUTE|FAILURE_ROUTE }, {"uac_auth", (cmd_function)w_uac_auth, 0, 0, 0, diff -r 610cba0674b9 -r c98ae03f4266 opensips/opensips.spec --- a/opensips/opensips.spec Thu Dec 01 13:24:24 2011 +0100 +++ b/opensips/opensips.spec Thu Dec 01 13:33:32 2011 +0100 @@ -22,8 +22,6 @@ ## # package options -%define V_major 1.6.4 -%define V_minor 2 %define V_rtpproxy 1.2.1 # package information @@ -36,8 +34,8 @@ Class: PLUS Group: VoIP License: GPL -Version: %{V_major}.%{V_minor} -Release: 20111128 +Version: 1.7.1 +Release: 20111120 # package options %option with_cons yes @@ -59,7 +57,7 @@ %option with_dbgmem no # list of sources -Source0: http://www.opensips.org/pub/opensips/%{V_major}/src/opensips-%{V_major}-%{V_minor}-tls_src.tar.gz +Source0: http://www.opensips.org/pub/opensips/%{version}/src/opensips-%{version}_src.tar.gz Source1: http://www.b2bua.org/chrome/site/rtpproxy-%{V_rtpproxy}.tar.gz Source2: rc.opensips Source3: fsl.opensips @@ -67,9 +65,8 @@ Patch0: opensips.patch Patch1: opensips.patch.dict Patch2: opensips.patch.uac -Patch3: opensips.patch.lcr -Patch4: opensips.patch.reg -Patch5: opensips.patch.rtpproxy +Patch3: opensips.patch.reg +Patch4: opensips.patch.rtpproxy # build information Prefix: %{l_prefix} @@ -169,11 +166,11 @@ %track prog opensips = { - version = %{V_major}-%{V_minor} + version = %{version} url = http://www.opensips.org/pub/opensips/ regex = (\d+\.\d+\.\d+)/ url = http://www.opensips.org/pub/opensips/__NEWVER__/src/ - regex = opensips-(__VER__)-tls_src\.tar\.gz + regex = opensips-(__VER__)_src\.tar\.gz } prog opensips:rtpproxy = { version = %{V_rtpproxy} @@ -182,15 +179,14 @@ } %prep - %setup -q -n opensips-%{V_major}-%{V_minor}-tls - %setup -q -n opensips-%{V_major}-%{V_minor}-tls -T -D -a 1 + %setup -q -n opensips-%{version}-tls + %setup -q -n opensips-%{version}-tls -T -D -a 1 %patch -p0 %patch -p0 -P 1 %patch -p0 -P 2 %patch -p0 -P 3 - %patch -p0 -P 4 ( cd rtpproxy-%{V_rtpproxy} - %patch -p0 -P 5 + %patch -p0 -P 4 ) || exit $? %{l_shtool} subst \ -e 's;^#! */bin/sh;#! %{l_prefix}/bin/bash;' \ @@ -254,9 +250,12 @@ scripts/opensipsctl %{l_shtool} subst \ -e 's;\(DB_PATH="\)[^"][^"]*;\1%{l_prefix}/var/opensips/db;' \ + -e 's;start opensips \(with 64MB share memory\).*;start \1 instead of default 32MB;' \ + -e 's;\(# STARTOPTIONS=.*\);\1"-m 64";' \ scripts/osipsconsolerc \ scripts/opensipsctlrc %{l_shtool} subst \ + -e 's;=/var/run/\(opensips.pid\);=%{l_prefix}/var/opensips/\1;g' \ -e 's;/var/run/\(opensips.pid\);%{l_prefix}/var/opensips/\1;g' \ -e 's;\(my \$fifo_reply_path\) = "/tmp/";\1 = "%{l_prefix}/var/opensips/";' \ -e 's;\(my \$HISTORY_FILE\) = "/tmp/osipsconsole_history";\1 = "%{l_prefix}/var/opensips/osipsconsole_history";' \ @@ -305,9 +304,6 @@ -e 's;\(script_flags(int\));\1,null);' \ scripts/dbtext/opensips/dialog %{l_shtool} subst \ - -e 's;\(gw_name(string).*\) *$;\1 user(string,null) realm(string,null) passwd(string,null);' \ - scripts/dbtext/opensips/gw - %{l_shtool} subst \ -e 's;body(string);body(blob);' \ -e 's;sender(string);sender(string,null);' \ scripts/dbtext/opensips/presentity @@ -481,7 +477,7 @@ utils # build modules - %{l_make} %{l_mflags} \ + %{l_make} %{l_mflags -O} \ CC="%{l_cc}" \ %if "%{with_sctp}" == "yes" SCTP=1 \ @@ -511,7 +507,7 @@ rm -rf $RPM_BUILD_ROOT # select modules - 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' + 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' %if "%{with_croute}" == "yes" modslist="$modslist carrierroute" %endif @@ -579,16 +575,12 @@ $RPM_BUILD_ROOT%{l_prefix}/etc/opensips %{l_shtool} install -c -m 644 %{l_value -s -a} \ %{SOURCE opensips.cfg} \ - %{SOURCE opensipsctlrc} \ $RPM_BUILD_ROOT%{l_prefix}/etc/opensips/ - # conditionally install osipsconsole resources -%if "%{with_cons}" == "yes" - %{l_shtool} install -c -m 644 %{l_value -s -a} \ - %{SOURCE osipsconsolerc} \ - $RPM_BUILD_ROOT%{l_prefix}/etc/opensips/ -%else + # conditionally remove osipsconsole resources +%if "%{with_cons}" != "yes" rm $RPM_BUILD_ROOT%{l_prefix}/sbin/osipsconsole + rm $RPM_BUILD_ROOT%{l_prefix}/etc/opensips/osipsconsolerc %endif # install OSSP fsl configuration diff -r 610cba0674b9 -r c98ae03f4266 opensips/opensipsctlrc --- a/opensips/opensipsctlrc Thu Dec 01 13:24:24 2011 +0100 +++ b/opensips/opensipsctlrc Thu Dec 01 13:33:32 2011 +0100 @@ -131,4 +131,5 @@ ## Extra start options - default is: not set # example: start opensips with 64MB share memory: STARTOPTIONS="-m 64" +# ...as opposed to the 32MB share memory default value in 1.7 # STARTOPTIONS= diff -r 610cba0674b9 -r c98ae03f4266 opensips/osipsconsolerc --- a/opensips/osipsconsolerc Thu Dec 01 13:24:24 2011 +0100 +++ b/opensips/osipsconsolerc Thu Dec 01 13:33:32 2011 +0100 @@ -95,4 +95,5 @@ ## Extra start options - default is: not set # example: start opensips with 64MB share memory: STARTOPTIONS="-m 64" +# ...as opposed to the 32MB share memory default value in 1.7 # STARTOPTIONS=