Esempio n. 1
0
require_once "./Assets/PHP/class.inc/class.phone.inc";
//	Phone/Channel member abstraction class.
require_once "./Assets/PHP/class.inc/class.cliParser.inc";
//	Attempts to parse CLI command results
//	into meaningfull Arrays.
require_once "./Assets/PHP/inc/AsterClick_argv.inc";
//	Handles situtations related
//	Commandline startup and related arguments.
require_once "./Assets/PHP/inc/AsterClick_socket.inc";
//	Functions handling socket interactions
//	with Asterisk AMI.
//require_once("AsterClick_signal.inc"				);	//	Functions handling signal handlers
require_once "./Assets/PHP/caseEvent.php";
//	Used to vector AMI events by name as well
//	as some pseudo AsterClick events.
$oINIagents = new CLASSini(array("FILE" => "../agents.conf"));
$szSavecallsin = $oINIagents->getIniValue("agents", "savecallsin");
//print "\nsavecallsin=".$szSavecallsin;
$oSHM = new shm();
// Gets set to an instance of the shm shared memory class
$oMSGqueue = new msgQueue();
// System V message queue
$iSequence = 1;
// Command sequence number
/*	Function	:	array2command()
**	Parameters	:	Array() $aParams	- Name/Value array
**	Returns		:	Constructed packet to send to Asterisk
**	Description	:	This function builds a string with a ":" between
**				each name and value, and and a CR+LF between each name/value pair.
*/
function array2command($aParams = array())
Esempio n. 2
0
$szAMIhost = "127.0.0.1";
// Host running the asterisk server.
$szAMIusername = "******";
// Found in asterisk etc/asterisk/manager.conf [username].
$szAMIsecret = "AsterClickSecret";
// Found in asterisk etc/asterisk/manager.conf secret.
$iAMIport = 5038;
// port AsterClick connects to for Asterisk AMI
$szWebSocketHost = "0.0.0.0";
// Host to connect to.
$iWebSocketPort = 150;
// Port your web browser will connect to.
$szPHPtimeZone = 'America/Los_Angeles';
// Local timezone to use.
include "Assets/PHP/class.inc/class.ini.inc";
$oAsterClickConfig = new CLASSini(array("FILE" => "AsterClickServer.conf"));
//$szTest=$oAsterClickConfig->getIniValue("ami"		,"username"	,$szAMIusername	);
//print "AsterClick manager user (".$szTest.")";
$szAMIhost = $oAsterClickConfig->getIniValue("ami", "host", $szAMIhost);
$szAMIusername = $oAsterClickConfig->getIniValue("ami", "username", $szAMIusername);
$szAMIsecret = $oAsterClickConfig->getIniValue("ami", "secret", $szAMIsecret);
$szAMIport = $oAsterClickConfig->getIniValue("ami", "port", $iAMIport);
//$iAMIport	=5038				;// port AsterClick connects to for Asterisk AMI
$szWebSocketHost = $oAsterClickConfig->getIniValue("websockets", "host", $szWebSocketHost);
$iWebSocketPort = $oAsterClickConfig->getIniValue("websockets", "port", $iWebSocketPort);
$szPHPtimeZone = $oAsterClickConfig->getIniValue("php", "timezone", $szPHPtimeZone);
date_default_timezone_set($szPHPtimeZone);
/*************************************************
**	SMTP parameters	"SMTP"|"MAIL"|"SENDMAIL"**
**	See class.smtp.inc for details.		**
*************************************************/