Module: kamailio
Branch: master
Commit: f2f3c57c2a9bc4bcdc829aaab743427cb349b7ab
URL:
https://github.com/kamailio/kamailio/commit/f2f3c57c2a9bc4bcdc829aaab743427…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-04-02T17:06:58+02:00
spdops: added $sdp(m0:rtp:port) - port of first media stream
---
Modified: src/modules/sdpops/sdpops_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/f2f3c57c2a9bc4bcdc829aaab743427…
Patch:
https://github.com/kamailio/kamailio/commit/f2f3c57c2a9bc4bcdc829aaab743427…
---
diff --git a/src/modules/sdpops/sdpops_mod.c b/src/modules/sdpops/sdpops_mod.c
index 980c275068b..63243c3c3f6 100644
--- a/src/modules/sdpops/sdpops_mod.c
+++ b/src/modules/sdpops/sdpops_mod.c
@@ -2125,6 +2125,20 @@ static int pv_get_sdp(sip_msg_t *msg, pv_param_t *param, pv_value_t
*res)
}
}
}
+ case 4:
+ /* m0:rtp:port */
+ if(sdp->sessions == NULL) {
+ return pv_get_null(msg, param, res);
+ }
+ if(sdp->sessions->streams == NULL) {
+ return pv_get_null(msg, param, res);
+ }
+ if(sdp->sessions->streams->port.s != NULL
+ && sdp->sessions->streams->port.len > 0) {
+ return pv_get_strval(
+ msg, param, res, &sdp->sessions->streams->port);
+ }
+ return pv_get_null(msg, param, res);
default:
return pv_get_null(msg, param, res);
@@ -2178,6 +2192,12 @@ static int pv_parse_sdp_name(pv_spec_p sp, str *in)
else
goto error;
break;
+ case 11:
+ if(strncmp(in->s, "m0:rtp:port", 11) == 0)
+ sp->pvp.pvn.u.isname.name.n = 4;
+ else
+ goto error;
+ break;
case 12:
if(strncmp(in->s, "sess_version", 12) == 0)
sp->pvp.pvn.u.isname.name.n = 1;