[OpenSIPS-Users] Block anonymous incoming calls

Michele Pinassi michele.pinassi at unisi.it
Wed Oct 5 11:31:06 CEST 2016


Hi all,

i'm trying to block anonymous incoming calls using userblacklist module:

    if (!check_user_blacklist("$rU", "$rd", "$fU")) {
        xlog("L_ERR","403 - Forbidden - Call blocked from $fU to $rU\n");
            sl_send_reply("403", "Forbidden");
        exit;
        }

and in userblacklist MySQL table i add:

username: 5002 [my number]

domain: voip [my domain]

prefix: anonymous

but don't work as expected. Log say:

Oct  5 11:12:00 proxy-voip01 /usr/sbin/opensips[2980]: b153ab3e2c30d38e
- User net group is 1
[172.20.1.5/sip:anonymous at 172.20.1.5:5060/voip/sip:5002 at voip:5060/172.20.1.5]
Oct  5 11:12:00 proxy-voip01 /usr/sbin/opensips[2980]: b153ab3e2c30d38e
- Destination for 5002 is voip
Oct  5 11:12:01 proxy-voip01 /usr/sbin/opensips[2980]: b153ab3e2c30d38e
- Route RELAY INVITE To: 5002, From: anonymous, RURI:
sip:5002 at 172.20.1.47:37496
Oct  5 11:12:01 proxy-voip01 /usr/sbin/opensips[2980]: b153ab3e2c30d38e
- Route NEW BRANCH To: 5002, From: anonymous, RURI:
sip:5002 at 172.20.1.47:37496

If i try to change "anonymous" with another number prefix, i.e. '333',
it works as expected:

Oct  5 11:11:08 proxy-voip01 /usr/sbin/opensips[2978]: d5d1d108325d3c69
- User net group is 1
[172.20.1.4/sip:333xxxxxxx at 172.20.1.4:5060/voip/sip:5002 at voip:5060/172.20.1.4]
Oct  5 11:11:08 proxy-voip01 /usr/sbin/opensips[2978]: d5d1d108325d3c69
- Destination for 5002 is voip
Oct  5 11:11:08 proxy-voip01 /usr/sbin/opensips[2978]: 403 - Forbidden -
Call blocked from 333xxxxxx to 5002

Any suggestions ?

Thanks, Michele

-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)5000 - centralino at unisi.it

Per trovare una soluzione rapida ai tuoi problemi tecnici consulta le FAQ di Ateneo, http://www.faq.unisi.it 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.opensips.org/pipermail/users/attachments/20161005/0f438772/attachment.pgp>


More information about the Users mailing list