I am receiving INVITEs from a specific source, and I have a need
to test the media IP address specified in the SDP payload against
a list of approved netblocks. I'd like to catch this in the
INVITE and reject the call if a RTP address in the SDP payload is
out of a pre-defined range for that given source.
Is there a way to get this address into a variable that can be
used in "if" statements? As in something like this?
if (src_ip==17.18.19.20 && method=="INVITE") {
if (rtp_addr!=17.0.0.0/8) {
sl_reply("502", "Rejected - Unauthorized RTP source");
drop;
}
}
with rtp_addr being the made-up, hope-something-like-it-exists
thing.
Thanks in advance.