Browse code

rtp_media_server: fix issue 2524

- fix completion without failure route
- rms_bridge automaticaly append missing ';' is not present

(cherry picked from commit 2ea4f685ea8b7dbca13b4fd521441088f8318d1f)

Julien Chavanton authored on 23/10/2020 19:37:35 • Daniel-Constantin Mierla committed on 26/10/2020 09:58:57
Showing 2 changed files
... ...
@@ -4,7 +4,7 @@ CONTAINER=rtp_media_server
4 4
 IMAGE=rtp_media_server:latest
5 5
 docker stop ${CONTAINER}
6 6
 docker rm ${CONTAINER}
7
-docker run -d --net=host --name=${CONTAINER} ${IMAGE} /bin/sh -c "tail -f /dev/null"
7
+docker run -d --net=host --privileged --name=${CONTAINER} ${IMAGE} /bin/sh -c "tail -f /dev/null"
8 8
 
9 9
 echo ""
10 10
 echo "manual steps required to start Kamailio in the container:"
... ...
@@ -13,3 +13,8 @@ echo " set the listen IP in  /etc/kamailio.cfg"
13 13
 echo " docker exec -it rtp_media_server bash"
14 14
 echo " kamailio -m 64 -D -dd -f /etc/kamailio.cfg"
15 15
 echo ""
16
+
17
+# ulimit -c unlimited
18
+# echo "/tmp/core.%e.sig%s.%p" > /proc/sys/kernel/core_pattern
19
+# sysctl -w kernel.core_pattern=core
20
+# apt-get update && apt-get install -i gdb
... ...
@@ -489,6 +489,8 @@ static void bridge_cb(struct cell *ptrans, int ntype, struct tmcb_params *pcbp)
489 489
 		return;
490 490
 	} else if(ntype == TMCB_LOCAL_COMPLETED) {
491 491
 		LM_NOTICE("COMPLETED [%d]\n", pcbp->code);
492
+		if (pcbp->code >= 300)
493
+			return;
492 494
 	} else if(ntype == TMCB_LOCAL_RESPONSE_IN){
493 495
 		LM_NOTICE("RESPONSE [%d]\n", pcbp->code);
494 496
 		if (pcbp->code != 180 && pcbp->code != 183)
... ...
@@ -892,7 +894,13 @@ static int rms_bridge_f(struct sip_msg *msg, char *_target, char *_route)
892 894
 	if(!rms_str_dup(&a->param, &target, 1)) {
893 895
 		goto error;
894 896
 	}
895
-
897
+	if (a->param.s[a->param.len-1] != ';') {
898
+		a->param.s = shm_realloc(a->param.s, a->param.len + 2);
899
+		a->param.s[a->param.len]=';';
900
+		a->param.len++;
901
+		a->param.s[a->param.len]= '\0';
902
+		LM_NOTICE("remote >>> target[%.*s]\n", a->param.len, a->param.s);
903
+	}
896 904
 	a->route.len = route.len;
897 905
 	a->route.s = route.s;
898 906