[SR-Users] Asterisk realtime with kamailio Load balancing issue for sip user

Muhammad Shahzad shaheryarkh at gmail.com
Wed Mar 6 04:08:34 CET 2013


Sorry for delay, i was too busy with my work lately. Anyhow, I really doubt
the software architecture you mentioned would scale or even work in the
first place. Here is why,

1. You are registering same user <number-of-asterisk-instance> + 1 times,
so if you have two asterisk behind kamailio then a single user registers on
both asterisks as well as kamailio server. This is NOT load balancing but
wastage of resources instead. Asterisk's capacity as SIP registrar is much
much lower then kamailio, so whole system's capacity actually reduces down
to asterisk capacity instead of increasing above kamailio.

2. You are using stateless forwarding, which completely disables any
possibility of fail-over. Not only that, it will cause your calls kind
bounce around between asterisk instances. How? its simple, user A wants to
call user B, call comes to kamailio, which picks one asterisk instance
through dispatcher and route calls to asterisk. When call comes to
asterisk, it sees that user B is registered on kamailio, so it tries to
forward call to kamailio. When call comes to kamailio, kamailio again picks
next asterisk (due to round robin rule you are using) and send call to that
asterisk, which again does the same thing as first asterisk, so call
bounces between kamailio and all asterisk instance one by one till
dispatcher list exhausts and eventually call is dropped. You may try to
stop this by correcting DISPATCHER and FROMASTERISK routes but i guess call
will still loop at least once.

The solution is simple, forget asterisk realtime integration, use kamailio
as registrar and proxy. Use asterisk instances as services bridge which are
load balanced by kamailio through dispatcher.

Hope this helps.

Thank you.


On Tue, Mar 5, 2013 at 4:39 PM, Prakash N <prakash.n at tevatel.com> wrote:

> Hi,
>
>     I am facing some challenge with dispatcher configuration with two
> Asterisk
>
>     I have installed Kamailio and  two Asterisk server  and Phones
> are register with Asterisk through Kamailio
>     I have followed this link
> http://lists.sip-router.org/pipermail/sr-users/2011-April/068175.html
>
>     Now  i have added dispatcher module and dispatcher list also
>
>     I am try to route all calls to Asterisk with load balance
>
>   Can please advice the step by step configuration to route calls  from
> Kamailio   to two Asterisk ( one call first Asterisk and Second call to
> other asterisk )
>
> With Regards
>
> N.Prakash
>
>
>
> On Mon, Mar 4, 2013 at 10:03 AM, Prakash N <prakash.n at tevatel.com> wrote:
>
>>
>> Hi Muhammad,
>>
>> We are following below document for Kamailio and Asterisk integration
>>
>>
>> http://kb.asipto.com/asterisk:realtime:kamailio-3.3.x-asterisk-10.7.0-astdb
>>
>>
>>
>> We are plan use one Kamailio with Multiple asterisk  (Queue,IVR
>> and Conference purpose)
>>
>>
>> Now calls are landing to asterisk with load balancing using  dispatcher
>> for Queue and IVR (One asterisk first and next Asterisk for second calls )
>>
>> But if try to calls extension it is landing both Asterisk server instead
>> landing one asterisk first and next Asterisk for second calls
>>
>> Please advice
>>
>> With Regards
>>
>> N.Prakash
>>
>>
>>
>> On Sat, Mar 2, 2013 at 7:07 PM, Muhammad Shahzad <shaheryarkh at gmail.com>wrote:
>>
>>> I am not sure what you are trying to do. Your description is too brief
>>> to understand. Can you send me complete call flow?
>>>
>>> Thank you.
>>>
>>>
>>> On Sat, Mar 2, 2013 at 2:18 PM, Prakash N <prakash.n at tevatel.com> wrote:
>>>
>>>>
>>>>    Hi Muhammad,
>>>>
>>>>     Thanks for your mail
>>>>
>>>>    Actually we are trying to do load balance with one Kamailio
>>>> with multiple Asterisk  server
>>>>
>>>>    Now if call Queue,IVR to Kamailio it routing to asterisk
>>>> with ramdam strategy load balance  ( first call on one and second to other
>>>> server )
>>>>   If i call extension to extension it is landing to all Asterisk ( I
>>>> have use all Asterisk feature for that i want to route all call to asterisk
>>>> ) on the same time ,How to do load balance  for extension calling also
>>>>
>>>> We are not sure what we are tiring  doi is right or wrong
>>>>
>>>> Please advice and correct us if anything wrong
>>>>
>>>> With Regards
>>>>
>>>> N.Prakash
>>>>
>>>>
>>>>
>>>> On Sat, Mar 2, 2013 at 6:30 PM, Muhammad Shahzad <shaheryarkh at gmail.com
>>>> > wrote:
>>>>
>>>>> Why are you forwarding instead of relaying the message to selected
>>>>> destination? Forward is stateless and therefore likely to have NAT issues,
>>>>> specially if destination server is behind NAT or client is behind NAT and
>>>>> destination server is unable to handle NAT etc. etc.
>>>>>
>>>>> Also typically dispatcher is used to load balance calls between two or
>>>>> more upstream server, not for load balancing extensions within one server,
>>>>> though with some tweaking that might also be achieved but better to do this
>>>>> kind of thing on destination server rather then on kamailio.
>>>>>
>>>>> Thank you.
>>>>>
>>>>>
>>>>> On Sat, Mar 2, 2013 at 10:31 AM, Prakash N <prakash.n at tevatel.com>wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>>   Can you please advice for the below issue
>>>>>>
>>>>>> With Regards
>>>>>>
>>>>>> N.Prakash
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Fri, Mar 1, 2013 at 9:32 AM, Prakash N <prakash.n at tevatel.com>wrote:
>>>>>>
>>>>>>> Hi All,
>>>>>>>
>>>>>>> We have finished the Kamailio & Asterisk real time integration and
>>>>>>> load balancing also done using dispatcher module.
>>>>>>>
>>>>>>> Queue and voice mails are load balancing as well.When we are calling
>>>>>>> extension to extension it is showing in all the servers.It seems extension
>>>>>>> are not load balancing as per our knowledge.
>>>>>>>
>>>>>>> I have attached the kamailio.cfg for your reference,Find
>>>>>>> my coding below as mentioned.
>>>>>>>
>>>>>>> *# -- dispatcher params for DB support --*
>>>>>>> *modparam("dispatcher","db_url", "mysql://
>>>>>>> openser:openserrw at 192.168.1.170/openser")*
>>>>>>> *modparam("dispatcher", "table_name", "dispatcher")*
>>>>>>> *modparam("dispatcher", "setid_col", "setid")*
>>>>>>> *modparam("dispatcher", "destination_col", "destination")*
>>>>>>> *modparam("dispatcher", "flags_col", "flags")*
>>>>>>> *modparam("dispatcher", "priority_col", "priority")*
>>>>>>> *
>>>>>>> *
>>>>>>> *
>>>>>>> -----------------------------------------------------------------------------------------
>>>>>>> *
>>>>>>> *# Dispatch requests*
>>>>>>> *route[DISPATCH] {*
>>>>>>> *if ( method=="INVITE" ) {*
>>>>>>> *# dst_select( "GROUP", "HASH METHOD")*
>>>>>>> *  ds_select_dst("1","4");*
>>>>>>> *  sl_send_reply("100","Trying");*
>>>>>>> *  forward();#uri:host, uri:port);*
>>>>>>> *  exit();*
>>>>>>> *}}*
>>>>>>>
>>>>>>> Kindly suggest the solution for the same.
>>>>>>>
>>>>>>> Thanks in advance.
>>>>>>>
>>>>>>> Regards,
>>>>>>>
>>>>>>> N.Prakash
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Muhammad Shahzad
>>>>> -----------------------------------
>>>>> CISCO Rich Media Communication Specialist (CRMCS)
>>>>> CISCO Certified Network Associate (CCNA)
>>>>> Cell: +49 176 99 83 10 85
>>>>> MSN: shari_786pk at hotmail.com
>>>>> Email: shaheryarkh at googlemail.com
>>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Muhammad Shahzad
>>> -----------------------------------
>>> CISCO Rich Media Communication Specialist (CRMCS)
>>> CISCO Certified Network Associate (CCNA)
>>> Cell: +49 176 99 83 10 85
>>> MSN: shari_786pk at hotmail.com
>>> Email: shaheryarkh at googlemail.com
>>>
>>
>>
>


-- 
Muhammad Shahzad
-----------------------------------
CISCO Rich Media Communication Specialist (CRMCS)
CISCO Certified Network Associate (CCNA)
Cell: +49 176 99 83 10 85
MSN: shari_786pk at hotmail.com
Email: shaheryarkh at googlemail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20130306/f873a7a3/attachment-0001.htm>


More information about the sr-users mailing list