• Idefisk
  • Tools
  • Tutorials
  • Reviews
  • VoIP Providers
  • Archives
ZOIPER softphone
Back to Tutorials

6.1.2.5. AgentMonitorOutgoing (dialplan application)

1. AgentMonitorOutgoing - this application allows you to figure out the ID of the agent, who is making an outgoing call

NOTE: This application is valid for Asterisk version 1.0.9 and above.

 


Syntax:
AgentMonitorOutgoing([options])

 


List of the possible options

d - when this option is set, the application will return -1 if there is an error condition and there is no extension n+101 (where n is the priority of the current extension)
c - when this option is set, the CDR will be changed. The source of the call will become Agent/agent_id.
n - when this option is set, no warnings will be generated, in case there is no callerid or the agentid is unknown. It is useful, when you want have agent and non-agent calls in one context.

 


Purpose and usage

The purpose of this application is to allow you to reveal the Caller ID of the agent, who is making a call. The decision is based on the comparison between the Caller ID on the current interface and the global variable, set by the AgentCallbackLogin application, when the agent has been logged in.

Below, we will give you an example.

 


Prerequisites

To use this application you need a working Asterisk PBX with registered users in iax.conf, sip.conf or mgcp.conf(It depends on which protocol you would like to use) and made extensions. Also, you need to create an context in the queues.conf and another one in the agents.conf file.

To see how the application works we recommend to use our IAX softphone Idefisk. You can download it from here. Please also read our tutorial to learn how to configure it to work with Asterisk PBX.

 


Asterisk PBX configurations

NOTE: This is only an example of one of the uses of this application. Of course you can use it and for other things.


iax.conf and sip.conf Configurations

We need one registered user in the iax.conf file and also another one in the sip.conf file. This is because we are going to use the IAX2 and the SIP channels. If you want to use other protocol such as MGCP, you have to do the configurations below respectively in mgcp.conf.

1) iax.conf
iaxoneuser.jpg

2)sip.conf
siponeuser.jpg

So, we have registered the user user1 in the
iax.conf
file and the user operator in the sip.conf file.

Type=friend means that this user can make and receive calls. Host=dynamic means that the IP is not static but dynamic through a DHCP server. Allow=all means that the line which this user will use, could support all audio codecs. Context=test - this shows that this user is working with the extensions in this context of the configuration file extensions.conf.

In the sip.conf file you can see the following option: disallow=all. This means that the line will not support any codecs. However, below this option we have allow=ulaw, allow=alaw and allow=gsm. This means that the line will support these three codecs - ulaw, alaw and gsm. It is important to write the options exactly in this order. First you write the disallow=all option and then the allow options. Otherwise, if you write the disallow option after the allow options, no codecs will be supported by the line.


queues.conf Configurations

In this file you have to say which users or agents will participate in your queue. In other words, which users or agents will be responsible for the answering of an incoming call. More about the features of this configuration file, you can learn in our tutorial about the queues.conf file.

There are two possible ways to configure the settings in this file.

In our case we will use the so called "dynamic" way. For this configuration you will need the agents.conf file.

Below, in section agents.conf Configurations, we will show you the configurations in this configuration file and here, we will explain you the configurations in queues.conf file.

Since, we are using the "dynamic" way, we have to include the number of the agent, as it is written in the agents.conf file. In our example we have written the following: member => Agent/8888.
This means that we want the agent with number 8888, to answer the calls, incoming in the queue test.
ringtype=all means that when a call is incoming in the queue and we have more than one agent logged in, the phones of all logged in agents will start ringing. The first agent, who picks up the phone, will answer the incoming call.

The method requires the usage of the AgentLogin or the AgentCallbackLogin application, in your dial plan.
This is necessary, because unlike the "static" method, here is not enough just to turn on your phone. The user has to log itself in the queue, manually. The advantage is that the user would be able to log in from any place and phone, which is connected with the Asterisk PBX. You can see a screenshot below.

queue.confqueue1.jpg

agents.conf Configurations

As we have mentioned above, we have to use this configuration file, because we have decided to use the "dynamic" method. This is the file, where we create the agents. We use them to answer the calls, incoming in our queue.

The way of creating an agent is the following: agent => agentnumber,agentpassword,agentname. In our case we have written the following: agent => 8888,8888,operator. This means that we have registered an agent with number 8888, password 8888 and username operator. The context, where the agent is set, is called [agents]. The agent number will be used in the queues.conf file. Please, take a look at section queues.conf Configurations above, to learn how to do this.

agents.confqueue.jpg

extensions.conf Configurations

Now lets take a look at the extensions.conf file.

extagentmonitoroutgoing.jpg

On the picture above you can see our extensions.conf file.

The AgentMonitorOutgoing application requires the usage of the AgentCallbackLogin one. So, we have an extension 999 with this application.

In order to be logged in the queue, our agents have to dial this extension. Because we have only one agent(with number 8888), we will specify his/her number in the brackets, so the only thing he/she has to do is to enter the password and the extension on which he could be reached.

Extension 197 is required by the AgentCallbackLogin application. When an agent logs in, the system will ask him/her for an extension, on which he/she could be reached. So, 197 is our extension for the purpose. It contains the Dial application.
Thanks to it the agent will be connected with the user operator through the SIP channel. In other words the user operator will become an Agent 8888.

We have one extension with the number 198. It contains the Queue application. This is where the incoming calls will receive. They will be attached to the queue [test], created in the queues.conf file.

Finally, we have the extension 199, which contains the AgentMonitorOutgoing application. Always put this application before the Dial one. In our case the Dial application is with priority 2. Thanks to it the caller will be connected to the user user1 through the IAX channel. Of course, you can use it also with the Zap channel or any of the other ones. As argument in the brackets we have put the letter c, which means that we allow the change of the Caller ID option in the Call Detail Records(CDR).

So, when somebody dials extension 199, his/her Caller ID will be compared with the global variable set by the AgentCallbackLogin application.

If there is no Caller ID or Agent ID the system will try to execute the extension with n+101 priority(where [n] is for the priority of the current extension).

Below, we will show you two screenshots. On both of the pictures is the Master.csv file. This is the file where the Call Detail Records (CDR) are stored. The location of this file is /var/log/asterisk/cdr-csv/. The first picture is without the AgentMonitorOutgoing application. The second one is with included AgentMonitorOutgoing application. The Caller ID is the seventh option. Each option is surrounded by quotation marks and separated from the others by commas.

[image=272283 extension=jpg
internal]agentmonitoroutgoingmaster1.jpg[/image]
agentmonitoroutgoingmaster.jpg

In order to be sure that the Asterisk PBX will hang up the line, when the conversation is over, it is a good idea to use the Hangup application for each extension you have.

 


2. Screenshots of what you can see on the CLI of the Asterisk PBX

cliagentmonitoroutgoing.jpg

 


3. Additional information

For more information about extensions.conf you can check here.
For more information about iax.conf you can check here.

This application is tested with our IAX softphone Idefisk. You can download it from here.
For more information about this softphone please read our tutorial.

If you would like to test this application with the SIP channel you can read our tutorials about the SIP Softphones to learn how to configure them to work with Asterisk PBX

 


4. Uploaded files


extensions.conf
iax.conf
sip.conf
agents.conf
queues.conf

 


5. Similar dialplan applications

AddQueueMember
Queue
AgentCallbackLogin
AgentLogin
RemoveQueueMember
PauseQueueMember
UnpauseQueueMember

 

 
User Comments
cvs male enhancement products (tanjagomez5873 at adult-work dot info)
09 July 2020 12:51:02
cvs male enhancement products http://www.cialij.com/
 
Add Comment
Name:
Email:
Comment:
In order to prevent automatic posting on our website, we kindly request you to type in the number you see in the picture below.
Image Verification:
 

Latest Headlines:

  • T.38 faxing with Zoiper 2.15 is now easier than ever
    section: voip software
  • Asterisk 1.4.21 Released
    section: Asterisk
  • Asterisk 1.4.20 Released
    section: Asterisk
  • Asterisk 1.4.20-rc2 Released
    section: Asterisk
  • Asterisk 1.4.20-rc1 Now Available
    section: Asterisk
  • News Archives (older news)

Latest Tutorials:

  • Sending Fax from Zoiper to Zoiper using T.38
    added 08/Dec/2008 18:16
  • VMAuthenticate (dialplan application)
    added 01/Mar/2008 15:57
  • Siptronic ST-530
    added 06/Nov/2007 17:57
  • Siemens C455 IP hardphone
    added 05/Nov/2007 10:24
  • Zoiper
    added 22/Oct/2007 17:53

Latest Comments:

  • https://src.opensuse.org/filmax/4k-hd/is...
    tutorial: Installation on Slackware
  • https://forum.webnovel.com/d/100590-film...
    tutorial: Configuring IP Phones for use with Asterisk
  • Салют хорошая мысль ...
    tutorial: Asterisk Installation
  • https://m.mamul.am/am/post/1077582 http...
    tutorial: Asterisk Installation
  • https://codeberg.org/dolog/sac/issues/10...
    tutorial: Asterisk 1.4.0 CLI commands
 
contact us at: support@asteriskguru.com - asterisKGuru.com © all rights reserved   |   *asterisk is registered trademark of © Digium™