Summary:ASTERISK-08413: Dead AGI : not able to use StartMusicOnHold application
Reporter:Thomas Narce (tnarce)Labels:
Date Opened:2006-12-21 12:49:51.000-0600Date Closed:2011-06-07 14:07:57
Versions:Frequency of
Description:When using a php dead AGI,
insidie the php AGI, we start the music on hold (using either 'StartMusicOnHold' dial plan application or the 'Set Music ON' agi commange) while doing some external system access (socket) and stop when getting the result back.
This works only with AGI, not with DEAD AGI.
We need to use Dead AGI to do post hangup actions.
I guess this is not an issue related to the StartMusicOnHold application, but more an issue related to DeadAGI when dealing with External processing.


Here is an code example, you'll see a lot of DEBUG messages in the console :
DEBUG[9365]: channel.c:806 ast_queue_frame: Dropping voice to exceptionally long queue on IAX2/ppbx-4

require('/var/lib/asterisk/agi-bin/phpagi.php'); // v2.14 2005/05/25 20:30:46
$agi = new AGI();
Comments:By: Tilghman Lesher (tilghman) 2006-12-21 13:26:59.000-0600

Think about what you're asking.  The call is hung up; that means it will not pass any more audio.  You want to pass audio (music-on-hold) on a channel that will not pass any more audio.

Do you see the fundamental problem there?

By: Thomas Narce (tnarce) 2006-12-22 06:50:57.000-0600

I'm sorry if you missunderstood my problem...
The issue happens during the call, I was just explaining why I was using a DeadAgi instead of an AGI.

By: Tilghman Lesher (tilghman) 2006-12-22 08:10:48.000-0600

No, you need to continue to use AGI, but you need to trap the SIGHUP signal sent when the channel is hungup, as documented, to continue your processing after the channel has hungup.

There is no reason to use DeadAGI on a live channel.

By: Tilghman Lesher (tilghman) 2006-12-22 08:12:26.000-0600

Please see http://us3.php.net/manual/en/function.pcntl-signal.php

By: Thomas Narce (tnarce) 2006-12-22 08:19:18.000-0600

Ok, my bad. I will do that.

By: Joshua C. Colp (jcolp) 2006-12-22 10:12:18.000-0600

And the moral of the story is... DeadAGI is only for dead channels.