Find Jobs
Hire Freelancers

Queue Agent Timer Reset When Call Seized

$30-250 USD

In Progress
Posted almost 10 years ago

$30-250 USD

Paid on delivery
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 v.2.11.0.37 distro with Asterisk 11.4.0. The contents of the Python script (/var/www/cgi-bin/[login to view URL]) used to seize the call is: ========================================== #!/usr/bin/python import cgi import sys import re import telnetlib MANAGER_HOST="[login to view URL]" MANAGER_PORT="5038" MANAGER_USER="xxxREDACTEDxxx" MANAGER_PASSWORD="xxxREDACTEDxxx" form = [login to view URL]() print "Content-Type: text/plain\n\n" if "callID" not in form: print "There is no callid" [login to view URL]() if "ptID" not in form: print "There is no ptid" [login to view URL]() if "agentID" not in form: print "There is no agentid" [login to view URL]() callid = [login to view URL]("callID") ptid = [login to view URL]("ptID") agentid = [login to view URL]("agentID") print "Parse the request" line = agentid manager = [login to view URL]() [login to view URL](MANAGER_HOST, MANAGER_PORT) [login to view URL]("Action: login\n") [login to view URL]("Username: %(MANAGER_USER)s\n" %vars()) [login to view URL]("Secret: %(MANAGER_PASSWORD)s\n" %vars()) [login to view URL]("Events: off\n\n") [login to view URL]("Action: coreshowchannels\n\n") events = manager.read_until("CoreShowChannelsComplete").split("Event") data = 0 for i in events: if [login to view URL]("ConnectedLineNum: %(line)s" %vars(), i): data = i if data == 0: print "No channel up." [login to view URL]() result = [login to view URL]("Channel: (.*)", data) channel = [login to view URL](1) print channel [login to view URL]("\n") [login to view URL]("Action: redirect\n") [login to view URL]("Channel: %(channel)s\n" %vars()) [login to view URL]("Context: ivr\n") [login to view URL]("Exten: s\n") [login to view URL]("Priority: 1\n\n") [login to view URL]("Action: setvar\n") [login to view URL]("Channel: %(channel)s\n" %vars()) [login to view URL]("Variable: callid\n") [login to view URL]("Value: %(callid)s\n\n" %vars()) [login to view URL]("Action: setvar\n") [login to view URL]("Channel: %(channel)s\n" %vars()) [login to view URL]("Variable: agentid\n") [login to view URL]("Value: %(agentid)s\n\n" %vars()) [login to view URL]("Action: setvar\n") [login to view URL]("Channel: %(channel)s\n" %vars()) [login to view URL]("Variable: ptid\n") [login to view URL]("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/[login to view URL] /var/lib/asterisk/agi-bin/[login to view URL] 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.
Project ID: 5999569

About the project

7 proposals
Remote project
Active 10 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
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: [login to view URL] Based on my experience, this is because of internal bug of asterisk with app-queue.c and redirect command. I agree that when you use redirect AMI to 'tear" the channel and put somewhere else, this will affect the normal "cleaning up" process of app-queue, thus resulting in non-proper idle time reset for the agent. Common method will be modifying the app-queue.c source file, and compile it again. Although this might give the fix for this problem, there is one big caveat about this approach: your system should never be updated/upgraded, since the change will be lost immediately. With my expertise, here is my simple solution: instead of using redirect command, we will try to "inject" agent channel and send DTMF keytone that will trigger a blink transfer to the ivr. You can think of this as same as when the agent manually presses the DTMF to make a blink transfer. As blink-transfer supported in app-queue.c, this will ensure proper reset of idle time for agent. Since direct access is not allowed, it may need to setup a whole similar system here for testing. Therefore, please allow me 5 days including testing. I have a good feeling that my method will fix your current problem, and is the best approach. Feel free to read my reviews. Await your early reply. Best regards, Bao
$350 USD in 5 days
5.0 (35 reviews)
5.5
5.5
7 freelancers are bidding on average $563 USD for this job
User Avatar
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 days
4.9 (152 reviews)
8.2
8.2
User Avatar
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 code. I can provide you with such patch and guidance about how to apply it - or provide a patched version of the module. Using the feature provided by this patch I will be able to add a line or two to your dialplan to instruct Asterisk to process this transfered call as a queue call regarding the last call time property. I've plenty experience developing patches for Asterisk - all of them for production system handling thousands of calls per day. Also, I've experience working without access to the production server. I could provide you the patch in 4 days or less. I could also suggest a different approach but it would require additional understanding of your current solution. Please feel free to contact me for any further information. Best regards.
$550 USD in 4 days
5.0 (7 reviews)
5.0
5.0
User Avatar
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 and so on. (most of server are used as voip servers with different purposes) Each server has its own configuration, monitorization, backup etc. If you are interested I can give you more details about my work. about your project: I do this kind of things for a few of servers that I manage. If I will be your choice I will offer you my support for other projects. Can we talk a little bit please? I need more informations. Thank you.
$111 USD in 3 days
5.0 (18 reviews)
4.1
4.1

About the client

Flag of UNITED STATES
North Chesterfield, United States
5.0
30
Payment method verified
Member since Oct 6, 2009

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.