Skip to content

Commit

Permalink
rtp_media_server: fix issue 2524
Browse files Browse the repository at this point in the history
- fix completion without failure route
- rms_bridge automaticaly append missing ';' is not present

(cherry picked from commit 2ea4f68)
  • Loading branch information
jchavanton authored and miconda committed Oct 26, 2020
1 parent dc2336f commit a5ee947
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/modules/rtp_media_server/docker/rtp_media_server.sh
Expand Up @@ -4,7 +4,7 @@ CONTAINER=rtp_media_server
IMAGE=rtp_media_server:latest
docker stop ${CONTAINER}
docker rm ${CONTAINER}
docker run -d --net=host --name=${CONTAINER} ${IMAGE} /bin/sh -c "tail -f /dev/null"
docker run -d --net=host --privileged --name=${CONTAINER} ${IMAGE} /bin/sh -c "tail -f /dev/null"

echo ""
echo "manual steps required to start Kamailio in the container:"
Expand All @@ -13,3 +13,8 @@ echo " set the listen IP in /etc/kamailio.cfg"
echo " docker exec -it rtp_media_server bash"
echo " kamailio -m 64 -D -dd -f /etc/kamailio.cfg"
echo ""

# ulimit -c unlimited
# echo "/tmp/core.%e.sig%s.%p" > /proc/sys/kernel/core_pattern
# sysctl -w kernel.core_pattern=core
# apt-get update && apt-get install -i gdb
10 changes: 9 additions & 1 deletion src/modules/rtp_media_server/rtp_media_server.c
Expand Up @@ -489,6 +489,8 @@ static void bridge_cb(struct cell *ptrans, int ntype, struct tmcb_params *pcbp)
return;
} else if(ntype == TMCB_LOCAL_COMPLETED) {
LM_NOTICE("COMPLETED [%d]\n", pcbp->code);
if (pcbp->code >= 300)
return;
} else if(ntype == TMCB_LOCAL_RESPONSE_IN){
LM_NOTICE("RESPONSE [%d]\n", pcbp->code);
if (pcbp->code != 180 && pcbp->code != 183)
Expand Down Expand Up @@ -892,7 +894,13 @@ static int rms_bridge_f(struct sip_msg *msg, char *_target, char *_route)
if(!rms_str_dup(&a->param, &target, 1)) {
goto error;
}

if (a->param.s[a->param.len-1] != ';') {
a->param.s = shm_realloc(a->param.s, a->param.len + 2);
a->param.s[a->param.len]=';';
a->param.len++;
a->param.s[a->param.len]= '\0';
LM_NOTICE("remote >>> target[%.*s]\n", a->param.len, a->param.s);
}
a->route.len = route.len;
a->route.s = route.s;

Expand Down

0 comments on commit a5ee947

Please sign in to comment.