The Night of Stupidity

It’s past 6 AM and I’ve been up all night dealing with my own stupidity and losing the battle convincingly. The first one is pretty simple:

Vista

Is it just me or does Vista only allow only one active recording device at a time? In XP you could use both the Mic, Line in and any other recording device – such as a USB webcam, etc. The system was capable of processing anything that was not muted. In Vista, it seems to only focus on a single device and render all others “Unavailable” (yes, unchecked the exclusive control setting)

Asterisk

This one goes beyond stupidity all the way into me not even comprehending the very basics of what I’m trying to do. Feel free to drop some knowledge if you’ve got it.

I am trying to initiate a call from a script (not a .call stuck in the spool) using PHPAGI. Basically, it works, the call gets generated and Asterisk places the call and connection is established and that part of it works. I’m using something very simple to originate the call from the server:

$asm = new AGI_AsteriskManager();
if($asm->connect())
{

  $call = $asm->send_request('Originate',
         array('Channel'=>"IAX2/provider/$number",
                      'Context'=>'default',
                'Exten' => 500,
                'Priority' => 1,
                      'Callerid'=>$number));

 $asm->disconnect();

….

So that works, I’m all good there, number is dialed, connection established, etc..

What I would like to do is wait for the remote end to answer, when they do, play a wav, ask them for input, play another wav based on that input. All of this stuff is pretty simple with the AGI interface when it is launched as an extension, but I have no idea how to control the $call and implement AGI against it. (assume I do not want to tie it to an extension in the system because the call is a small component of the larger script and I don’t want to implement the third party API inside the AGI, I want to use AGI for just this small part of notifying the answering party of something and giving them an option to do something.

As I said, pretty basic stuff.

2 comments on “The Night of Stupidity”

  1. Try making a custom context and place it in the extensions_custom.conf. Use the custom context to handle call flow and any jumps to an agi script. Then just change the 'Context' entry in your dial script to point to the new context.

  2. Vlad Mazek says:

    The problem with that is that the call handling then goes off to another context does not allow me to manipulate the call in the same session.

    Basically, I am wondering what I can do to the $call object to start AGI interaction with it.

    -Vlad

Historical discussion. New comments are closed for this post.