Solving:Transferring Calls from Queues, Agents stay busy
The subject doesn’t really describe the problem good enough. So here it is… basically you have agents (whether you are using AgentCallBackLogin, or a setup like my alternative.) The problem was that if the Agent transferred the call to another agent, Asterisk qould still show the agent has ‘busy.’ If you listed channels, it would even show the first Agent involved in the call. Keep in mind, which seemed to know be a problem if it was an attended transfer. (Or for us of us, we like to use the ‘xfer’ botton on our IP Phones… it was a problem then too.) Well, it’s no longer a problem. You can find the solution below…
Keep in mind this will only working with 1.4.23 or higher. It was originally only added to 1.6, but the community decided it was needed as a backport into 1.4. I hope this is helpful to someone. It took me 3 days of googling to find a working solution. Suspense is killing you I know. The answer is state_interface. This basically allows you to set which device/extension to watch. With AgentCallBackLogin and my alternative using Local Extensions, you still have to tell everyone which SIP or IAX phone/device the agent is sitting at. When this value is placed in the state_interface, Asterisk will check that device to determine if the agent is indeed ‘busy.’ Clever huh? Here’s how to set it up…
Using Asterisk Realtime – Queue Members
If you using Asterisk Realtime queue_members, you will need to modify the table structure just a bit. You will need to add a column ‘state_interface’ after the ‘pause’ column. So your table will look something like this:
CREATE TABLE IF NOT EXISTS `queue_members` (
`uniqueid` int(10) unsigned NOT NULL auto_increment,
`membername` varchar(40) default NULL,
`queue_name` varchar(128) default NULL,
`interface` varchar(128) default NULL,
`penalty` int(11) default NULL,
`paused` int(1) default NULL,
`state_interface` varchar(128) NOT NULL,
PRIMARY KEY (`uniqueid`),
UNIQUE KEY `queue_interface` (`queue_name`,`interface`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=23 ;
Then when you add your agents to the table, make sure you set the state_interface. Example:
INSERT INTO `queue_members` (`uniqueid`, `membername`, `queue_name`, `interface`, `penalty`, `paused`, `state_interface`) VALUES
(23, ‘Robert’, ‘CSR1′, ‘local/1005@agents/n’, 5, NULL, ‘SIP/100′);
Robert is logged into CSR1 queue with his local extension being: local/1005@agents/n, but he’s on device SIP/100. Asterisk will be checking SIP/100 for the device status. Is he really ‘busy’ after that call transfer? Probably not.
Using AddQueueMember
In my alternative and some of the examples on voip-info.org, you use AddQueueMember. Well, if you are already running the required version, you probably noted the additions. Layout looks like this:
AddQueueMember(queuename[,interface[,penalty[,options[,membername[,stateinterface]]]]]))
So, using the same info as my previous example, I would create the following in my dialplan:
exten => 701, 1,AddQueueMember(CSR1|local/1005@agents/n|5||Robert|SIP/100)
Using Asterisk CLi
Of course, you can always add the member by CLi:
add queue member local/1005@agents/n to CSR1 as Robert state_interface SIP/100
I hope this has helped someone. I know it was a big pain for us for a long time. And I spent a good amount of time searching for a solution. Well, now you have a solution!