AGI on SIP Extension Answer

Hi guys. Long time reader / researcher first time poster.

So far I have managed to connect incoming routes to agi scripts with custom applications but i have yet to figure out how i can have an extension upon answer execute an agi script.

Currently I am making the inbound route hit the agi script to generate the ticket then transferring it to the appropriate queue. Since I dont know who answers the call I have to make them assign it to themselves.

If I can make the agi script execute upon successful answer of the call from the sip answer i can assign the ticket directly to the agent. So how can i execute an agi script from the answer of the call. sip_custom.conf?

Thank you and please let me know if you want some more specifics!

Just a thought…but maybe you could generate the ticket in your agi script put it into a mysql DB and have it tracked against the caller using the uniqueId for your agent, in which the agent’s application could look at the mysql db and match the ticket with the caller…

So you mean once i transfer to the queue start checking the db like once a second to see who answered it?

I would prefer to have a script that identified it self like on the dial plan for the sip answer but that does make sense.

You don’t need to have it necessarily looking all the time. For example what I did in a similar situation is created my own db… From there I took the “agi_uniqueid” that gets passed to my script and put it into my own db/table. You wouldn’t have to check it continuously because the uniqueid stays the same the whole time the caller is active in asterisk, regardless of where they go or what queue/parking lot they’re in. You could store the uniqueid once, store the ticket info matching that, put the caller into the right queue and then when your caller gets to the right agent/extension have the agent’s hud lookup the uniqueid of the caller, because this variable will remain constant; in your db and pull the ticket matching that caller’s uniqueid at that time.

Afer installation all the features are enable except extension . so it is great problem to create new extension .