Module: kamailio
Branch: master
Commit: 3e73dbc6b69c8e26f276690bb6aa1e6db380510e
URL: 
https://github.com/kamailio/kamailio/commit/3e73dbc6b69c8e26f276690bb6aa1e6db380510e

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2024-04-03T19:19:27+02:00

sdpops: added $sdp(m0:raw) - get all lines of the first m= stream

---

Modified: src/modules/sdpops/sdpops_mod.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/3e73dbc6b69c8e26f276690bb6aa1e6db380510e.diff
Patch: 
https://github.com/kamailio/kamailio/commit/3e73dbc6b69c8e26f276690bb6aa1e6db380510e.patch

---

diff --git a/src/modules/sdpops/sdpops_mod.c b/src/modules/sdpops/sdpops_mod.c
index b7ee2482616..b443d1f84ac 100644
--- a/src/modules/sdpops/sdpops_mod.c
+++ b/src/modules/sdpops/sdpops_mod.c
@@ -2201,6 +2201,21 @@ static int pv_get_sdp(sip_msg_t *msg, pv_param_t *param, 
pv_value_t *res)
                                        }
                                }
                        }
+               case 7:
+                       /* m0:raw - all (raw) lines for m0 stream */
+                       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->raw_stream.s != NULL
+                                       && 
sdp->sessions->streams->raw_stream.len > 0) {
+                               return pv_get_strval(
+                                               msg, param, res, 
&sdp->sessions->streams->raw_stream);
+                       }
+                       return pv_get_null(msg, param, res);
+                       break;
 
                default:
                        return pv_get_null(msg, param, res);
@@ -2256,6 +2271,12 @@ static int pv_parse_sdp_name(pv_spec_p sp, str *in)
                        else
                                goto error;
                        break;
+               case 6:
+                       if(strncmp(in->s, "m0:raw", 6) == 0)
+                               sp->pvp.pvn.u.isname.name.n = 7;
+                       else
+                               goto error;
+                       break;
                case 11:
                        if(strncmp(in->s, "m0:rtp:port", 11) == 0)
                                sp->pvp.pvn.u.isname.name.n = 4;

_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org

Reply via email to