Skip to main content

Login to queue dynamically from cell phone

Posted by diffen on Wed, 09/28/2011

Hello

I have created a small script that lets me login to a queue dynamically using AddQueueMember() from my cell phone. I also added a small authenticator so not everyone could that calls the number by misstake gets the queue calls.

Here are the script:
exten => s,1,Set(NUM=${IF($["${TL_MULTI}" != ""]?-2:-1)})
exten => s,2,Authenticate(${ARG2})
exten => s,n,AddQueueMember(${ARG1},SIP/${CALLERID(num)}@${tenant})
exten => s,n,Playback(agent-loginok)
exten => s,n,Hangup

Here is how the show queue queuename-tenant looks in the CLI:
SIP/cell phonenumber@tenant (dynamic) (Not in use) has taken no calls yet

Works pretty neat. I have two problems with it that i cant get on top of.

1. When i add this script to another tenant it looks different in the show queue queuename-tenant in the CLI. It looks like this:
SIP/cell phonenumber@tenant (dynamic) (Invalid) has taken no calls yet. How can it be that it says (Invalid) on one tenant but not on the fist one?

2. If I try to do a attendant transfer from my cell phone to number 90510, it shows this in the CLI:
-- Executing [90510@from-outside:1] Wait("Local/90510@from-outside-6108,2", "1") in new stack
-- Executing [90510@from-outside:2] Set("Local/90510@from-outside-6108,2", "__INCOMINGCLI=from number") in new stack
-- Executing [90510@from-outside:3] Goto("Local/90510@from-outside-6108,2", "from-outside-redir|90510|1") in new stack
-- Goto (from-outside-redir,90510,1)
[2011-09-28 14:53:12] WARNING[13512]: pbx.c:2474 __ast_pbx_run: Channel 'Local/90510@from-outside-6108,2' sent into invalid extension '90510' in context 'from-outside-redir', but no invalid handler

Are there anyway to get this working?


Submitted by eeman on Wed, 09/28/2011 Permalink

your cell phone number is not a registered sip channel so it shouldnt be working at all. You can do Local/cellPhoneNumber@from-inside-redir-tenant as your channel. You do realize the moment you fail to answer that call the customer is removed from the queue and sent to your cell phones voicemail right? If you were busy, got stopped by a cop and given a speeding ticket, or whatever, your customer isnt going to be left in queue for another available agent. If you are already on a call its still going to send that call to your cellphone and go to your voicemail instead of waiting in the queue. You can attempt to use ringinuse=no and hope it works well in chan_local (historically it didnt) as it required the use of the same call counter mechanism used for BLFs.

Submitted by diffen on Wed, 09/28/2011 Permalink

Hello,

So if I do exten => s,n,AddQueueMember(${ARG1},Local/${CALLERID(num)}@${tenant}) instead of exten => s,n,AddQueueMember(${ARG1},SIP/${CALLERID(num)}@${tenant}) it should work better?

Regarding that the call ends up in a voicemail for the cell phone and stuff like that, this isnt a solution that we recommend companies to use all the time. This is a solution for situation when you are alone at the office and need to go and do something outside the office. You can then quickly and easy add yourself to the queue and take calls, even if you already are on your way. Thats a lot better then letting the customers end up in a voicemail box on the server. I know that the BLFs and stuff like that doesnt work and thats fine.

The most important thing for small business is to answer the phones so they really like a solution like this. Today we are using agents but since its been removed in 1.6+ we need to find another way around this.

Submitted by eeman on Wed, 09/28/2011 Permalink

its not Local/${CALLERID(num)}@${tenant} its Local/${CALLERID(num)}@from-inside-redir${TL_DASH}${tenant}

Submitted by diffen on Wed, 09/28/2011 Permalink

Hello Erik,

Thanks for your help. It works really nice now with attendant transfer and so on :) Here are the two scripts if someone else wants to use them:

Log in:
exten => s,1,Set(NUM=${IF($["${TL_MULTI}" != ""]?-2:-1)})
exten => s,2,Authenticate(${ARG2})
exten => s,n,AddQueueMember(${ARG1},Local/${CALLERID(num)}@from-inside-redir${TL_DASH}${tenant})
exten => s,n,Playback(agent-loginok)
exten => s,n,Hangup

Arg1 = queue name
Arg2 = the password so no one could accidentally call the number and get logged on

Log out:
exten => s,1,Set(NUM=${IF($["${TL_MULTI}" != ""]?-2:-1)})
exten => s,n,RemoveQueueMember(${ARG1},Local/${CALLERID(num)}@from-inside-redir${TL_DASH}${tenant})
exten => s,n,Playback(agent-loggedoff)
exten => s,n,Hangup

We are setting up an IVR for every customer that wants this small feature and we explain for them that its only for situations when you are not at the office.

Regarding calls to the cell phone voicemail box we have found a way to work around that. In Sweden the operators have like 25 to 30 seconds before the call are redirected to the voicemail. We then sets the queue to call for 20 seconds then the customer have time to answer and dont need to worry about the voicemail. If the customer is busy on the cell phone we get back busy from the operators and the Asterisk keep the queued person in queue. Works fine.

The only thing we dont have is A-number in the cellphone when taking a call like this, but hey you cant get everything :)

Submitted by dozment on Thu, 01/19/2012 Permalink

I just noticed these scripts, and I think they will solve a problem for us. I've been using Agent Call Back Login, but understand that it is depracated. I need to think of a way to add a penalty to the mix so that an agent can log in from an external number using the correct penalty. For example, I stay logged into our support queue with a high penalty so that calls come to me if there is no one else available to take the call.

I guess we could prompt for the caller to enter an agent penalty when logging in.

The only other thing that I miss from the days of using Agent Call Back Login is having a name fro the agents. Using ACBL I can have an agent log in from any phone - including a cell phone - and I always know who that agent is. If the agents are logging in using this method they will have a different "name" whenever they log in. We are using OrderlyStats for a handful of our customers, and that will make it hard to define the agents there. I'll need to think about that a little....

Thanks for the scripts!

Submitted by The Godfather on Mon, 12/03/2012 Permalink

I know this is old but I was using this script to login myself into my call Q's and now this no longer works. Any idea if this is broken in Asterisk 1.8.11 cert 5?

Submitted by stephenkkaye on Fri, 07/05/2013 Permalink

Sorry for the very late response. Just started working on this again.. The only error I see when I do this is :

[2013-07-05 14:07:47] ERROR[1697]: netsock2.c:263 ast_sockaddr_resolve: getaddrinfo("VN", "(null)", ...): Name or service not known
[2013-07-05 14:07:47] WARNING[1697]: chan_sip.c:5512 create_addr: No such host: VN

Any help would be much appreciated.

Submitted by stephenkkaye on Fri, 07/05/2013 Permalink

I figured it out. Interestingly enough this was changed and it must have been done by someone maliciously because I am the only one that has leigitimate access to my system and no one else knows anything about it. Very scary.

,Local/${CALLERID(num)}@from-inside-redir${TL_DASH}${tenant})

That is how it is supposed to look.

,SIPl/${tenant})

Is what mine showed. Very interesting.