[Asterisk-Users] Monitor via Manager question

Dana Olson rickaster at gmail.com
Wed Apr 20 08:50:57 MST 2005


Hello. I checked in the wiki and read a bunch of old threads from this
mailing list but haven't found what I'm looking for.

I'm using a simple PHP script, and here is the relevant portion:

fputs($socket, "Action: Monitor\r\n");
fputs($socket, "Channel: Zap/1-1\r\n\r\n");

That works fine. As does this:

fputs($socket, "Action: Monitor\r\n");
fputs($socket, "Channel: SIP/8000-h4d8\r\n\r\n");

But what I need to be able to do is this:

fputs($socket, "Action: Monitor\r\n");
fputs($socket, "Channel: SIP/8000\r\n\r\n");

And have it record either the first call that is up on SIP/8000, or
the last, or whatever (doesn't matter, only one call at a time will be
up on this line).

However, if I try this, it always comes back to me with:

Response: Error
Message: No such channel

Because I am not specifying the actual call that is up. Is there any
way to do this? Or can I somehow easily look up what Zap channel is
used by SIP/8000 and pass that?

The other twist is that SIP/8000 will be specified by a variable
passed through a form. Basically, I want a web form with two buttons
and a text box: Start Rec., Stop Rec., and User Ext.. I didn't start
out that complex though, just right now it's a simple PHP script, and
it was taken from the Wiki. I need to get the core functionality
working properly before I add the buttons and whatever.

Thanks in advance for any advice.

--
Dana



More information about the asterisk-users mailing list