Discussion:
[SR-Users] Need help in how to read INVITE packet SDP c line IP Address
varun pratapsingh
2014-09-12 17:00:13 UTC
Permalink
Hi All,

Can anybody help me by telling how to read INVITE packet SDP c line IP
address in Kamailio.cfg. For example a INVITE packet comes and its SDP
contains the line

v=0
o=- 3619547086 3619547086 IN IP4 1.223.65.215
s=pjmedia
c=IN IP4 1.223.65.215
t=0 0
a=X-nat:0


Now I want to read this SDP packet c line IP address and want to put the IP
1.223.65.215 in a variable.

Can anybody please help me out in this.


Regards
Varun
Narsay, Deep
2014-09-12 19:05:29 UTC
Permalink
Varun,

You can use sdpops
<http://kamailio.org/docs/modules/4.1.x/modules/sdpops.html> module.

See details for this function:
sdp_get_line_startswith(avpvar, string)

Sample code:
if(sdp_get_line_startswith("$avp(cline)", "c="))
{
xlog("connection-line: $avp(cline)\n");
}

http://kamailio.org/docs/modules/4.1.x/modules/sdpops.html


-Deep Narsay
Post by varun pratapsingh
Hi All,
Can anybody help me by telling how to read INVITE packet SDP c line IP
address in Kamailio.cfg. For example a INVITE packet comes and its SDP
contains the line
v=0
o=- 3619547086 3619547086 IN IP4 1.223.65.215
s=pjmedia
c=IN IP4 1.223.65.215
t=0 0
a=X-nat:0
Now I want to read this SDP packet c line IP address and want to put the
IP 1.223.65.215 in a variable.
Can anybody please help me out in this.
Regards
Varun
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Loading...