Bladeren bron

Backport of the changes (see previous commits).
Thanks to Klaus and Juha for reminding me to add the patches here as well (i am new to git and to the new structure).

Carsten Bock 15 jaren geleden
bovenliggende
commit
c114f9fb32
2 gewijzigde bestanden met toevoegingen van 9 en 6 verwijderingen
  1. 1 1
      modules_k/dialog/dlg_handlers.c
  2. 8 5
      modules_k/nathelper/rtpproxy_stream.c

+ 1 - 1
modules_k/dialog/dlg_handlers.c

@@ -226,7 +226,7 @@ int populate_leg_info( struct dlg_cell *dlg, struct sip_msg *msg,
 	contact = ((contact_body_t *)msg->contact->parsed)->contacts->uri;
 	contact = ((contact_body_t *)msg->contact->parsed)->contacts->uri;
 
 
 	/* extract the RR parts */
 	/* extract the RR parts */
-	if(!msg->record_route && (parse_headers(msg,HDR_RECORDROUTE_F,0)<0)  ){
+	if(!msg->record_route && (parse_headers(msg,HDR_EOH_F,0)<0)  ){
 		LM_ERR("failed to parse record route header\n");
 		LM_ERR("failed to parse record route header\n");
 		goto error0;
 		goto error0;
 	}
 	}

+ 8 - 5
modules_k/nathelper/rtpproxy_stream.c

@@ -38,7 +38,6 @@
 int
 int
 fixup_var_str_int(void **param, int param_no)
 fixup_var_str_int(void **param, int param_no)
 {
 {
-    unsigned long go_to;
     int ret;
     int ret;
     pv_elem_t *model;
     pv_elem_t *model;
     str s;
     str s;
@@ -57,10 +56,14 @@ fixup_var_str_int(void **param, int param_no)
         }
         }
         *param = (void *)model;
         *param = (void *)model;
     } else if (param_no == 2) {
     } else if (param_no == 2) {
-        go_to = str2s(*param, strlen(*param), &ret);
-        if (ret == 0) {
-            pkg_free(*param);
-            *param = (void *)go_to;
+	/* According to
+	 * http://www.kamailio.org/docs/modules/1.5.x/nathelper.html#rtpproxy_stream2xxx
+	 * this could be -1 */
+	s.s = (char *)(*param);
+	s.len = strlen(s.s);
+	if (str2sint(&s, &ret)==0) {
+		pkg_free(*param);
+		*param = (void *)ret;
         } else {
         } else {
             LM_ERR("bad number <%s>\n", (char *)(*param));
             LM_ERR("bad number <%s>\n", (char *)(*param));
             return E_CFG;
             return E_CFG;