Saturday, January 26, 2019

Trick asterisk to behave like a softphone

I suppose this is less of a trick, and more of a technique.  Basically, we'll use an asterisk box to register against another asterisk box as the extension devices.  The scenario below will explain why I needed this, but I could envision scenarios where you wanted to do some testing of calls, or whatever.  Something where you might need a bunch of soft phone registrations happening, this could be a way to do it.


Issabel distro queue needs to be able to handle remote agents using their landline or mobile phone device.

At time of writing this (2019) Issabel CC system has some problems with this.  At least I've never been able to work them out (post comments if there is an easier way) however I needed this feature, this was how I did it, and it has worked really well.

This issues isn't with asterisk itself, remote PSTN agent in an asterisk queue has been a feature for 2 decades, but Issabel Call Center application does some custom code which seems to make "at home" agents work.

When using Issabel Call Center application is trying to send calls to remote agents over PSTN lines, I encountered login issues and call control issues.  Tried a variety of different techniques using call forwarding, follow-me, along with a variety of configuration tricks.  Some worked, but required admins manually modifying dialplan code, not something i wanted anyone to do if it could be avoided.

I needed something relatively easy to implement, easy to administer, wouldn't confuse call reporting in the Call Center and would allow agent desktop to continue to show screen pops and allow updated customer information.

In order to satisfy the (current) needs of CC system and the PSTN requirement, a way is needed for Issabel Call Center queue to send a call to a PSTN user that would ensure the call was always in control.  Normally asterisk can handle a remote agent, but with some of the designs of the ISSABEL contact center system, it can't handle the remote agent on a PSTN connection very well (at time of writing)

I came up with a method to have a second asterisk box, with the extensions registering to the primary asterisk box to appear to be a registered softphone to the issable system.  The PBX02 server "pretends" to be these SIP phones that will register to PBX01 extensions.  I registered an individual trunk connection for each extension from PBX02 to the CC asterisk system.  This gave the appearance to the CC's Asterisk that a SIP hardset/softset extensions were now registered.

Now when an agent went "ready" in the GUI, the CC would send the call to this SIP connection as it normally would.

On PBX02, the call arrives as a DID being their 4 digit extension.  I send each DID to a unique MISC DESTINATION, which had their PSTN number in it.  This would cause PBX02 to place a call to the agents device.  

When the agent answers, this get passed by PBX02 to the CC system (PBX01) and the customer was connected to the agent.  Metrics were proper and the screen information was still delivered.


Assumptions, 2 Issabel asterisk box'es installed and functional, one configured as the call center, the other one going to be this pstn 'gateway' of sorts.  This document revolves around Issabel, but the concepts apply to asterisk in general.  I wont' be getting into the details of setting up a CC in this document, i'll have to assume you already know how to do that.


Each trunk on PBX02 has a name that reflected the 4 digit extension number that we'll register against on PBX01, but the outgoing/incoming context is left blank.  On each trunk, in the incoming section at the bottom there is a registration string.  The syntax is as follows:

Trunk Name (description): 4 digit extension number 
Trunk Name (PEER Details): 4 digit extension number|
PEER DETAILS and USER DETAIL - Completely blank

Register String


Submit and Apply the changes

This registration is what PBX01 is expecting from a softphone device authenticate it and be able to handle call flow with it.

The log in the Issabel Call Center computer will show something like the following, showing PBX01 responding to PBX02's registration as Extension 1001


Create a MD for each extension, and put in the destination number you want to have for that user

This example is the mobile number for Extension 1001
Save your changes

Go to

Create an inbound route
DESCRIPTION and DID Number are the extensions number you are using
Set the MISC Destination to the same extension 

Submit and Apply your changes.

Make sure you have the appropriate outbound and trunks configured for calls leaving this server to get out to the PSTN network.  Depending on your setup, you can send the calls BACK to the CC server to go out your PSTN connection

Now login to your Call Center user

We'll logon our AGENT "Maria Jones" with agent #9500 on Extension 1001 on the GUI

When we attempt to logon, the system will call "SIP/1001"

Here you'll see the system has called SIP 1001, which is sent to the IP registration on PBX02

Now PBX02 the extension 1001 call comes in

PBX02 receives the call and then dials the PSTN/MOBILE number of the agent

Agent answers, puts in their agent ID password.  They are now logged in and hearing music in their device.

Here's PBX02 showing call out PSTN network to agent

I've placed a call to the QUEUE 7777, agent 9500 on SIP/1001 belongs to, with their call being done on their mobile device

Here's their GUI showing the call from "1002" (my test extension)

Agent stats work perfectly


Whats cool about this, is this isn't limited to agents at home.  This feature can utilized to merge call centers together under a single umbrella.  As long as the Issabel CC can dial a remote device, it can (mostly) know that state of that phone.  

No comments:

Post a Comment