[OpenSIPS-Users] opensips forward register

info info at dcomms.net
Thu Apr 22 22:57:20 CEST 2010



Thanks that worked. 
One question though the IP registered to asterisk shows the openips IP address
is there any way to show the correct IP of the device or does it always have to go to the opensips ip




-----Original Message-----
From: users-bounces at lists.opensips.org on behalf of Laszlo
Sent: Thu 22/04/2010 21:42
To: OpenSIPS users mailling list
Subject: Re: [OpenSIPS-Users] opensips forward register
 
2010/4/22 Laszlo <laszlo at voipfreak.net>

>
>
> 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");
>

made a mistake here.
correctly it's: $du = "sip:192.168.10.2:5060";

           t_relay();
>            exit;
> }
>
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 3587 bytes
Desc: not available
Url : http://lists.opensips.org/pipermail/users/attachments/20100422/4112ad76/attachment-0001.bin 


More information about the Users mailing list