[OpenSIPS-Users] opensips forward register
Laszlo
laszlo at voipfreak.net
Thu Apr 22 22:39:59 CEST 2010
2010/4/22 dcomms <info at dcomms.net>
>
> Hi,
> I have configure the load balancer as per opensips
> http://www.opensips.org/Resources/DocsTutLoadbalancing
>
> My question is how can i forward registration requests to asterisk. What am
> i doing wrong
>
> Thanks
>
>
> if (is_method("REGISTER")) {
> # authenticate the REGISTER requests
> if (!www_authorize("", "subscriber")) {
> www_challenge("", "0");
> exit;
> }
>
> if (!db_check_to()) {
> sl_send_reply("403","Forbidden auth ID");
> exit;
> }
>
> # auth done -> send it to registrar
> consume_credentials();
> # rewritehostport("192.168.10.2:5060");
>
> if (!save("location")) {
> log(1,"Location Error\n");
> sl_reply_error();
> };
>
>
> log(1,"Trying to Save location\n");
>
>
> t_relay();
>
> exit;
> }
>
>
>
>
Something like this:
if (is_method("REGISTER")) {
# authenticate the REGISTER requests
if (!www_authorize("", "subscriber")) {
www_challenge("", "0");
exit;
}
if (!db_check_to()) {
sl_send_reply("403","Forbidden auth ID");
exit;
}
# auth done -> send it to registrar
consume_credentials();
$du="sip:192.168.10.2:5060");
t_relay();
exit;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20100422/ea6a54e4/attachment.htm
More information about the Users
mailing list