I gang

Queue Agent Timer Reset When Call Seized

We had a custom AGI script written by a freelancer here which needs a "fix... Via a Asterisk AGI Python script initiated from a web page button, a queue agent can "transfer a caller" into a custom extension. The script works by seizing the active channel from the agent, sending the caller to the custom extension script, and releasing the agent to take another call.

The problem is that when this is done, the queue agent typically gets the "next possible call" in their queue, instead of being placed into the last in line position which would be appropriate under our "leastrecent" ring strategy. After some investigation, we believe that the problem is that the agent's "idle time" timer is not being reset during the call-seizure-and-transfer script, thus Asterisk believes that agent to be idle far longer then is true.

We are running the FreePBX [url removed, login to view] distro with Asterisk 11.4.0.

The contents of the Python script (/var/www/cgi-bin/[url removed, login to view]) used to seize the call is:



import cgi

import sys

import re

import telnetlib





form = [url removed, login to view]()

print "Content-Type: text/plain\n\n"

if "callID" not in form:

print "There is no callid"

[url removed, login to view]()

if "ptID" not in form:

print "There is no ptid"

[url removed, login to view]()

if "agentID" not in form:

print "There is no agentid"

[url removed, login to view]()

callid = [url removed, login to view]("callID")

ptid = [url removed, login to view]("ptID")

agentid = [url removed, login to view]("agentID")

print "Parse the request"

line = agentid

manager = [url removed, login to view]()

[url removed, login to view](MANAGER_HOST, MANAGER_PORT)

[url removed, login to view]("Action: login\n")

[url removed, login to view]("Username: %(MANAGER_USER)s\n" %vars())

[url removed, login to view]("Secret: %(MANAGER_PASSWORD)s\n" %vars())

[url removed, login to view]("Events: off\n\n")

[url removed, login to view]("Action: coreshowchannels\n\n")

events = manager.read_until("CoreShowChannelsComplete").split("Event")

data = 0

for i in events:

if [url removed, login to view]("ConnectedLineNum: %(line)s" %vars(), i):

data = i

if data == 0:

print "No channel up."

[url removed, login to view]()

result = [url removed, login to view]("Channel: (.*)", data)

channel = [url removed, login to view](1)

print channel

[url removed, login to view]("\n")

[url removed, login to view]("Action: redirect\n")

[url removed, login to view]("Channel: %(channel)s\n" %vars())

[url removed, login to view]("Context: ivr\n")

[url removed, login to view]("Exten: s\n")

[url removed, login to view]("Priority: 1\n\n")

[url removed, login to view]("Action: setvar\n")

[url removed, login to view]("Channel: %(channel)s\n" %vars())

[url removed, login to view]("Variable: callid\n")

[url removed, login to view]("Value: %(callid)s\n\n" %vars())

[url removed, login to view]("Action: setvar\n")

[url removed, login to view]("Channel: %(channel)s\n" %vars())

[url removed, login to view]("Variable: agentid\n")

[url removed, login to view]("Value: %(agentid)s\n\n" %vars())

[url removed, login to view]("Action: setvar\n")

[url removed, login to view]("Channel: %(channel)s\n" %vars())

[url removed, login to view]("Variable: ptid\n")

[url removed, login to view]("Value: %(ptid)s\n\n" %vars())


There are 2 other files/scripts used for this system (but they are for handling the call after "transfer"):

/etc/asterisk/[url removed, login to view]

/var/lib/asterisk/agi-bin/[url removed, login to view]

We will provide access to copies of our other scripts as needed, but will cannot provide direct access to our PBX due to U.S. Federal privacy regulations. We have competent PBX administrators available to provide support and answer questions about our system as well.

Evner: Asterisk PBX, Python

Se mere: connectedlinenum, www freelancer web page, web python freelancer, type of freelancer username, search freelancer ivr, python web freelancer, python script freelancer, python for freelancer, python button, investigation freelancer, freelancer v 1.0, freelancer timer, freelancer support form, freelancer secret, freelancer reset, freelancer privacy, freelancer of python, freelancer needed event, freelancer login reset, freelancer login problem, freelancer ivr, freelancer in events, freelancer for python, freelancer event manager, freelancer cgi

Om arbejdsgiveren:
( 26 bedømmelser ) Ashland, United States

Projekt ID: #5999569

Tildelt til:


Hi, I came across your project, and it is really interesting. I also got a link saying similar issue, maybe it's you or others: [url removed, login to view] Based on Flere

$350 USD in 5 dage
(34 bedømmelser)

8 freelancers are bidding on average $568 for this job


hi this is for sure fixable via queue patching. but for debug need more info like " queue show" output before answer call, on answer, after transfer.

$631 USD in 10 dage
(111 bedømmelser)

Hi, I can understand that you cannot provide access to your production server but can you provide any test server so that I can regenerate the said issue? I have 8 years of voip development experience. I can try Flere

$580 USD in 7 dage
(24 bedømmelser)

Our Python Case Studies: [url removed, login to view] Dear Client I hope you are doing well! We have gone through your requirement and we understand that you are looking for highly sk Flere

$721 USD in 5 dage
(15 bedømmelser)

Hello, the best approach to keep updated the last call property of an agent is to directly update Asterisk's internal information. This can be done seamlessly by applying a patch to the code and installing the patched Flere

$550 USD in 4 dage
(7 bedømmelser)

Hello, a few words about me: I am a voip/network admin and for sure I can help you. I manage over 300 servers with different purposes: web servers, sql servers, voip servers, filesharing servers, email servers a Flere

$111 USD in 3 dage
(12 bedømmelser)

A proposal has not yet been provided

$600 USD in 10 dage
(0 bedømmelser)

Hi this is Deval from KCSPL IT Software Consulting Company". As glad to share further information about our Technological Capabilities, kindly have a look on our Website: [url removed, login to view] We have developed Flere

$1000 USD in 6 dage
(0 bedømmelser)