1. Tutorial: Reverse preview dialing made easy

    Preview dialing is a type of reverse dialing available since WombatDialer 0.7.0 where the agent has a chance to “preview” the number that is to be called before actually having a call placed.

    The way it works is:

    • The agent logs on to a queue. WombatDialer uses the queue (as it usually does in Reverse dialing modes) to know which agents are available. This makes integration with QueueMetrics very easy.
    • The agent asks WombatDialer for a number to call. WombatDialer gets the next number out - considering all its dialing and reschedule rules - and reserves it for the agent.
    • The agent uses a GUI where they can see the number to be dialed and typically embeds, or links to, an external CRM app so that they can review the call
    • When the agent is ready, they ask for the call to be either placed or skipped.
    • If the call is to be placed, the agent is connected immediatately and listens to Music on Hold until the callee is on line
    • If the call is not to be placed, it is maked with a special code
    • Reschedule rules apply - so error states are handled correctly

    Step 1: Installing Elastix

    In order to run this tutorial, we install a brand-new Elastix 2.4 system. On it we create:

    • Three SIP extensions: 300, 301 and 302. We will use 302 as the agent extension while 301 and 300 will be used as sample end-points
    • One queue, called “400”, to hold our agent. Note that calls will NOT be processed through the queue but we will use the queue to keep track of which agents are available. When defining it, we make sure that we set: “Ring Strategy: rrmemory” - “Event when called: yes” - “Member status: yes” so that WombatDialer can fully observe it.

    Step 2: Installing WombatDialer

    We install WombatDialer on the Elastix system using yum. When we log in, we create:

    • An Asterisk server that can talk to Elastix. We can use the AMI user “admin” with the default password you gave during the system installation.
    • A trunk named named “Trunk”, which dial string will be Local/${num}@from-internal
    • An end-point of type QUEUE, which name is “400” (so that it observes queue 400), located at extension “400” context “from-internal” (this is not really needed if you run only reverse campaigns), setting both “Reverse dialing: yes” and “Manual preview: yes”
    • We create a list called “Numbers” and leave it blank for now
    • We create a campaign called “Reverse”, which has logging set as “QM_COMPATIBLE” and which logging code is “400”. We add to it the trunk, the EP and the list we just created.

    Now we go to the list manager and upload the following list:

    300,NAME:John
    301,NAME:Mike
    

    This tells WD to dial numbers 300 and 301, and sets a NAME attribute for each call (that will be useful when previewing).

    Step 3: Installing and configuring QueueMetrics

    Install QueueMetrics on the same machine as the Elastix system by typing:

    yum install queuemetrics-espresso
    

    Now log in into QM and configure:

    • An agent called agent/302
    • A user for agent 302 called “agent/302” password “999” class “AGENTS”
    • A general monitoring queue called “400”. Set agent/302 in the MAIN level of that queue.

    Now edit the “System parameters” and edit the section realtime.agent_button_1 as follows:

    realtime.agent_button_1.enabled=true
    realtime.agent_button_1.caption=Wombat
    realtime.agent_button_1.url=http://10.10.5.30:8080/wombat/agents/rd_pop.jsp? agent=SIP/[a]&url=http://10.10.5.31/sugar/index.php%3faction=UnifiedSearch%26module=Home%26query_string=<NUMBER>%26name=<NAME>&inset=1
    

    Edit the public IP of your Elastix server and replace the “10.10.5.30” address above.

    This code links to an instance of SugarCRM on 10.10.5.31. On it, create a contact named “John” which telephone number is “300” and one contact named “Mike” which telephone number is “301”. You can link to any other CRM software that has a web-based interface just the same way.

    Making it all work together

    • Log “agent/302” into QueueMetrics and have him join queue 400 on extension “302”. Note that we are using Hotdesking - the agent logs into Asterisk with their SIP extension.
    • Start the dialer. From the Live page, start the campaign “Reverse”. No calls will be placed.
    • Check the dialer status. You should see WombatDialer observing queue 400 and finding “SIP/302” logged on. Try pausing and unpausing the agent and refreshing the dialer: the status of SIP/302 should change accordingly.

    Now click on the button called “Wombat” from the Agent’s page. You should see a preview panel like the one in the picure:

    As you can see the SugarCRM panel is displaying the right record.

    TIP: the first time you call the page, SugarCRM might ask you to log in. Do it and refresh the page.

    If you look at the Live page on WombatDialer, the call should appear as “Reserved”. When the agent clicks on Dial, the call should start. Once the agent answers, your dialer will try and connect the other extension.

    When dialing, the Live page will show what is going on:

    And the same thing will happen on the Agent’s page:

    Nice work, isnt’t it? :)

    Improving the solution

    • You can add PSTN numbers to your lists and the will be dialed as if the had been entered on a local extension.
    • If you want WombatDialer to dial without waiting for an agent decision, just remove the “Manual preview” check and restart the dialer.
    • If you want a customized preview panel, you can create one by using the WombatDialer API.
     
  2. Elastix queue call-backs with WombatDialer

    You are called in to a client site; they seem to have a problem. They run a small (10 agents) inbound call centre, and when you join everybody else in the meeting room, there is a large and colourful graph in the middle of the table. The graph shows the call wait times during the week and boy, it’s not a good sight. Their main inbound activity is to offer client support for a company selling sport bikes, and everybody seems to be calling on Monday morning. It looks like people go riding on weekends and whatever problem they have, they call on Monday morning. Wait times peak, abandon rates spike, and nobody is happy. The call center manager is mostly concerned of having to hire and train some temp people in order to handle the load that only happens one day a week. They ask you if you have any better idea on what can be done. And yes, you have some.

    You can program an Asterisk queue so that when people tire of waiting, they press a digit and get to a menu where they can leave their number. Then the system queues their call and attempts to call them at a convenient time. This way:

    • your customer are happy; they don’t have to wait in queue for so long
    • your call center manager is twice happy: the first time because wait times and abandon rates go down, the second one because by placing calls at a convenient time they can smooth out the workload of their agents during the day

    This scenario requires some additional “glue” to what is basically supported by Asterisk - exiting a queue and reading a number are easy, but then starts the pain. You’ll have to create a database and write a script that reads back from it. You have to handle invalid numbers, busy numbers and the like (if we promised to call back the client, we cannot just try once and forget about it). You’ll have to have a GUI of some kind for the manager to start and stop dialing. You’ll have to adapt to the number of available agents. You’ll have to report on this activities. You’ll have to avoid flooding the trunks of your PBX with too many calls. In short, it’s the kind of thing that gets more complex the more you think about it. That’s what WombatDialer is for.

    What we plan to do is to use WombatDialer as the call-back engine. It can be controlled by an external HTTP API, so you can do that from the Asterisk dial-plan. It has a definite topology and call back rules, so you get the number of calls you expect on one or more Asterisk servers. It can work with an existing PBX and does not interfere with calls that are not its own. It keeps track of call completions and knows what to do in case of invalid and busy numbers. It has reports of its own and can work with QueueMetrics for powerful and detailed reports.

    The client uses Elastix as PBX system, so we’ll have to integrate it with WombatDialer. No problem!

    So what we do is:

    • First we create a normal queue, for inbound. We call it “400”.
    • Then we create a call-back queue. If our main queue is called “400”, then let’s call this second queue “401”. The idea is that WD will monitor this queue - when you have members on this queue, then WD will start placing calls. This way an inbound call-center with multiple queues will find it very natural to have some agents join and leave a call-back queue. When you creet this queue, make sure you set “Ring Strategy: rrmemory”, “Event When Called: Yes”, “Member Status: Yes”, “Autofill: yes” so that WD can use it effectively.
    • we create a piece of dialplan that will handle the exits from queue “400” and will gather the telephone number
    • we create a new “custom extension” (399) that will jump in the dialplan at “Local/1@queue-leavenumber”
    • In Elastix, we create an IVR menu and set it as a destination for queue “400”. This menu has only one option (1) that basically jumps to the custom extension “399” that we just created, in order to call our script
    • we go back to the queue “400” and set its “Fail Over Destination” as our IVR we just created

    We start by editing the extensions_custom.conf file in our system, adding a new stanza like:

    [queue-leavenumber]
    exten => 1,1,NoOp
    exten => 1,n(Start),agi(googletts.agi,"Please enter your telephone number and we will call you back.",en)
    exten => 1,n,agi(googletts.agi,"The number must be composed of 7 digits.",en)
    exten => 1,n,Read(CBNUM,beep,7,,2,5)
    exten => 1,n,NoOp( Num ${CBNUM} )
    exten => 1,n,GotoIf($["${LEN(${CBNUM})}"="7"]?lenOk)
    exten => 1,n,agi(googletts.agi,"The number you entered has the wrong number of digits.",en)
    exten => 1,n,GoTo(1)
    
    exten => 1,n(lenOk),agi(googletts.agi,"You entered the following number",en)
    exten => 1,n,SayDigits(${CBNUM})
    exten => 1,n,Wait(1)
    exten => 1,n,agi(googletts.agi,"Press 1 to confirm or any other digit to start again.",en)
    exten => 1,n,Read(CONF,beep,1,,2,5)
    exten => 1,n,GotoIf($["${CONF}"="1"]?Store:Start)
    
    exten => 1,n(Store),NoOp
    exten => 1,n,Set(WHEN=${STRFTIME(${EPOCH},,%y%m%d-%H%M%S )}
    exten => 1,n,Set(PARM=number=${CBNUM}&attrs=orgQ:400%2Cwhen:${WHEN})
    exten => 1,n,Set(foo=${CURL(http://10.10.5.18:8080/wombat/api/calls/? op=addcall&campaign=callback&${PARM})})
    exten => 1,n,agi(googletts.agi,"Thank you! we will call you back as soon as possible.",en)
    exten => 1,n,Hangup
    

    We use Google TTS as a voice synthesizer - you could use a different one or you could have the messages custom-recorded for you. What our dialplan does is first to collect a 7-digit number, then read it back asking for confirmation and when confirmed, it sends it over to WombatDialer on a campaign called “callback”. Together with the number, we also store the code of the queue that the call was on and the date and time this number was gathered. (Please note that in order to send multiple comma-separated parameters in the HTTP request, we have to use ‘%2C’ instead of the comma ‘,’).

    In order to configure WombatDialer:

    • We create a trunk called “Trunk” with a dial-string of Local/9${num}@from-internal and a capacity of 10 lines. This basically replies all numbers as if they were entered on a local extension prefixed by 9.
    • We create an End-Point of type Queue for monitoring queue 401; set extension to “401” and context to “from-internal”; max number of lines to 10; boost factor as 1 and max waiting calls to 2. This means that the number of calls placed will match the number of available agents on queue 401.
    • We create a campaign called “callback”; set it to Idle on termination and turn on QM_COMPATILE logging. We add the trunk and the EP we just created. We create a set of reschedule rules in order to handle REJECTED, BUSY, INVALID and NOANSWER calls, e.g. by retrying up to 5 times each waiting 10 minutes between each attempt. Note that we create no lists for this campaign.
    • We start the new campaign; having no numbers, it should immediately turn yellow on the Live page to tell you it’s idling.

    If we start sending calls to the queue and we try and leave any numbers, we will see that a new list will be created on WombatDialer under the name “callback/AUTO” and that will contain the numbers and attributes like:

     Number:     5551235
     Attributes: orgQ:400   when:121115-153402
    

    Those numbers are NOT immediately called, but WD will wait for some agent to be present and active on queue “401” so that they can be called back. This way, the call-center manager can monitor the current call backlog and decide who and when it is to join the callback queue.

    Further improvements

    • If there is a caller-id on the call, you could ask the caller whether to use it as the number to be called back
    • You could add time limits to the WD campaign so that you are sure that no calls are made otside acceptable periods

    See also