Evelin_195902
Aug 21, 2015Nimbostratus
SIP irule for checking dialed string
Hi guys, Please help me with creating na irule for checking a dialed string in SIP INVITE request. I need to drop every call that has !=8 or !=0 symbols in the SIP INVITE. Like this:
sip:3286184@206.81.166.10
I need to strip only "3286184" portion, then check if it has 8 or 0 symbols, if not I have to drop the call.
That's the irule I've made but it's not working for some reason...
when SIP_REQUEST {
set meeting_nbr [findstr [SIP::header "INVITE"] ":" 1 "@"]
if { not [string length $meeting_nbr] == 8} || { not [string length $meeting_nbr] == 0} {
log local0. "SIP Drop [SIP::uri]"
drop
}
}
Please help.
thanks.