Open Source - How to share queues with two or more Asterisk systems

Open Source - How to share queues with two or more Asterisk systems

 

rtaImage.png

The call flow works like this: The user dials 6300 to the Secondary server. The Secondary server then opens a connection to the IAX server registered as "primary-server" and executes extension 6300. On the Primary server, extension 6300 executes the Asterisk application AddQueueMember which adds a Queue agent. That agent is mapped back to the Secondary server via IAX, with the extension pulled from the callerid of the SIP peer that originally dialed to log in.

Configuration steps:

  1. The Asterisk servers must register to one another.

Create an IAX peer related to the other server in the /etc/asterisk/iax.conf file, and then register them to one another: 

Example Configuration: Primary Server  /etc/asterisk/iax.conf

 

[general] 

...

register => primary-server:test@<secondary server ip address> 

...

[secondary-server] 

type=friend 

host=dynamic 

secret=<Password>

context=<Incoming context>

 

Example Configuration: Secondary Server  /etc/asterisk/iax.conf

 

[general] 

... 

register => secondary-server:test@<primary server ip address> 

...

[primary-server] 

type=friend 

host=dynamic 

secret=<Password>

context=<Incoming context>

 

  1. Create a queue on the Primary server

Example Configuration Queue /etc/asterisk/queues.conf)

 

[queue] 

strategy=rrmemory 

wrapuptime=15 

 

  1. On the Secondary server, create extensions that queue memebers will dial in order to log in and out of the queue. These extensions dial the Primary Asterisk server via IAX and execute an extension on the Primary server that logs the user into the queue. 

Example Configuration: Primary Server  /etc/asterisk/externsion.conf

 

exten => 6300,1,AddQueueMember(queue1,IAX2/secondary-server/${CALLERID(num)}) 

exten => 6301,1,RemoveQueueMember(queue1,IAX2/secondary-server/${CALLERID(num)}) 
 

Example Configuration: Secondary Server  /etc/asterisk/externsion.conf

exten => 6300,1,Dial(IAX2/primary-server/6300) 

same => n,Hangup() 

exten => 6301,1,Dial(IAX2/primary-server/6301) 

same => n,Hangup() 

 

  1. To set the specific CallerID of the SIP peer, that change is made in the /etc/asterisk/sip.conf file that defines the SIP peer in Asterisk. This is done on the Secondary Server: 

 

Example Configuration: Secondary Server  /etc/asterisk/sip.conf
 

[QueueMember1] 

type=friend 

username=qm001 

secret=10101019 

host=dynamic 

context=test 

callerid=200 

mailbox=200 

  1. The CallerID setting must refer to the extension in extensions.conf on the Secondary server that rings the SIP peer: 

Example Configuration: Secondary Server  /etc/asterisk/sip.conf
 

[<Incoming context>] 

 

exten => 200,1,Dial(SIP/QueueMember1) 

...

same => n,Hangup()