Calling ext-queues-custom

I created a queue which is in the context ext-queues.

I’d like to have a System call fire when a caller enters the queue. What seemed logical to me was to put a like this in the extensions_custom.conf:

exten => 480,n,System(/path/to/external/script ${CALLERID(num)})

When I do that it seems to not get added into the dialplan. The logs do indicate the extension_custom.conf is loaded successfully.

If I stick that line in [ext-queues] in extensions_additional.conf just before this line:
exten => 480,n,Queue(480,t,)
it works as expected. I understand thats not a solution since it’ll be overwritten.

Any thoughts on the correct way to do this?



It seems I’ve figured this out.

I saw others asking a simialar question, including here:

What I really need is an override, so extensions_override_freepbx.conf does the trick.

I just add this line to dial plan for my queue extension:

exten => 480,n,System(/var/lib/asterisk/om-bin/ ${CALLERID(num)})
right before it goes to:
exten => 480,n,Queue(480,t,)

So my override of extension 480 means I need manually maintain this but freepbx will not overwrite it and since the override is loaded first, it the same extension in extensions_additional.conf is ignored.

So then that begs the question is this the best way to do it? Another way I considered was setting up a misc destination that would call my script and then pass it on to the queue extension.

For background, what I am doing is firing a scipt which does a lookup of the CID and if the caller is in a particular class enters the queue, notify agents via jabber. This could also be done by the CallerID Lookup Sources module, perhaps via an HTTP call to a local CGI.

One thing I am trying to make sure of is that this script returns immediately. If it hangs the caller gets dead air.

Hopefully my ramblings will be helpful. If anyone has any suggestions they will be much appreciated.


1 Like

I’m having the same issue, i’d like to send a notification to the agent when he receives a new call via jabber.

We were using Asterisk-IM for Openfire but it has a problem with queue calls, if it is a direct call it works perfectly.

With the solution you describe above
exten => 480,n,System(/var/lib/asterisk/om-bin/ ${CALLERID(num)})

It is called everytime an agent phone rings? If the agent phone is busy it will not send this notification?

I solved this issue modifying the dialparties.agi but this file is overwritten by FreePBX and i want to avoid this.

Update: I eventually moved to an AGI approach to this.

Instead of calling out to a system call I use a python AGI call.

exten => 480,n,AGI(queue-alert.agi)

I put that in a copy of the queue definition which freepbx writes out in extensions_override_freepbx.conf. If there is a better way to do that I’d love to hear it.

Hugo, no, this is not called everytime the agents phone rings. It only gets called just before a caller enters the queue. It must be in dialplan before this line:

exten => 480,n,Queue(480,t,)

What does the Asterisk IM for openfire buy you?