[asterisk-ha-clustering] load balance register on two or more servers

ronald nhadie at gmail.com
Mon Sep 1 06:53:35 CDT 2008


hi,

i think i'm getting somewhere (i hope) with this combo.

i have tried registering to the Virtual IP and i'm getting unauthorized.

i set sip debug to try and see the difference and found out i am missing 
this:

Authorization: Digest 
username="200200",realm="sip.mydomain.com",nonce="4cbc7dba",uri="sip:123.45.67.130",response="76dafea9c97c5d94506d1249b7fdafad",algorithm=MD5
Content-Length: 0

when i try to register my phone using the virtual ip of the ldirectord

but when i try to register using the actual ip address of the i can see 
that included on the REGISTER message. i am using x-lite.

any clues why the Authorization Part is not there when i use the Virtual IP?

TIA

Regards,
ronald


ronald wrote:
> Hi,
> 
> I used ultramonkey on my web as well and got it working, now my prob is 
> the sip part:
> 
> virtual=123.45.67.155:5060
>          real=123.45.67.130:5060 gate
>          real=123.45.67.131:5060 gate
>          service=sip
>          scheduler=rr
>          protocol=udp
>          checktype=negotiate
>          persistent=1
> 
> i defined that on ldirectord.cf, ipvsadm -L -n shows:
> 
> Prot LocalAddress:Port Scheduler Flags
>    -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
> TCP  123.45.67.155:443 rr persistent 600
>    -> 123.45.67.131:443           Route   1      1          0
>    -> 123.45.67.130:443           Route   1      0          0
> UDP  123.45.67.155:5060 rr persistent 1
> TCP  123.45.67.155:80 rr persistent 600
>    -> 123.45.67.130:80            Route   1      0          0
>    -> 123.45.67.131:80            Route   1      0          0
> 
> 
> is there something wrong with my config? or i'm still missing something?
> 
> regards,
> ronald
> 
> 
> 
> ronald wrote:
>> i tried to follow this instruction:
>>
>> http://blog.iclutton.com/2008/01/load-balancing-and-high-availablity.html
>>
>> but i changed the config to
>>
>> virtual=103.222.18.155:5060
>>         # first real server ip address, port, forwarding mecahnism, 
>> weight. masq -> NAT
>>         real=103.222.18.130:5060 masq 1
>>         # second real server ip address, port, forwarding mecahnism, 
>> weight. masq -> NAT
>>         real=103.222.18.131:5060 masq 1
>>
>> then i tried my phone to register on 103.222.18.155
>>
>> i looked t the sniff i always get these:
>>
>> U 103.222.18.130:5060 -> 103.222.18.156:32770
>>   SIP/2.0 404 Not Found..Via: SIP/2.0/UDP 
>> 103.222.18.156:32773;branch=z9hG4bKhjhs8ass877;received=103.222.18.156..From: 
>> <sip:ldirectord at dev-server-2>;tag=
>>   1928301774..To: <sip:ldirectord at dev-server-2>;tag=as58e3ee79..Call-ID: 
>> a84b4c76e66710..CSeq: 63104 OPTIONS..User-Agent: Asterisk PBX..Allow: 
>> INVITE, ACK
>>   , CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY..Supported: 
>> replaces..Accept: application/sdp..Content-Length: 0....
>> #
>> U 103.222.18.156:32773 -> 103.222.18.131:5060
>>   OPTIONS sip:ldirectord at dev-server-2 SIP/2.0..Via: SIP/2.0/UDP 
>> 103.222.18.156:32773;branch=z9hG4bKhjhs8ass877..Max-Forwards: 70..To: 
>> <sip:ldirectord at dev-
>>   server-2>..From: 
>> <sip:ldirectord at dev-server-2>;tag=1928301774..Call-ID: 
>> a84b4c76e66710..CSeq: 63104 OPTIONS..Contact: 
>> <sip:ldirectord at dev-server-2>..Acc
>>   ept: application/sdp..Content-Length: 0....
>>
>> #
>> U 103.222.18.131:5060 -> 103.222.18.156:32770
>>   SIP/2.0 404 Not Found..Via: SIP/2.0/UDP 
>> 103.222.18.156:32773;branch=z9hG4bKhjhs8ass877;received=103.222.18.156..From: 
>> <sip:ldirectord at dev-server-2>;tag=
>>   1928301774..To: <sip:ldirectord at dev-server-2>;tag=as2e6c3f7f..Call-ID: 
>> a84b4c76e66710..CSeq: 63104 OPTIONS..User-Agent: Asterisk PBX..Allow: 
>> INVITE, ACK
>>   , CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY..Supported: 
>> replaces..Accept: application/sdp..Content-Length: 0....
>> #
>> U 103.222.18.156:32773 -> 103.222.18.130:5060
>>   OPTIONS sip:ldirectord at dev-server-2 SIP/2.0..Via: SIP/2.0/UDP 
>> 103.222.18.156:32773;branch=z9hG4bKhjhs8ass877..Max-Forwards: 70..To: 
>> <sip:ldirectord at dev-
>>   server-2>..From: 
>> <sip:ldirectord at dev-server-2>;tag=1928301774..Call-ID: 
>> a84b4c76e66710..CSeq: 63104 OPTIONS..Contact: 
>> <sip:ldirectord at dev-server-2>..Acc
>>   ept: application/sdp..Content-Length: 0....
>>
>> #
>>
>> am i missing anything?
>>
>> regards,
>> ronald
>>
>>
>>
>>
>> ronald wrote:
>>> Hi,
>>>
>>> What is the basic thing i need to load balance users registering on 
>>> the server?
>>>
>>> i have 2 asterisk using realtime, i just need to simply update my dns 
>>> not to use round-robin so i will point my domain to a single IP (i 
>>> know you are wondering y, but i made a mistake on using dns 
>>> round-robin on my web application and i'm losing session when a user 
>>> logs in because of it, so i have load balance apache using mod_proxy 
>>> now i need to load balance asterisk) i know it's confusing but for now 
>>> my goal is to load balance the registration of users, if i do load 
>>> balance on register, will invite be affected? or the load balancer 
>>> should just simply forward it to the asterisk?
>>>
>>> thank you
>>>
>>> regards
>>> ronald
>>>
>>>
>>> _______________________________________________
>>> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>>>
>>> asterisk-ha-clustering mailing list
>>> To UNSUBSCRIBE or update options visit:
>>>    http://lists.digium.com/mailman/listinfo/asterisk-ha-clustering
>>>
> 
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
> 
> asterisk-ha-clustering mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-ha-clustering
> 



More information about the asterisk-ha-clustering mailing list