In that example, Asterisk has nothing to do with AUTH. 1) opensips get the REGISTER and sends back a challange 2) opensips get the REGISTER with credentials 3) opensips does the auth and forwards the REGISTER to *
Regards, Bogdan Uwe Kastens wrote: > Hello Bogdan, > > Thank you for the example. In that case the asterisk have to accept the > registration without starting a auth itself? > > BR > > Uwe > > > Bogdan-Andrei Iancu schrieb: > >> 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 >>> >>> >>> >> _______________________________________________ >> Users mailing list >> Users@lists.opensips.org >> http://lists.opensips.org/cgi-bin/mailman/listinfo/users >> > > > _______________________________________________ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users