[Serusers] Preventing unregistered users from calling
Maxim Sobolev
sobomax at FreeBSD.org
Thu Jan 9 21:14:02 CET 2003
On Thu, Jan 09, 2003 at 05:56:35PM -0200, Claudio Thorell dos Santos wrote:
> Hello,
>
> I wanted to configure ser so that only registered user are allowed to make calls. I have set up digest authentication but still unregistered users can make calls. I wonder if I'm missing something on my config file (as attached below).
>
> Could someone please tell me what am I doing wrong, or provide me some configuration example on solving this issue?
Try to move `if (method=="INVITE")' check outside of `if (method=="REGISTER")'
check, because otherwise it is never executed, as the method could not be
REGISTER and INVITE at the same time, i.e.:
if (method=="REGISTER") {
if (!www_authorize("<my_ip>", "subscriber")) {
www_challenge("<my_ip>", "0");
break;
};
save("location");
break;
}
if (method=="INVITE" & !check_from()) {
sl_send_reply("403","Forbidden");
break;
}
-Maxim
>
> Thanks and regards,
> Claudio
>
> ###########
> ser.conf
> ###########
>
> route{
>
>
> # Do strict routing if pre-loaded route headers present
> rewriteFromRoute();
>
> if (uri==myself) {
>
> if (method=="REGISTER") {
>
> if (!www_authorize("<my_ip>", "subscriber")) {
> www_challenge("<my_ip>", "0");
> break;
> };
>
> if (method=="INVITE" & !check_from()) {
> sl_send_reply("403","Forbidden");
> break;
> };
>
> save("location");
> break;
> };
>
> # native SIP destinations are handled using our USRLOC DB
> if (!lookup("location")) {
> sl_send_reply("404", "Not Found");
> break;
> };
> };
> # forward to current uri now
> if (!t_relay()) {
> sl_reply_error();
> };
>
> }
>
> ##########
>
>
More information about the sr-users
mailing list