Author Topic: Outbound with Asterisk 1.6  (Read 24172 times)

viniciusfontes

  • Newbie
  • *
  • Posts: 16
  • Karma: 0
    • View Profile
Outbound with Asterisk 1.6
« on: February 15, 2010, 13:18:38 »
Hello. I'm confused about the right way of setting up outbound queues on Asterisk 1.6. As explained on this topic (http://forum.queuemetrics.com/index.php?topic=728.0), we should not use agents.conf at all, relying only on AddQueueMember and so on. But on the topic about setting up outbound queues (http://forum.queuemetrics.com/index.php?topic=261.0), this context depends on the agents functionality:

[queuedial]
; this piece of dialplan is just a calling hook into the [qm-queuedial] context that actually does the
; outbound dialing - replace as needed - just fill in the same variables.
exten => _XXX.,1,Set(QDIALER_QUEUE=q-${EXTEN:0:3})
exten => _XXX.,n,Set(QDIALER_NUMBER=${EXTEN:3})
exten => _XXX.,n,Set(QDIALER_AGENT=Agent/${CALLERID(num)})
exten => _XXX.,n,Set(QDIALER_CHANNEL=SIP/${QDIALER_NUMBER})
exten => _XXX.,n,Set(QueueName=${QDIALER_QUEUE})
exten => _XXX.,n,MixMonitor(Q-${QDIALER_QUEUE}-${UNIQUEID}.WAV|b|)
exten => _XXX.,n,Goto(qm-queuedial,s,1)

Is there a way to use outbound queues on Asterisk 1.6 and at the same time use callback agents?

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Outbound with Asterisk 1.6
« Reply #1 on: February 15, 2010, 17:10:59 »
Don't worry - that is just the way this is logged... so it does not actually use a chan agent in Asterisk.

viniciusfontes

  • Newbie
  • *
  • Posts: 16
  • Karma: 0
    • View Profile
Re: Outbound with Asterisk 1.6
« Reply #2 on: February 15, 2010, 20:46:27 »
So far so good. But how could I ensure that only logged on "agents" can dial out?

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Outbound with Asterisk 1.6
« Reply #3 on: February 16, 2010, 19:20:40 »
You should check that in the dialplan - IIRC there is a function to tell wjhether an agent is logged on or not.

viniciusfontes

  • Newbie
  • *
  • Posts: 16
  • Karma: 0
    • View Profile
Re: Outbound with Asterisk 1.6
« Reply #4 on: February 16, 2010, 20:27:34 »
Yes there is, but as far as I can tell, it doesn't support the xagents way defined for Asterisk 1.6:

[queuedial-loggedon]
; This piece of dialplan will let only logged on agents dial out
exten => _XXX.,1,Set(QDIALER_QUEUE=q-${EXTEN:0:3})
exten => _XXX.,n,Set(QDIALER_NUMBER=${EXTEN:3})
exten => _XXX.,n,Set(QDIALER_AGENT=Agent/${AGENTBYCALLERID_${CALLERID(num)}})
exten => _XXX.,n,Set(QDIALER_CHANNEL=SIP/${QDIALER_NUMBER})
exten => _XXX.,n,Set(QueueName=${QDIALER_QUEUE})
exten => _XXX.,n,MixMonitor(Q-${QDIALER_QUEUE}-${UNIQUEID}.WAV,b,)
exten => _XXX.,n,GotoIf($[${LEN(${QDIALER_AGENT})} > 6]?qm-queuedial,s,1)
exten => _XXX.,n,NoOp,Extension ${CALLERID(num)} is not logged on as agent.
exten => _XXX.,n,Playback(agent-loggedoff)
exten => _XXX.,n,Congestion

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Outbound with Asterisk 1.6
« Reply #5 on: February 17, 2010, 09:10:04 »
If you need to support xagents, that piece of dialplan stores everything in a ready-to-read format in AstDB so it should be trivial to detect.

viniciusfontes

  • Newbie
  • *
  • Posts: 16
  • Karma: 0
    • View Profile
Re: Outbound with Asterisk 1.6
« Reply #6 on: March 03, 2010, 14:18:44 »
Tried that, but then the agents doesn't show up logged on on the wallboard. I would like to have something consistent, and I really don't have much time to develop and test complex dialplans and workarounds for those issues.

I'm considering downgrading to Asterisk 1.4, but I have a few doubts. If I use Asterisk 1.4, can I get a consistent behaviour between QM and Asterisk? For example: when an agent logs on via Asterisk, will he show up on logged agents on QM, even in the case of being an outbound queue?


barryf

  • Jr. Member
  • **
  • Posts: 62
  • Karma: 4
    • View Profile
Re: Outbound with Asterisk 1.6
« Reply #7 on: March 03, 2010, 15:45:26 »
Hi,

I use outbound queues fine with Asterisk 1.6. If add something like the following to the part of your dial plan where agents actually log in, it should work:

exten => s,n(loggedin),Set(GLOBAL(AGENTBYCALLERID_${CALLERID(num)})=${AGENTID})
exten => s,n,QueueLog(NONE,NONE,Agent/${AGENTID},AGENTCALLBACKLOGIN,${CALLERID(num)}@from-internal)

..in the above, I set the global variable AGENTBYCALLERID_${CALLERID(num)} so that it is then available for the queuedial-loggedon context to check if the agent is logged on.

The Queuelog line will write out to the queue_log that the agent has logged on, which should sort out your agents being displayed on the wallboard.

Hope this helps.

-Barry

viniciusfontes

  • Newbie
  • *
  • Posts: 16
  • Karma: 0
    • View Profile
Re: Outbound with Asterisk 1.6
« Reply #8 on: March 03, 2010, 15:57:36 »
Thanks for the help. How are you registering the agent's logoff?

barryf

  • Jr. Member
  • **
  • Posts: 62
  • Karma: 4
    • View Profile
Re: Outbound with Asterisk 1.6
« Reply #9 on: March 03, 2010, 16:49:28 »
Thanks for the help. How are you registering the agent's logoff?

In my dialplan which handles this, I include the following:

exten => s,n,Set(GLOBAL(AGENTBYCALLERID_${CALLERID(num)})="")
exten => s,n,QueueLog(NONE,NONE,Agent/${AGENTID},AGENTCALLBACKLOGOFF,${CALLERID(num)}@from-internal,,CommandLogoff)

This basically does the reverse - clears the AGENTBYCALLERID_${CALLERID(num)} variable and writes a suitable queue_log entry.


viniciusfontes

  • Newbie
  • *
  • Posts: 16
  • Karma: 0
    • View Profile
Re: Outbound with Asterisk 1.6
« Reply #10 on: March 03, 2010, 17:44:56 »
Turns out the dialplan provided by Loway actually has two entries much similar to those you kindly posted. The problem was on queue_log that wasn't being generated due to a permissions problem.

Unfortunely there's still one thing bugging me: when an agent logs in, he doesn't show up on the wallboard until he makes his first call. That's not much of an issue (altought I would like to have that working if possible), but the real problem is that when the agent logs off, he still is listed as logged in on the wallboard. Here's a few entries on my queue_log:

1267634130|1267634122.11|NONE|Local/101@xagents|AGENTCALLBACKLOGIN|201
1267634130|1267634122.11|q-001|Local/101@xagents|ADDMEMBER|
1267634228|1267634228.12|q-001|Agent/101|ENTERQUEUE|-|21047051|
1267634234|1267634228.12|q-001|Agent/101|CONNECT|6||
1267634247|1267634228.12|q-001|Agent/101|COMPLETECALLER|6|13|
1267634266|1267634260.16|q-001|Local/101@xagents|REMOVEMEMBER|
1267634266|1267634260.16|NONE|Local/101@xagents|AGENTCALLBACKLOGOFF|

Even after that, the agent is still listed as logged in. Any ideas on solving this?

barryf

  • Jr. Member
  • **
  • Posts: 62
  • Karma: 4
    • View Profile
Re: Outbound with Asterisk 1.6
« Reply #11 on: March 03, 2010, 17:50:52 »
the real problem is that when the agent logs off, he still is listed as logged in on the wallboard. Here's a few entries on my queue_log:

1267634130|1267634122.11|NONE|Local/101@xagents|AGENTCALLBACKLOGIN|201
1267634130|1267634122.11|q-001|Local/101@xagents|ADDMEMBER|
1267634228|1267634228.12|q-001|Agent/101|ENTERQUEUE|-|21047051|
1267634234|1267634228.12|q-001|Agent/101|CONNECT|6||
1267634247|1267634228.12|q-001|Agent/101|COMPLETECALLER|6|13|
1267634266|1267634260.16|q-001|Local/101@xagents|REMOVEMEMBER|
1267634266|1267634260.16|NONE|Local/101@xagents|AGENTCALLBACKLOGOFF|

Even after that, the agent is still listed as logged in. Any ideas on solving this?

Hi,

The problem is that you are alternating between referring to your aghents as Agent/101 and as Local/101
Queuemetrics by default expects to see Agent/ - that's why it is seeing the agent once they are on a call, but not the login/logoff part.

If you edit configuration.properties and change:
# Rewrites Local/XXX@ext channels in the format Agent/XXX
default.rewriteLocalChannels=false

to
# Rewrites Local/XXX@ext channels in the format Agent/XXX
default.rewriteLocalChannels=true

...you should be good.

Hope this helps.

-Barry

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Outbound with Asterisk 1.6
« Reply #12 on: March 04, 2010, 16:13:22 »
 ;D

barryf

  • Jr. Member
  • **
  • Posts: 62
  • Karma: 4
    • View Profile
Re: Outbound with Asterisk 1.6
« Reply #13 on: March 04, 2010, 16:24:28 »
;D

Yeah, but I'm still listed as a newbie  :'(

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Outbound with Asterisk 1.6
« Reply #14 on: March 05, 2010, 10:31:31 »
Do we have to list you as "Non-continnetal support team"?  ;D