[OpenSIPS-Users] mid_registrar and Asterisk: OPTIONS
    vasilevalex 
    alexei.vasilyev at gmail.com
       
    Tue Jun 26 01:56:32 EDT 2018
    
    
  
Hi Alexey.
We are using the same configuration. This part of route script:
 # Routing messages initiated from Asterisk PBX servers
        if (is_method("INVITE|OPTIONS|NOTIFY") && check_source_address("1"))
{
                 if (mid_registrar_lookup("location")) {
                        route(rtpengine);
                } else if (mid_registrar_lookup("location_inet6")) {
                        route(rtpengine6);
                } else {
                        t_reply("404", "Not Found");
                }
                exit;
        }
So as Asterisk servers don't know about proxy, we need to check permissions
(auth them by IP). Then I check if phone using IPv4 or IPv6 to call
RTPEngine with correct parameters. If you have just IPv4 and no media
proxying, so code will be just like this:
if (is_method("INVITE|OPTIONS|NOTIFY") && check_source_address("1")) {
        if (mid_registrar_lookup("location")) {
                route(relay);
        } else {
                t_reply("404", "Not Found");
        }
        exit;
}
Asterisk servers see all endpoints from one IP address - OpenSIPS IP, but
with real status.
--
Sent from: http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html
    
    
More information about the Users
mailing list