[SR-Users] Media address family

Mikko Lehto mslehto at iki.fi
Fri Nov 27 10:13:47 CET 2015


Sergey Okhapkin <sos at 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_line_startswith

Be aware that SDP can have multiple c-lines, so you propably want
to scan SDP more extensively.


Best regards
-- 
Mikko Lehto



More information about the sr-users mailing list