What is the best way to find out address family (IPV4 or IPV6) of media in SDP? My goal is to reject INVITEs which have different address families in headers and SDP, i.e. IPv4 INVITE with IPv6 media address in SDP and vice versa.
Sergey Okhapkin sos@sokhapkin.dyndns.org:
What is the best way to find out address family (IPV4 or IPV6) of media in SDP?
Hi, maybe something like this works:
if(sdp_get_line_startswith("$avp(cline)", "c=IN IP6")) { xlog("c-line: $avp(cline)\n"); }
I did not test, just copy-pasted from documentation: http://kamailio.org/docs/modules/devel/modules/sdpops.html#sdpops.f.sdp_get_...
Be aware that SDP can have multiple c-lines, so you propably want to scan SDP more extensively.
Best regards
Sergey Okhapkin wrote
What is the best way to find out address family (IPV4 or IPV6) of media in SDP? My goal is to reject INVITEs which have different address families in headers and SDP, i.e. IPv4 INVITE with IPv6 media address in SDP and vice versa.
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@.sip-router
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
you can use this function: http://kamailio.org/docs/modules/4.2.x/modules/textops.html#textops.f.search...
e.g. if (search_body("c=IN IP4")) ...
cheers
-- View this message in context: http://sip-router.1086192.n5.nabble.com/Media-address-family-tp143489p143505... Sent from the Users mailing list archive at Nabble.com.