[OpenSIPS-Users] Stop INVITE from uknown source
    Satish Patel 
    satish.txt at gmail.com
       
    Fri Feb 13 16:07:21 CET 2015
    
    
  
I have question about how to stop INVITE coming from unknown source or not
subscribed user.
I have opensips front end proxy and Freeswitch PSTN
But recently i have seeing some calls coming from unknown source and method
is INVITE so it is sending direct INVITE to opensips and opensips
forwarding them to Freeswitch, How do i tell opensip if INVITE from
non-registered user then drop it.
As you see in Freeswitch section, if you see INVITE forward it to
Freeswitch, How do i check INVITE is authenticated or not?
This is what i have in cfg.
....
....
 if (is_from_local())
                {
                        # authenticate if from local subscriber
                        # authenticate all initial non-REGISTER request
that pretend to be
                        # generated by local subscriber (domain from FROM
URI is local)
                        if (!check_source_address("2")) {
                        if (!proxy_authorize("", "subscriber")) {
                                proxy_challenge("", "0");
                                exit;
                        }
                        consume_credentials();
                        # caller authenticated
                        }
                } else {
                        # if caller is not local, then called number must
be local
                        if (!is_uri_host_local()) {
                                send_reply("403","Rely forbidden");
                                exit;
                        }
                }
        }
 # To FreeSWITCH
        if (is_method("INVITE")) {
        if  ( uri=~"^sip:[1-9][0-9]{10,15}@.*") {
                xlog("Sending call to   ===> Freeswitch\n");
                route("to_dispatcher");
                exit;
                };
        }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20150213/478d0828/attachment.htm>
    
    
More information about the Users
mailing list