[OpenSIPS-Users] opensips with asterisk => relay REGISTER

Bogdan-Andrei Iancu bogdan at voice-system.ro
Tue Sep 15 16:58:04 CEST 2009


Hi Uwe,

If you look at the default opensips script, you have a section (by 
default commented out) where the REGISTER requests are authenticated and 
if passing the auth doing save("location").

What you have to do is, after the REGISTER auth, instead of pushing the 
REGISTER to the local registrar (via save()), simply forward it further 
to Asterisk:


 if (is_method("REGISTER"))   {
        # authenticate the REGISTER requests
        if (!www_authorize("", "subscriber")) {
            www_challenge("", "0");
            exit;
        }
       
        if (!check_to()) {
            sl_send_reply("403","Forbidden auth ID");
            exit;
        }

        # auth done -> send it to registrar
        consume_credentials();
        $du = "sip:ASTERISK_IP:ASTERISK_PORT";
        t_relay();

        exit;
    }


Regards,
Bogdan


Uwe Kastens wrote:
> Hello,
>
> Has anybody a starting point for me to achieve the following:
>
> UAC should register with asterisk put should be "pre-authorized" with
> opensips. I saw an EMail from Bogdan, that this should be possible but
> ATM I could only use opensips as a registrar or route all sip messages
> through opensips.
>
> Anyone has maybe a hint where to start or maybe an example?
>
> BR
>
> Uwe
>
>   




More information about the Users mailing list