I want to build an asterisk cluster from 3 asterisk (13.x) nodes, one on US, one in Europe and one is Asia. Right now I have the 3 servers. Asterisk is using realtime infrastructure for sip/iax users, queues, cdr, cel, queue_logs. All users are using SIP and softphones.
Databases are replicated with a Master <==> Master solution so basically I have the "same" database on all locations and the datas are replicated realtime (1-2 minutes as the servers are far far away one from another).
Due to the fact that the queues table is replicated I have all queues on all locations, and this is the desired behavior as one server is backup for another.
What I want to accomplish is that no matter where a call is routed, to one of these 3 server the "system" should be able to find the available agents from that queue and ring to their device, no matter where the agent is logged in.
In order to replicate device states I have used Openfire XMPP, but here I have some discrepancies as often an user has different states in a specific queue on different servers.
ie. I have agent Adrian realtime IN_USE on one server where he is in call and realtime NOT_IN_USE on other server. The problem here is that if a calls arives in that queue in the second server this will try to place call to Adrian, not knowing that he is already in call. Due to this it will stress adrian as it will ring on 2nd line of softphone and the call is not going to other available agent.
I suspect that the issues are generated by the fact that I have all queues on all servers so that states are somehow altered by that.
I saw that there are setups where there is a dedicated queue server. Why is that ? to avoid this kind of issues or for load distribution ?
What is the recommended approach for asterisk clustering with a shared database scenario ?
Any thoughts on how can I achieve that ?
P.S. I have enabled callcounters in sip.com
Updates:
Indeed the term cluster is not proper used here. I guess that the ideal scenario would be to have a cluster of two asterisk server on each location (active-pasive with failover detection) and after that layer to have a higher one that balance the call between these locations.
The main problem that I have now is that I have these 3 locations and I share queues between them (as they all has the same database). Let's say that queue named TestQueue has 15 users, 5 on every location (the team is split in 3). What I want to accomplish is that no matter on what server a call enters the queue to be able to reach all available agents (and determine which are busy and which not).
I`m not sure if my approach is OK, or I should have one asterisk server used to host the queue and other 3 servers where the users will register (with xmpp sync status between queue server and register servers).