[Date Prev][Date Next][Thread Prev] [Thread Next][Date Index] [Thread Index]

Re: [Flash Operator Panel] FOP XML PHP mashup / fakeDNDevent


  • From: Philipp Walker <pwalker@xxxxxxxxxx>
  • Organization: Binatec AG
  • Date: Wed, 23 Jul 2008 18:47:37 +0200
  • Mailing-list: contact operator_panel-help@lists.house.com.ar; run by ezmlm

Hi Ian (et.al.),

Thanks a lot Ian (and Nic), works like a charm now!
The two problems I had were:
- I didn't originate with Application = hangup (not sure if that was a real 
problem)
- My version of the trixbox / FreePBX seems to have a different / strange 
version of phpagi-asmanager.php... (I use $as->Originate() instead of 
$as->send_request() )
phpagi-2.14.tgz has: ("=NULL"s left out)
 function Originate($channel,$exten,$context,$priority,$application$,data, 
$timeout,$callerid, $variable, $account,$async,$actionid)
My trix / FreePBX has: ("$application" is somewhere elses than above and 
the "=NULL"s are not there...)
 function Originate($channel, $exten, $context, $priority, $timeout, 
$callerid, $variable, $account, $application, $data)
(at /var/www/html/admin/common/php-asmanager.php)

So, for me, something like this works: (Just to report back...)
For DND on: (after the database put)
     $chan = "Local/".$ext."@fopdndon";
For DND of: (after the database put)
     $chan = "Local/".$ext."@fopdndoff";
For both:
     $app = "hangup";
     $res=$as->Originate($chan, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 
$app, NULL);

...and the dialplan is something like this:
 [fopdndon]
 ; DND on
 exten => _X.,1,NoCDR()
 exten => _X.,n,UserEvent(ASTDB,Channel: SIP/${EXTEN}^Family: DND^Value: YES)
 exten => _X.,n,Macro(hangupcall,)
 [fopdndoff]
 ; DND off
 exten => _X.,1,NoCDR()
 exten => _X.,n,UserEvent(ASTDB,Channel: SIP/${EXTEN}^Family: DND^Value: ^)
 exten => _X.,n,Macro(hangupcall,)

I guess this only works as expected with FreePBX (because of the strange 
php-asmanager.php and the Macro(hangupcall,) in the dialplan)!
So, using $as->send_request() instead of $as->Originate() might be safer! ... 
that would be (for both, on and off, of course with different $chan, as 
above)
 $res = 
$as->send_request('Originate',array('Channel'=>$chan,'Application'=>$app));

Thanks again and best regards,
Philipp

P.S.: I'm using this for snom phones, but it's basically the same as with 
Aastra.

Am Dienstag 22 Juli 2008 23:36:13 schrieb Ian Plain:
Hi

In the end I didn’t pursue this from the gui, but I did with Nic get it
going from the Aastra handsets via XML

This is the asterisk bit

exten => _XXXX,1,NoCdr
exten => _XXXX,n,UserEvent(ASTDB|Channel: SIP/${EXTEN}^Family:
DND^Value: SET ^)
exten => _XXXX,n,Hangup()

And its called via phpAGI

 if($dnd==0)
                {
                $res = $as->Command('database put DND '.$user.' SET');
                $dnd=1;
                $call = $as->send_request('Originate',
                        array('Channel'=>"LOCAL/".$user."@fopxmlon",
                              'Application'=>'hangup'));
                }

Have fun. I may time willing spend a little time on this, If a customer
wants to pay :-) at the moment the just wanted login/out of queues with
lights and DND and were willing to pay


Thanks
Ian Plain
http://www.cyber-cottage.co.uk
Get us to call you
http://www.cyber-cottage.co.uk/voip/callback.htm

-----Original Message-----
From: Philipp Walker [mailto:pwalker@xxxxxxxxxx]
Sent: 22 July 2008 21:48
To: operator_panel@xxxxxxxxxxxxxxxxxx
Subject: [Flash Operator Panel] FOP XML PHP mashup / fakeDNDevent


Hi All,

I've spent about a day to signal DND to the FOP (using UserEvents) when
activating DND via PHP scripts, like in Ian Plain's post from Oct 2007.
First, I tried firing the UserEvent directly from the Asterisk Manager
(to no
success) and then using the Originate()-method and [fakeDNDevent] in the

dialplan... Still no success...

Does anyone have new info on this stuff, on either if the two methods?

As for direct UserEvent, I tried various things (including using a
modified
version of/phpagi-asmanager.php), but that doesn't really seem to
work... For originate, I tried e.g.
$astman->Originate("Local/$ext@xxxxxxxxxxxx");
but I guess it needs more parameters.

I'd be very thankful for any help on this...

Thanks and kind regards,
Philipp



-- 
Philipp Walker
Binatec AG
Ingenieurbüro für Nachrichten- und Informationstechnik
Q4 Altdorf Ost
Hellgasse 23 / Postfach
6460 Altdorf

philipp.walker@xxxxxxxxxx
www.binatec.ch

References to:
Ian Plain

[Date Prev][Date Next][Thread Prev] [Thread Next][Date Index] [Thread Index]