From bb338f68c8b9e05f6a4ef2fa809ff6a118b1b7c9 Mon Sep 17 00:00:00 2001 From: Marcelo Gornstein Date: Sun, 3 Jan 2016 15:20:27 -0300 Subject: [PATCH] adding doc dir --- build.xml | 2 +- doc/ApiIndex.md | 74 + doc/PAGI-Application-PAGIApplication.md | 171 ++ doc/PAGI-CDR-ICDR.md | 319 +++ doc/PAGI-CDR-Impl-CDRFacade.md | 436 ++++ doc/PAGI-CallSpool-CallFile.md | 527 +++++ ...-CallSpool-Exception-CallSpoolException.md | 19 + doc/PAGI-CallSpool-ICallSpool.md | 37 + doc/PAGI-CallSpool-Impl-CallSpoolImpl.md | 107 + doc/PAGI-CallerId-ICallerId.md | 190 ++ doc/PAGI-CallerId-Impl-CallerIdFacade.md | 276 +++ ...PAGI-ChannelVariables-IChannelVariables.md | 465 ++++ ...elVariables-Impl-ChannelVariablesFacade.md | 556 +++++ doc/PAGI-Client-AbstractClient.md | 1158 ++++++++++ doc/PAGI-Client-ChannelStatus.md | 104 + doc/PAGI-Client-IClient.md | 920 ++++++++ doc/PAGI-Client-Impl-ClientImpl.md | 1252 +++++++++++ doc/PAGI-Client-Impl-MockedClientImpl.md | 1623 ++++++++++++++ doc/PAGI-Client-Result-AmdResult.md | 381 ++++ doc/PAGI-Client-Result-DataReadResult.md | 217 ++ doc/PAGI-Client-Result-DialResult.md | 470 ++++ doc/PAGI-Client-Result-DigitReadResult.md | 219 ++ doc/PAGI-Client-Result-ExecResult.md | 152 ++ doc/PAGI-Client-Result-FaxResult.md | 461 ++++ doc/PAGI-Client-Result-IReadResult.md | 146 ++ doc/PAGI-Client-Result-IResult.md | 101 + doc/PAGI-Client-Result-PlayResult.md | 195 ++ doc/PAGI-Client-Result-ReadResultDecorator.md | 192 ++ doc/PAGI-Client-Result-RecordResult.md | 282 +++ doc/PAGI-Client-Result-Result.md | 183 ++ doc/PAGI-Client-Result-ResultDecorator.md | 150 ++ ...PAGI-DialDescriptor-DAHDIDialDescriptor.md | 176 ++ doc/PAGI-DialDescriptor-DialDescriptor.md | 78 + ...PAGI-DialDescriptor-LocalDialDescriptor.md | 108 + doc/PAGI-DialDescriptor-SIPDialDescriptor.md | 135 ++ doc/PAGI-Exception-ChannelDownException.md | 19 + ...Exception-DatabaseInvalidEntryException.md | 20 + doc/PAGI-Exception-ExecuteCommandException.md | 19 + doc/PAGI-Exception-InvalidCommandException.md | 19 + doc/PAGI-Exception-MockedException.md | 19 + doc/PAGI-Exception-PAGIException.md | 19 + doc/PAGI-Exception-RecordException.md | 19 + doc/PAGI-Exception-SoundFileException.md | 19 + doc/PAGI-Logger-Asterisk-IAsteriskLogger.md | 117 + ...Logger-Asterisk-Impl-AsteriskLoggerImpl.md | 192 ++ ...-Asterisk-Impl-MockedAsteriskLoggerImpl.md | 151 ++ doc/PAGI-Node-Exception-NodeException.md | 19 + doc/PAGI-Node-MockedNode.md | 1914 +++++++++++++++++ doc/PAGI-Node-Node.md | 1566 ++++++++++++++ doc/PAGI-Node-NodeActionCommand.md | 325 +++ doc/PAGI-Node-NodeController.md | 192 ++ 51 files changed, 16510 insertions(+), 1 deletion(-) create mode 100644 doc/ApiIndex.md create mode 100644 doc/PAGI-Application-PAGIApplication.md create mode 100644 doc/PAGI-CDR-ICDR.md create mode 100644 doc/PAGI-CDR-Impl-CDRFacade.md create mode 100644 doc/PAGI-CallSpool-CallFile.md create mode 100644 doc/PAGI-CallSpool-Exception-CallSpoolException.md create mode 100644 doc/PAGI-CallSpool-ICallSpool.md create mode 100644 doc/PAGI-CallSpool-Impl-CallSpoolImpl.md create mode 100644 doc/PAGI-CallerId-ICallerId.md create mode 100644 doc/PAGI-CallerId-Impl-CallerIdFacade.md create mode 100644 doc/PAGI-ChannelVariables-IChannelVariables.md create mode 100644 doc/PAGI-ChannelVariables-Impl-ChannelVariablesFacade.md create mode 100644 doc/PAGI-Client-AbstractClient.md create mode 100644 doc/PAGI-Client-ChannelStatus.md create mode 100644 doc/PAGI-Client-IClient.md create mode 100644 doc/PAGI-Client-Impl-ClientImpl.md create mode 100644 doc/PAGI-Client-Impl-MockedClientImpl.md create mode 100644 doc/PAGI-Client-Result-AmdResult.md create mode 100644 doc/PAGI-Client-Result-DataReadResult.md create mode 100644 doc/PAGI-Client-Result-DialResult.md create mode 100644 doc/PAGI-Client-Result-DigitReadResult.md create mode 100644 doc/PAGI-Client-Result-ExecResult.md create mode 100644 doc/PAGI-Client-Result-FaxResult.md create mode 100644 doc/PAGI-Client-Result-IReadResult.md create mode 100644 doc/PAGI-Client-Result-IResult.md create mode 100644 doc/PAGI-Client-Result-PlayResult.md create mode 100644 doc/PAGI-Client-Result-ReadResultDecorator.md create mode 100644 doc/PAGI-Client-Result-RecordResult.md create mode 100644 doc/PAGI-Client-Result-Result.md create mode 100644 doc/PAGI-Client-Result-ResultDecorator.md create mode 100644 doc/PAGI-DialDescriptor-DAHDIDialDescriptor.md create mode 100644 doc/PAGI-DialDescriptor-DialDescriptor.md create mode 100644 doc/PAGI-DialDescriptor-LocalDialDescriptor.md create mode 100644 doc/PAGI-DialDescriptor-SIPDialDescriptor.md create mode 100644 doc/PAGI-Exception-ChannelDownException.md create mode 100644 doc/PAGI-Exception-DatabaseInvalidEntryException.md create mode 100644 doc/PAGI-Exception-ExecuteCommandException.md create mode 100644 doc/PAGI-Exception-InvalidCommandException.md create mode 100644 doc/PAGI-Exception-MockedException.md create mode 100644 doc/PAGI-Exception-PAGIException.md create mode 100644 doc/PAGI-Exception-RecordException.md create mode 100644 doc/PAGI-Exception-SoundFileException.md create mode 100644 doc/PAGI-Logger-Asterisk-IAsteriskLogger.md create mode 100644 doc/PAGI-Logger-Asterisk-Impl-AsteriskLoggerImpl.md create mode 100644 doc/PAGI-Logger-Asterisk-Impl-MockedAsteriskLoggerImpl.md create mode 100644 doc/PAGI-Node-Exception-NodeException.md create mode 100644 doc/PAGI-Node-MockedNode.md create mode 100644 doc/PAGI-Node-Node.md create mode 100644 doc/PAGI-Node-NodeActionCommand.md create mode 100644 doc/PAGI-Node-NodeController.md diff --git a/build.xml b/build.xml index 89eb4e7..7aa584f 100644 --- a/build.xml +++ b/build.xml @@ -32,7 +32,7 @@ diff --git a/doc/ApiIndex.md b/doc/ApiIndex.md new file mode 100644 index 0000000..884e7ef --- /dev/null +++ b/doc/ApiIndex.md @@ -0,0 +1,74 @@ +API Index +========= + +* PAGI + * PAGI\Application + * [PAGIApplication](PAGI-Application-PAGIApplication.md) + * PAGI\CallerId + * [ICallerId](PAGI-CallerId-ICallerId.md) + * PAGI\CallerId\Impl + * [CallerIdFacade](PAGI-CallerId-Impl-CallerIdFacade.md) + * PAGI\CallSpool + * [CallFile](PAGI-CallSpool-CallFile.md) + * PAGI\CallSpool\Exception + * [CallSpoolException](PAGI-CallSpool-Exception-CallSpoolException.md) + * [ICallSpool](PAGI-CallSpool-ICallSpool.md) + * PAGI\CallSpool\Impl + * [CallSpoolImpl](PAGI-CallSpool-Impl-CallSpoolImpl.md) + * PAGI\CDR + * [ICDR](PAGI-CDR-ICDR.md) + * PAGI\CDR\Impl + * [CDRFacade](PAGI-CDR-Impl-CDRFacade.md) + * PAGI\ChannelVariables + * [IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + * PAGI\ChannelVariables\Impl + * [ChannelVariablesFacade](PAGI-ChannelVariables-Impl-ChannelVariablesFacade.md) + * PAGI\Client + * [AbstractClient](PAGI-Client-AbstractClient.md) + * [ChannelStatus](PAGI-Client-ChannelStatus.md) + * [IClient](PAGI-Client-IClient.md) + * PAGI\Client\Impl + * [ClientImpl](PAGI-Client-Impl-ClientImpl.md) + * [MockedClientImpl](PAGI-Client-Impl-MockedClientImpl.md) + * PAGI\Client\Result + * [AmdResult](PAGI-Client-Result-AmdResult.md) + * [DataReadResult](PAGI-Client-Result-DataReadResult.md) + * [DialResult](PAGI-Client-Result-DialResult.md) + * [DigitReadResult](PAGI-Client-Result-DigitReadResult.md) + * [ExecResult](PAGI-Client-Result-ExecResult.md) + * [FaxResult](PAGI-Client-Result-FaxResult.md) + * [IReadResult](PAGI-Client-Result-IReadResult.md) + * [IResult](PAGI-Client-Result-IResult.md) + * [PlayResult](PAGI-Client-Result-PlayResult.md) + * [ReadResultDecorator](PAGI-Client-Result-ReadResultDecorator.md) + * [RecordResult](PAGI-Client-Result-RecordResult.md) + * [Result](PAGI-Client-Result-Result.md) + * [ResultDecorator](PAGI-Client-Result-ResultDecorator.md) + * PAGI\DialDescriptor + * [DAHDIDialDescriptor](PAGI-DialDescriptor-DAHDIDialDescriptor.md) + * [DialDescriptor](PAGI-DialDescriptor-DialDescriptor.md) + * [LocalDialDescriptor](PAGI-DialDescriptor-LocalDialDescriptor.md) + * [SIPDialDescriptor](PAGI-DialDescriptor-SIPDialDescriptor.md) + * PAGI\Exception + * [ChannelDownException](PAGI-Exception-ChannelDownException.md) + * [DatabaseInvalidEntryException](PAGI-Exception-DatabaseInvalidEntryException.md) + * [ExecuteCommandException](PAGI-Exception-ExecuteCommandException.md) + * [InvalidCommandException](PAGI-Exception-InvalidCommandException.md) + * [MockedException](PAGI-Exception-MockedException.md) + * [PAGIException](PAGI-Exception-PAGIException.md) + * [RecordException](PAGI-Exception-RecordException.md) + * [SoundFileException](PAGI-Exception-SoundFileException.md) + * PAGI\Logger + * PAGI\Logger\Asterisk + * [IAsteriskLogger](PAGI-Logger-Asterisk-IAsteriskLogger.md) + * PAGI\Logger\Asterisk\Impl + * [AsteriskLoggerImpl](PAGI-Logger-Asterisk-Impl-AsteriskLoggerImpl.md) + * [MockedAsteriskLoggerImpl](PAGI-Logger-Asterisk-Impl-MockedAsteriskLoggerImpl.md) + * PAGI\Node + * PAGI\Node\Exception + * [NodeException](PAGI-Node-Exception-NodeException.md) + * [MockedNode](PAGI-Node-MockedNode.md) + * [Node](PAGI-Node-Node.md) + * [NodeActionCommand](PAGI-Node-NodeActionCommand.md) + * [NodeController](PAGI-Node-NodeController.md) + diff --git a/doc/PAGI-Application-PAGIApplication.md b/doc/PAGI-Application-PAGIApplication.md new file mode 100644 index 0000000..09401d3 --- /dev/null +++ b/doc/PAGI-Application-PAGIApplication.md @@ -0,0 +1,171 @@ +PAGI\Application\PAGIApplication +=============== + +Parent class for all PAGIApplications. + +PHP Version 5 + + +* Class name: PAGIApplication +* Namespace: PAGI\Application +* This is an **abstract** class + + + + + +Properties +---------- + + +### $logger + + protected \PAGI\Application\Logger $logger + +PSR-3 logger. + + + +* Visibility: **protected** + + +### $agiClient + + private \PAGI\Client\IClient $agiClient + +AGI Client. + + + +* Visibility: **private** + + +Methods +------- + + +### init + + void PAGI\Application\PAGIApplication::init() + +Called to initialize the application + + + +* Visibility: **public** +* This method is **abstract**. + + + + +### shutdown + + void PAGI\Application\PAGIApplication::shutdown() + +Called when PHPvm is shutting down. + + + +* Visibility: **public** +* This method is **abstract**. + + + + +### run + + void PAGI\Application\PAGIApplication::run() + +Called to run the application, after calling init(). + + + +* Visibility: **public** +* This method is **abstract**. + + + + +### errorHandler + + boolean PAGI\Application\PAGIApplication::errorHandler(integer $type, string $message, string $file, integer $line) + +Your error handler. Be careful when implementing this one. + + + +* Visibility: **public** +* This method is **abstract**. + + +#### Arguments +* $type **integer** - <p>PHP Error type constant.</p> +* $message **string** - <p>Human readable error message string.</p> +* $file **string** - <p>File that triggered the error.</p> +* $line **integer** - <p>Line that triggered the error.</p> + + + +### signalHandler + + void PAGI\Application\PAGIApplication::signalHandler(integer $signal) + +Your signal handler. Be careful when implementing this one. + + + +* Visibility: **public** +* This method is **abstract**. + + +#### Arguments +* $signal **integer** - <p>Signal catched.</p> + + + +### getAgi + + \PAGI\Client\IClient PAGI\Application\PAGIApplication::getAgi() + +Returns AGI Client. + + + +* Visibility: **protected** + + + + +### setLogger + + void PAGI\Application\PAGIApplication::setLogger(\PAGI\Application\Psr\Log\LoggerInterface $logger) + +Sets the logger implementation. + + + +* Visibility: **public** + + +#### Arguments +* $logger **PAGI\Application\Psr\Log\LoggerInterface** - <p>The PSR3-Logger</p> + + + +### __construct + + void PAGI\Application\PAGIApplication::__construct(array $properties) + +Constructor. Will call set_error_handler() and pcntl_signal() to setup +your errorHandler() and signalHandler(). Also will call +register_shutdown_function() to register your shutdown() function. + + + +* Visibility: **public** + + +#### Arguments +* $properties **array** - <p>Optional additional properties.</p> + + diff --git a/doc/PAGI-CDR-ICDR.md b/doc/PAGI-CDR-ICDR.md new file mode 100644 index 0000000..5b9747a --- /dev/null +++ b/doc/PAGI-CDR-ICDR.md @@ -0,0 +1,319 @@ +PAGI\CDR\ICDR +=============== + +CDR facade. Use this to access cdr variables. + +PHP Version 5 + + +* Interface name: ICDR +* Namespace: PAGI\CDR +* This is an **interface** + + + + + + +Methods +------- + + +### setUserfield + + void PAGI\CDR\ICDR::setUserfield(string $value) + +Set userfileds for cdr. CDR(userfield). + + + +* Visibility: **public** + + +#### Arguments +* $value **string** - <p>New userfields to use.</p> + + + +### getUserfield + + string PAGI\CDR\ICDR::getUserfield() + +The channels uses specified field (read-write). CDR(userfield). + + + +* Visibility: **public** + + + + +### getUniqueId + + string PAGI\CDR\ICDR::getUniqueId() + +The channel uniqueid. CDR(uniqueid). + + + +* Visibility: **public** + + + + +### setAccountCode + + void PAGI\CDR\ICDR::setAccountCode(string $value) + +Sets account code. CDR(accountcode). + + + +* Visibility: **public** + + +#### Arguments +* $value **string** - <p>New account code.</p> + + + +### getAccountCode + + string PAGI\CDR\ICDR::getAccountCode() + +The channel account code. CDR(accountcode). + + + +* Visibility: **public** + + + + +### getAMAFlags + + string PAGI\CDR\ICDR::getAMAFlags() + +DOCUMENTATION, BILL, IGNORE etc. CDR(amaflags). + + + +* Visibility: **public** + + + + +### getStatus + + string PAGI\CDR\ICDR::getStatus() + +Call result. CDR(disposition). + + + +* Visibility: **public** + + + + +### getAnswerLength + + string PAGI\CDR\ICDR::getAnswerLength() + +Total answered time for the call in seconds. CDR(billsec). + + + +* Visibility: **public** + + + + +### getTotalLength + + string PAGI\CDR\ICDR::getTotalLength() + +Total length of the call in seconds. CDR(duration). + + + +* Visibility: **public** + + + + +### getEndTime + + string PAGI\CDR\ICDR::getEndTime() + +Time the call ended. CDR(end). + + + +* Visibility: **public** + + + + +### getAnswerTime + + string PAGI\CDR\ICDR::getAnswerTime() + +Time the call was answered. CDR(answer). + + + +* Visibility: **public** + + + + +### getStartTime + + string PAGI\CDR\ICDR::getStartTime() + +Time the call started. CDR(start). + + + +* Visibility: **public** + + + + +### getLastAppData + + string PAGI\CDR\ICDR::getLastAppData() + +Returns Last application data. CDR(lastdata). + + + +* Visibility: **public** + + + + +### getLastApp + + string PAGI\CDR\ICDR::getLastApp() + +Returns Last application. CDR(lastapp). + + + +* Visibility: **public** + + + + +### getChannel + + string PAGI\CDR\ICDR::getChannel() + +Returns origin channel. CDR(channel). + + + +* Visibility: **public** + + + + +### getDestinationChannel + + string PAGI\CDR\ICDR::getDestinationChannel() + +Returns destination channel. CDR(dstchannel). + + + +* Visibility: **public** + + + + +### getCallerId + + string PAGI\CDR\ICDR::getCallerId() + +Returns caller id. CDR(clid). + + + +* Visibility: **public** + + + + +### getSource + + string PAGI\CDR\ICDR::getSource() + +Returns origin. CDR(src). + + + +* Visibility: **public** + + + + +### getDestination + + string PAGI\CDR\ICDR::getDestination() + +Returns destination. CDR(dst). + + + +* Visibility: **public** + + + + +### getDestinationContext + + string PAGI\CDR\ICDR::getDestinationContext() + +Returns destination context. CDR(dcontext). + + + +* Visibility: **public** + + + + +### getCustom + + string PAGI\CDR\ICDR::getCustom(string $name) + +Returns a custom field in the cdr. CDR(name) + + + +* Visibility: **public** + + +#### Arguments +* $name **string** - <p>Field name.</p> + + + +### setCustom + + void PAGI\CDR\ICDR::setCustom(string $name, string $value) + +Sets a custom field in the cdr. CDR(name). + + + +* Visibility: **public** + + +#### Arguments +* $name **string** - <p>Field name.</p> +* $value **string** - <p>Field value.</p> + + diff --git a/doc/PAGI-CDR-Impl-CDRFacade.md b/doc/PAGI-CDR-Impl-CDRFacade.md new file mode 100644 index 0000000..d585819 --- /dev/null +++ b/doc/PAGI-CDR-Impl-CDRFacade.md @@ -0,0 +1,436 @@ +PAGI\CDR\Impl\CDRFacade +=============== + +CDR Facade. + +If the channel has a cdr, that cdr record has it's own set of variables which +can be accessed just like channel variables. The following builtin variables +are available and, unless specified, read-only. + +${CDR(clid)} Caller ID +${CDR(src)} Source +${CDR(dst)} Destination +${CDR(dcontext)} Destination context +${CDR(channel)} Channel name +${CDR(dstchannel)} Destination channel +${CDR(lastapp)} Last app executed +${CDR(lastdata)} Last app's arguments +${CDR(start)} Time the call started. +${CDR(answer)} Time the call was answered. +${CDR(end)} Time the call ended. +${CDR(duration)} Duration of the call. +${CDR(billsec)} Duration of the call once it was answered. +${CDR(disposition)} ANSWERED, NO ANSWER, BUSY +${CDR(amaflags)} DOCUMENTATION, BILL, IGNORE etc +${CDR(accountcode)} The channel's account code (read-write). +${CDR(uniqueid)} The channel's unique id. +${CDR(userfield)} The channels uses specified field (read-write). + + +In addition, you can set your own extra variables with a traditional +Set(CDR(var)=val) to anything you want. + +NOTE Some CDR values (eg: duration & billsec) can't be accessed until the call +has terminated. As of 91617, those values will be calculated on-demand if +requested. Until that makes it into a stable release, you can set +endbeforehexten=yes in cdr.conf, and then use the "hangup" context to wrap +up your call. + +PHP Version 5 + + +* Class name: CDRFacade +* Namespace: PAGI\CDR\Impl +* This class implements: [PAGI\CDR\ICDR](PAGI-CDR-ICDR.md) + + + + +Properties +---------- + + +### $client + + private \PAGI\Client\IClient $client + +AGI Client, needed to access cdr data. + + + +* Visibility: **private** + + +Methods +------- + + +### setUserfield + + void PAGI\CDR\ICDR::setUserfield(string $value) + +Set userfileds for cdr. CDR(userfield). + + + +* Visibility: **public** +* This method is defined by [PAGI\CDR\ICDR](PAGI-CDR-ICDR.md) + + +#### Arguments +* $value **string** - <p>New userfields to use.</p> + + + +### getUserfield + + string PAGI\CDR\ICDR::getUserfield() + +The channels uses specified field (read-write). CDR(userfield). + + + +* Visibility: **public** +* This method is defined by [PAGI\CDR\ICDR](PAGI-CDR-ICDR.md) + + + + +### getUniqueId + + string PAGI\CDR\ICDR::getUniqueId() + +The channel uniqueid. CDR(uniqueid). + + + +* Visibility: **public** +* This method is defined by [PAGI\CDR\ICDR](PAGI-CDR-ICDR.md) + + + + +### setAccountCode + + void PAGI\CDR\ICDR::setAccountCode(string $value) + +Sets account code. CDR(accountcode). + + + +* Visibility: **public** +* This method is defined by [PAGI\CDR\ICDR](PAGI-CDR-ICDR.md) + + +#### Arguments +* $value **string** - <p>New account code.</p> + + + +### getAccountCode + + string PAGI\CDR\ICDR::getAccountCode() + +The channel account code. CDR(accountcode). + + + +* Visibility: **public** +* This method is defined by [PAGI\CDR\ICDR](PAGI-CDR-ICDR.md) + + + + +### getAMAFlags + + string PAGI\CDR\ICDR::getAMAFlags() + +DOCUMENTATION, BILL, IGNORE etc. CDR(amaflags). + + + +* Visibility: **public** +* This method is defined by [PAGI\CDR\ICDR](PAGI-CDR-ICDR.md) + + + + +### getStatus + + string PAGI\CDR\ICDR::getStatus() + +Call result. CDR(disposition). + + + +* Visibility: **public** +* This method is defined by [PAGI\CDR\ICDR](PAGI-CDR-ICDR.md) + + + + +### getAnswerLength + + string PAGI\CDR\ICDR::getAnswerLength() + +Total answered time for the call in seconds. CDR(billsec). + + + +* Visibility: **public** +* This method is defined by [PAGI\CDR\ICDR](PAGI-CDR-ICDR.md) + + + + +### getTotalLength + + string PAGI\CDR\ICDR::getTotalLength() + +Total length of the call in seconds. CDR(duration). + + + +* Visibility: **public** +* This method is defined by [PAGI\CDR\ICDR](PAGI-CDR-ICDR.md) + + + + +### getEndTime + + string PAGI\CDR\ICDR::getEndTime() + +Time the call ended. CDR(end). + + + +* Visibility: **public** +* This method is defined by [PAGI\CDR\ICDR](PAGI-CDR-ICDR.md) + + + + +### getAnswerTime + + string PAGI\CDR\ICDR::getAnswerTime() + +Time the call was answered. CDR(answer). + + + +* Visibility: **public** +* This method is defined by [PAGI\CDR\ICDR](PAGI-CDR-ICDR.md) + + + + +### getStartTime + + string PAGI\CDR\ICDR::getStartTime() + +Time the call started. CDR(start). + + + +* Visibility: **public** +* This method is defined by [PAGI\CDR\ICDR](PAGI-CDR-ICDR.md) + + + + +### getLastAppData + + string PAGI\CDR\ICDR::getLastAppData() + +Returns Last application data. CDR(lastdata). + + + +* Visibility: **public** +* This method is defined by [PAGI\CDR\ICDR](PAGI-CDR-ICDR.md) + + + + +### getLastApp + + string PAGI\CDR\ICDR::getLastApp() + +Returns Last application. CDR(lastapp). + + + +* Visibility: **public** +* This method is defined by [PAGI\CDR\ICDR](PAGI-CDR-ICDR.md) + + + + +### getChannel + + string PAGI\CDR\ICDR::getChannel() + +Returns origin channel. CDR(channel). + + + +* Visibility: **public** +* This method is defined by [PAGI\CDR\ICDR](PAGI-CDR-ICDR.md) + + + + +### getDestinationChannel + + string PAGI\CDR\ICDR::getDestinationChannel() + +Returns destination channel. CDR(dstchannel). + + + +* Visibility: **public** +* This method is defined by [PAGI\CDR\ICDR](PAGI-CDR-ICDR.md) + + + + +### getCallerId + + string PAGI\CDR\ICDR::getCallerId() + +Returns caller id. CDR(clid). + + + +* Visibility: **public** +* This method is defined by [PAGI\CDR\ICDR](PAGI-CDR-ICDR.md) + + + + +### getSource + + string PAGI\CDR\ICDR::getSource() + +Returns origin. CDR(src). + + + +* Visibility: **public** +* This method is defined by [PAGI\CDR\ICDR](PAGI-CDR-ICDR.md) + + + + +### getDestination + + string PAGI\CDR\ICDR::getDestination() + +Returns destination. CDR(dst). + + + +* Visibility: **public** +* This method is defined by [PAGI\CDR\ICDR](PAGI-CDR-ICDR.md) + + + + +### getDestinationContext + + string PAGI\CDR\ICDR::getDestinationContext() + +Returns destination context. CDR(dcontext). + + + +* Visibility: **public** +* This method is defined by [PAGI\CDR\ICDR](PAGI-CDR-ICDR.md) + + + + +### getCustom + + string PAGI\CDR\ICDR::getCustom(string $name) + +Returns a custom field in the cdr. CDR(name) + + + +* Visibility: **public** +* This method is defined by [PAGI\CDR\ICDR](PAGI-CDR-ICDR.md) + + +#### Arguments +* $name **string** - <p>Field name.</p> + + + +### setCustom + + void PAGI\CDR\ICDR::setCustom(string $name, string $value) + +Sets a custom field in the cdr. CDR(name). + + + +* Visibility: **public** +* This method is defined by [PAGI\CDR\ICDR](PAGI-CDR-ICDR.md) + + +#### Arguments +* $name **string** - <p>Field name.</p> +* $value **string** - <p>Field value.</p> + + + +### getCDRVariable + + string PAGI\CDR\Impl\CDRFacade::getCDRVariable(string $name) + +Access AGI client to get the variables. + + + +* Visibility: **protected** + + +#### Arguments +* $name **string** - <p>Variable name.</p> + + + +### setCDRVariable + + void PAGI\CDR\Impl\CDRFacade::setCDRVariable(string $name, string $value) + +Access AGI client to set the variable. + + + +* Visibility: **protected** + + +#### Arguments +* $name **string** - <p>Variable name.</p> +* $value **string** - <p>Value.</p> + + + +### __construct + + void PAGI\CDR\Impl\CDRFacade::__construct(\PAGI\Client\IClient $client) + +Constructor. + + + +* Visibility: **public** + + +#### Arguments +* $client **[PAGI\Client\IClient](PAGI-Client-IClient.md)** - <p>AGI Client.</p> + + diff --git a/doc/PAGI-CallSpool-CallFile.md b/doc/PAGI-CallSpool-CallFile.md new file mode 100644 index 0000000..ea8a7ec --- /dev/null +++ b/doc/PAGI-CallSpool-CallFile.md @@ -0,0 +1,527 @@ +PAGI\CallSpool\CallFile +=============== + +A call file facade. + +PHP Version 5 + + +* Class name: CallFile +* Namespace: PAGI\CallSpool + + + + + +Properties +---------- + + +### $parameters + + private array $parameters + +Parameters. + + + +* Visibility: **private** + + +### $variables + + private array $variables + +Variables. + + + +* Visibility: **private** + + +Methods +------- + + +### getParameter + + string PAGI\CallSpool\CallFile::getParameter(string $key) + +Returns the value for the given parameter. + + + +* Visibility: **protected** + + +#### Arguments +* $key **string** - <p>Parameter name.</p> + + + +### setParameter + + void PAGI\CallSpool\CallFile::setParameter(string $key, string $value) + +Sets a given parameter with the given value. + + + +* Visibility: **protected** + + +#### Arguments +* $key **string** - <p>Parameter name.</p> +* $value **string** - <p>Value.</p> + + + +### getVariable + + string PAGI\CallSpool\CallFile::getVariable(string $key) + +Returns the value for the given variable. + + + +* Visibility: **public** + + +#### Arguments +* $key **string** - <p>Variable name.</p> + + + +### setVariable + + void PAGI\CallSpool\CallFile::setVariable(string $key, string $value) + +Sets a given variable with the given value. + + + +* Visibility: **public** + + +#### Arguments +* $key **string** - <p>Variable name.</p> +* $value **string** - <p>Value.</p> + + + +### getChannel + + string PAGI\CallSpool\CallFile::getChannel() + +Returns channel to use for the call. + + + +* Visibility: **public** + + + + +### getCallerId + + string PAGI\CallSpool\CallFile::getCallerId() + +Returns Caller ID, Please note: It may not work if you do not respect +the format: CallerID: "Some Name" <1234> + + + +* Visibility: **public** + + + + +### setCallerId + + void PAGI\CallSpool\CallFile::setCallerId(string $value) + +Sets the Caller ID, Please note: It may not work if you do not respect +the format: CallerID: "Some Name" <1234> + + + +* Visibility: **public** + + +#### Arguments +* $value **string** - <p>Value to set.</p> + + + +### getWaitTime + + integer PAGI\CallSpool\CallFile::getWaitTime() + +Returns seconds to wait for an answer. Default is 45. + + + +* Visibility: **public** + + + + +### setWaitTime + + void PAGI\CallSpool\CallFile::setWaitTime(integer $value) + +Sets seconds to wait for an answer. Default is 45. + + + +* Visibility: **public** + + +#### Arguments +* $value **integer** - <p>Value to set.</p> + + + +### getMaxRetries + + integer PAGI\CallSpool\CallFile::getMaxRetries() + +Returns number of retries before failing (not including the initial +attempt, e.g. 0 = total of 1 attempt to make the call). Default is 0. + + + +* Visibility: **public** + + + + +### setMaxRetries + + void PAGI\CallSpool\CallFile::setMaxRetries(integer $value) + +Sets number of retries before failing (not including the initial +attempt, e.g. 0 = total of 1 attempt to make the call). Default is 0. + + + +* Visibility: **public** + + +#### Arguments +* $value **integer** - <p>Value to set.</p> + + + +### getRetryTime + + integer PAGI\CallSpool\CallFile::getRetryTime() + +Returns seconds between retries, Don't hammer an unavailable phone. + +Default is 300 (5 min). + +* Visibility: **public** + + + + +### setRetryTime + + void PAGI\CallSpool\CallFile::setRetryTime(integer $value) + +Sets seconds between retries, Don't hammer an unavailable phone. + +Default is 300 (5 min). + +* Visibility: **public** + + +#### Arguments +* $value **integer** - <p>Value to set.</p> + + + +### getAccount + + string PAGI\CallSpool\CallFile::getAccount() + +Returns account code to use for this call. + + + +* Visibility: **public** + + + + +### setAccount + + void PAGI\CallSpool\CallFile::setAccount(string $value) + +Sets account code to use for this call. + + + +* Visibility: **public** + + +#### Arguments +* $value **string** - <p>Value to set.</p> + + + +### getContext + + string PAGI\CallSpool\CallFile::getContext() + +Returns context to use for this call when answered. + + + +* Visibility: **public** + + + + +### setContext + + void PAGI\CallSpool\CallFile::setContext(string $value) + +Sets context to use for this call when answered. + + + +* Visibility: **public** + + +#### Arguments +* $value **string** - <p>Value to set.</p> + + + +### getPriority + + string PAGI\CallSpool\CallFile::getPriority() + +Returns priority to use for this call when answered. + + + +* Visibility: **public** + + + + +### setPriority + + void PAGI\CallSpool\CallFile::setPriority(string $value) + +Sets priority to use for this call when answered. + + + +* Visibility: **public** + + +#### Arguments +* $value **string** - <p>Value to set.</p> + + + +### getExtension + + string PAGI\CallSpool\CallFile::getExtension() + +Returns extension to use for this call when answered. + + + +* Visibility: **public** + + + + +### setExtension + + void PAGI\CallSpool\CallFile::setExtension(string $value) + +Sets extension to use for this call when answered. + + + +* Visibility: **public** + + +#### Arguments +* $value **string** - <p>Value to set.</p> + + + +### getApplication + + string PAGI\CallSpool\CallFile::getApplication() + +Returns Asterisk Application to run (use instead of specifiying context, +extension and priority) + + + +* Visibility: **public** + + + + +### setApplication + + void PAGI\CallSpool\CallFile::setApplication(string $value) + +Sets Asterisk Application to run (use instead of specifiying context, +extension and priority) + + + +* Visibility: **public** + + +#### Arguments +* $value **string** - <p>Value to set.</p> + + + +### getApplicationData + + string PAGI\CallSpool\CallFile::getApplicationData() + +Returns the options to be passed to application. + + + +* Visibility: **public** + + + + +### setApplicationData + + void PAGI\CallSpool\CallFile::setApplicationData(array $options) + +Sets the options to be passed to application. + + + +* Visibility: **public** + + +#### Arguments +* $options **array** + + + +### getAlwaysDelete + + boolean PAGI\CallSpool\CallFile::getAlwaysDelete() + +If the file's modification time is in the future, the call file will not +be deleted + + + +* Visibility: **public** + + + + +### setAlwaysDelete + + void PAGI\CallSpool\CallFile::setAlwaysDelete(boolean $value) + +If the file's modification time is in the future, the call file will not +be deleted + + + +* Visibility: **public** + + +#### Arguments +* $value **boolean** - <p>Value to set.</p> + + + +### getArchive + + boolean PAGI\CallSpool\CallFile::getArchive() + +Sets if should move to subdir "outgoing_done" with "Status: value", +where value can be Completed, Expired or Failed. + + + +* Visibility: **public** + + + + +### setArchive + + void PAGI\CallSpool\CallFile::setArchive(boolean $value) + +Sets if should move to subdir "outgoing_done" with "Status: value", +where value can be Completed, Expired or Failed. + + + +* Visibility: **public** + + +#### Arguments +* $value **boolean** - <p>Value to set.</p> + + + +### serialize + + string PAGI\CallSpool\CallFile::serialize() + +Returns the text describing this call file, ready to be spooled. + + + +* Visibility: **public** + + + + +### unserialize + + void PAGI\CallSpool\CallFile::unserialize(string $text) + +Deconstructs a call file from the given text. + + + +* Visibility: **public** + + +#### Arguments +* $text **string** - <p>A call file (intended to be pre-loaded, with +file_get_contents() or similar).</p> + + + +### __construct + + void PAGI\CallSpool\CallFile::__construct(\PAGI\DialDescriptor\DialDescriptor $dialDescriptor) + +Constructor. + + + +* Visibility: **public** + + +#### Arguments +* $dialDescriptor **[PAGI\DialDescriptor\DialDescriptor](PAGI-DialDescriptor-DialDescriptor.md)** + + diff --git a/doc/PAGI-CallSpool-Exception-CallSpoolException.md b/doc/PAGI-CallSpool-Exception-CallSpoolException.md new file mode 100644 index 0000000..4ea9d2c --- /dev/null +++ b/doc/PAGI-CallSpool-Exception-CallSpoolException.md @@ -0,0 +1,19 @@ +PAGI\CallSpool\Exception\CallSpoolException +=============== + +This exception indicates an error related to the call spool. + +PHP Version 5 + + +* Class name: CallSpoolException +* Namespace: PAGI\CallSpool\Exception +* Parent class: [PAGI\Exception\PAGIException](PAGI-Exception-PAGIException.md) + + + + + + + + diff --git a/doc/PAGI-CallSpool-ICallSpool.md b/doc/PAGI-CallSpool-ICallSpool.md new file mode 100644 index 0000000..938aba9 --- /dev/null +++ b/doc/PAGI-CallSpool-ICallSpool.md @@ -0,0 +1,37 @@ +PAGI\CallSpool\ICallSpool +=============== + +An interface to access asterisk call spool. + +PHP Version 5 + + +* Interface name: ICallSpool +* Namespace: PAGI\CallSpool +* This is an **interface** + + + + + + +Methods +------- + + +### spool + + void PAGI\CallSpool\ICallSpool::spool(\PAGI\CallSpool\CallFile $call, integer $schedule) + +Spools the given call. + + + +* Visibility: **public** + + +#### Arguments +* $call **[PAGI\CallSpool\CallFile](PAGI-CallSpool-CallFile.md)** - <p>Call to spool.</p> +* $schedule **integer** - <p>Optional unix timestamp to schedule the call.</p> + + diff --git a/doc/PAGI-CallSpool-Impl-CallSpoolImpl.md b/doc/PAGI-CallSpool-Impl-CallSpoolImpl.md new file mode 100644 index 0000000..8826cae --- /dev/null +++ b/doc/PAGI-CallSpool-Impl-CallSpoolImpl.md @@ -0,0 +1,107 @@ +PAGI\CallSpool\Impl\CallSpoolImpl +=============== + +An implementation for asterisk call spool. + +PHP Version 5 + + +* Class name: CallSpoolImpl +* Namespace: PAGI\CallSpool\Impl +* This class implements: [PAGI\CallSpool\ICallSpool](PAGI-CallSpool-ICallSpool.md) + + + + +Properties +---------- + + +### $tmpDir + + private string $tmpDir = '/tmp' + +Where to temporary generate call files. + + + +* Visibility: **private** + + +### $spoolDir + + private string $spoolDir = '/var/spool/asterisk' + +Asterisk spool directory. + + + +* Visibility: **private** + + +### $instance + + private \PAGI\CallSpool\Impl\CallSpoolImpl $instance = false + +Current instance. + + + +* Visibility: **private** +* This property is **static**. + + +Methods +------- + + +### getInstance + + \PAGI\CallSpool\Impl\CallSpoolImpl PAGI\CallSpool\Impl\CallSpoolImpl::getInstance(array $options) + +Returns an instance for this spool/ + + + +* Visibility: **public** +* This method is **static**. + + +#### Arguments +* $options **array<mixed,string>** - <p>Configuration options.</p> + + + +### spool + + void PAGI\CallSpool\ICallSpool::spool(\PAGI\CallSpool\CallFile $call, integer $schedule) + +Spools the given call. + + + +* Visibility: **public** +* This method is defined by [PAGI\CallSpool\ICallSpool](PAGI-CallSpool-ICallSpool.md) + + +#### Arguments +* $call **[PAGI\CallSpool\CallFile](PAGI-CallSpool-CallFile.md)** - <p>Call to spool.</p> +* $schedule **integer** - <p>Optional unix timestamp to schedule the call.</p> + + + +### __construct + + void PAGI\CallSpool\Impl\CallSpoolImpl::__construct(array $options) + +Constructor. + + + +* Visibility: **private** + + +#### Arguments +* $options **array<mixed,string>** - <p>Options for this spool.</p> + + diff --git a/doc/PAGI-CallerId-ICallerId.md b/doc/PAGI-CallerId-ICallerId.md new file mode 100644 index 0000000..81b7ca0 --- /dev/null +++ b/doc/PAGI-CallerId-ICallerId.md @@ -0,0 +1,190 @@ +PAGI\CallerId\ICallerId +=============== + +AGI Caller id facade. + +PHP Version 5 + + +* Interface name: ICallerId +* Namespace: PAGI\CallerId +* This is an **interface** + + + + + + +Methods +------- + + +### setANI + + void PAGI\CallerId\ICallerId::setANI(string $value) + +Sets caller id ani. CALLERID(ani). + + + +* Visibility: **public** + + +#### Arguments +* $value **string** - <p>ANI.</p> + + + +### getANI + + string PAGI\CallerId\ICallerId::getANI() + +Returns caller id ani. CALLERID(ani) + + + +* Visibility: **public** + + + + +### setDNID + + void PAGI\CallerId\ICallerId::setDNID(string $value) + +Sets caller id dnid. CALLERID(dnid) + + + +* Visibility: **public** + + +#### Arguments +* $value **string** - <p>DNID.</p> + + + +### getDNID + + string PAGI\CallerId\ICallerId::getDNID() + +Returns caller id dnid. CALLERID(dnid) + + + +* Visibility: **public** + + + + +### setRDNIS + + void PAGI\CallerId\ICallerId::setRDNIS(string $value) + +Sets caller id rdnis. CALLERID(rdnis) + + + +* Visibility: **public** + + +#### Arguments +* $value **string** - <p>RDNIS.</p> + + + +### getRDNIS + + string PAGI\CallerId\ICallerId::getRDNIS() + +Returns caller id rdnis. CALLERID(rdnis) + + + +* Visibility: **public** + + + + +### setName + + void PAGI\CallerId\ICallerId::setName(string $value) + +Sets caller id name. CALLERID(name) + + + +* Visibility: **public** + + +#### Arguments +* $value **string** - <p>Name.</p> + + + +### getName + + string PAGI\CallerId\ICallerId::getName() + +Returns caller id name. CALLERID(name) + + + +* Visibility: **public** + + + + +### getNumber + + string PAGI\CallerId\ICallerId::getNumber() + +Returns caller id number. CALLERID(num) + + + +* Visibility: **public** + + + + +### setNumber + + void PAGI\CallerId\ICallerId::setNumber(string $value) + +Sets caller id number. CALLERID(num) + + + +* Visibility: **public** + + +#### Arguments +* $value **string** - <p>Number.</p> + + + +### setCallerPres + + void PAGI\CallerId\ICallerId::setCallerPres(string $presentationMode) + +Changes the caller id presentation mode. + + + +* Visibility: **public** + + +#### Arguments +* $presentationMode **string** - <p>Can be one of: +allowed_not_screened - Presentation Allowed, Not Screened. +allowed_passed_screen - Presentation Allowed, Passed Screen. +allowed_failed_screen - Presentation Allowed, Failed Screen. +allowed - Presentation Allowed, Network Number. +prohib_not_screened - Presentation Prohibited, Not Screened. +prohib_passed_screen - Presentation Prohibited, Passed Screen. +prohib_failed_screen - Presentation Prohibited, Failed Screen. +prohib - Presentation Prohibited, Network Number. +unavailable - Number Unavailable.</p> + + diff --git a/doc/PAGI-CallerId-Impl-CallerIdFacade.md b/doc/PAGI-CallerId-Impl-CallerIdFacade.md new file mode 100644 index 0000000..cac17bd --- /dev/null +++ b/doc/PAGI-CallerId-Impl-CallerIdFacade.md @@ -0,0 +1,276 @@ +PAGI\CallerId\Impl\CallerIdFacade +=============== + +AGI Caller id facade. + +PHP Version 5 + + +* Class name: CallerIdFacade +* Namespace: PAGI\CallerId\Impl +* This class implements: [PAGI\CallerId\ICallerId](PAGI-CallerId-ICallerId.md) + + + + +Properties +---------- + + +### $client + + private \PAGI\Client\IClient $client + +Instance of client to access caller id variables. + + + +* Visibility: **private** + + +Methods +------- + + +### setANI + + void PAGI\CallerId\ICallerId::setANI(string $value) + +Sets caller id ani. CALLERID(ani). + + + +* Visibility: **public** +* This method is defined by [PAGI\CallerId\ICallerId](PAGI-CallerId-ICallerId.md) + + +#### Arguments +* $value **string** - <p>ANI.</p> + + + +### getANI + + string PAGI\CallerId\ICallerId::getANI() + +Returns caller id ani. CALLERID(ani) + + + +* Visibility: **public** +* This method is defined by [PAGI\CallerId\ICallerId](PAGI-CallerId-ICallerId.md) + + + + +### setDNID + + void PAGI\CallerId\ICallerId::setDNID(string $value) + +Sets caller id dnid. CALLERID(dnid) + + + +* Visibility: **public** +* This method is defined by [PAGI\CallerId\ICallerId](PAGI-CallerId-ICallerId.md) + + +#### Arguments +* $value **string** - <p>DNID.</p> + + + +### getDNID + + string PAGI\CallerId\ICallerId::getDNID() + +Returns caller id dnid. CALLERID(dnid) + + + +* Visibility: **public** +* This method is defined by [PAGI\CallerId\ICallerId](PAGI-CallerId-ICallerId.md) + + + + +### setRDNIS + + void PAGI\CallerId\ICallerId::setRDNIS(string $value) + +Sets caller id rdnis. CALLERID(rdnis) + + + +* Visibility: **public** +* This method is defined by [PAGI\CallerId\ICallerId](PAGI-CallerId-ICallerId.md) + + +#### Arguments +* $value **string** - <p>RDNIS.</p> + + + +### getRDNIS + + string PAGI\CallerId\ICallerId::getRDNIS() + +Returns caller id rdnis. CALLERID(rdnis) + + + +* Visibility: **public** +* This method is defined by [PAGI\CallerId\ICallerId](PAGI-CallerId-ICallerId.md) + + + + +### setName + + void PAGI\CallerId\ICallerId::setName(string $value) + +Sets caller id name. CALLERID(name) + + + +* Visibility: **public** +* This method is defined by [PAGI\CallerId\ICallerId](PAGI-CallerId-ICallerId.md) + + +#### Arguments +* $value **string** - <p>Name.</p> + + + +### getName + + string PAGI\CallerId\ICallerId::getName() + +Returns caller id name. CALLERID(name) + + + +* Visibility: **public** +* This method is defined by [PAGI\CallerId\ICallerId](PAGI-CallerId-ICallerId.md) + + + + +### getNumber + + string PAGI\CallerId\ICallerId::getNumber() + +Returns caller id number. CALLERID(num) + + + +* Visibility: **public** +* This method is defined by [PAGI\CallerId\ICallerId](PAGI-CallerId-ICallerId.md) + + + + +### setNumber + + void PAGI\CallerId\ICallerId::setNumber(string $value) + +Sets caller id number. CALLERID(num) + + + +* Visibility: **public** +* This method is defined by [PAGI\CallerId\ICallerId](PAGI-CallerId-ICallerId.md) + + +#### Arguments +* $value **string** - <p>Number.</p> + + + +### getCallerIdVariable + + string PAGI\CallerId\Impl\CallerIdFacade::getCallerIdVariable(string $name) + +Access AGI client to get the variables. + + + +* Visibility: **protected** + + +#### Arguments +* $name **string** - <p>Variable name.</p> + + + +### setCallerIdVariable + + void PAGI\CallerId\Impl\CallerIdFacade::setCallerIdVariable(string $name, string $value) + +Access AGI client to set the variable. + + + +* Visibility: **protected** + + +#### Arguments +* $name **string** - <p>Variable name.</p> +* $value **string** - <p>Value.</p> + + + +### setCallerPres + + void PAGI\CallerId\ICallerId::setCallerPres(string $presentationMode) + +Changes the caller id presentation mode. + + + +* Visibility: **public** +* This method is defined by [PAGI\CallerId\ICallerId](PAGI-CallerId-ICallerId.md) + + +#### Arguments +* $presentationMode **string** - <p>Can be one of: +allowed_not_screened - Presentation Allowed, Not Screened. +allowed_passed_screen - Presentation Allowed, Passed Screen. +allowed_failed_screen - Presentation Allowed, Failed Screen. +allowed - Presentation Allowed, Network Number. +prohib_not_screened - Presentation Prohibited, Not Screened. +prohib_passed_screen - Presentation Prohibited, Passed Screen. +prohib_failed_screen - Presentation Prohibited, Failed Screen. +prohib - Presentation Prohibited, Network Number. +unavailable - Number Unavailable.</p> + + + +### __toString + + string PAGI\CallerId\Impl\CallerIdFacade::__toString() + +Standard procedure. + + + +* Visibility: **public** + + + + +### __construct + + void PAGI\CallerId\Impl\CallerIdFacade::__construct(\PAGI\Client\IClient $client) + +Constructor. + + + +* Visibility: **public** + + +#### Arguments +* $client **[PAGI\Client\IClient](PAGI-Client-IClient.md)** - <p>AGI Client to use.</p> + + diff --git a/doc/PAGI-ChannelVariables-IChannelVariables.md b/doc/PAGI-ChannelVariables-IChannelVariables.md new file mode 100644 index 0000000..1b4e035 --- /dev/null +++ b/doc/PAGI-ChannelVariables-IChannelVariables.md @@ -0,0 +1,465 @@ +PAGI\ChannelVariables\IChannelVariables +=============== + +ChannelVariables facade. Use this to access channel variables. + +PHP Version 5 + + +* Interface name: IChannelVariables +* Namespace: PAGI\ChannelVariables +* This is an **interface** + + + + + + +Methods +------- + + +### getChannel + + string PAGI\ChannelVariables\IChannelVariables::getChannel() + +Returns channel (agi_channel). + + + +* Visibility: **public** + + + + +### getLanguage + + string PAGI\ChannelVariables\IChannelVariables::getLanguage() + +Returns language (agi_language). + + + +* Visibility: **public** + + + + +### getType + + string PAGI\ChannelVariables\IChannelVariables::getType() + +Returns channel type (agi_type). + + + +* Visibility: **public** + + + + +### getUniqueId + + string PAGI\ChannelVariables\IChannelVariables::getUniqueId() + +Returns channel uniqueid (agi_uniqueid). + + + +* Visibility: **public** + + + + +### getVersion + + string PAGI\ChannelVariables\IChannelVariables::getVersion() + +Returns asterisk version (agi_version). + + + +* Visibility: **public** + + + + +### getCallerId + + string PAGI\ChannelVariables\IChannelVariables::getCallerId() + +Returns caller id number (agi_callerid). + + + +* Visibility: **public** + + + + +### getCallerIdName + + string PAGI\ChannelVariables\IChannelVariables::getCallerIdName() + +Returns caller id name (agi_calleridname). + + + +* Visibility: **public** + + + + +### getCallingPres + + string PAGI\ChannelVariables\IChannelVariables::getCallingPres() + +Returns CallingPres (agi_callingpres). + + + +* Visibility: **public** + + + + +### getCallingAni2 + + string PAGI\ChannelVariables\IChannelVariables::getCallingAni2() + +Returns CallingAni (agi_callingani2). + + + +* Visibility: **public** + + + + +### getCallingTon + + string PAGI\ChannelVariables\IChannelVariables::getCallingTon() + +Returns CallingTon (agi_callington). + + + +* Visibility: **public** + + + + +### getCallingTns + + string PAGI\ChannelVariables\IChannelVariables::getCallingTns() + +Returns CallingTns (agi_callingtns). + + + +* Visibility: **public** + + + + +### getDNID + + string PAGI\ChannelVariables\IChannelVariables::getDNID() + +Returns DNID (agi_dnid). + + + +* Visibility: **public** + + + + +### getContext + + string PAGI\ChannelVariables\IChannelVariables::getContext() + +Returns context (agi_context). + + + +* Visibility: **public** + + + + +### getRDNIS + + string PAGI\ChannelVariables\IChannelVariables::getRDNIS() + +Returns RDNIS (agi_rdnis). + + + +* Visibility: **public** + + + + +### getRequest + + string PAGI\ChannelVariables\IChannelVariables::getRequest() + +Returns agi requested (agi_request). + + + +* Visibility: **public** + + + + +### getDNIS + + string PAGI\ChannelVariables\IChannelVariables::getDNIS() + +Returns extension dialed (dnis) (agi_extension). + + + +* Visibility: **public** + + + + +### getThreadId + + string PAGI\ChannelVariables\IChannelVariables::getThreadId() + +Returns thread id (agi_threadid). + + + +* Visibility: **public** + + + + +### getAccountCode + + string PAGI\ChannelVariables\IChannelVariables::getAccountCode() + +Returns account code (agi_accountcode). + + + +* Visibility: **public** + + + + +### getEnhanced + + string PAGI\ChannelVariables\IChannelVariables::getEnhanced() + +Returns if using enhanced (agi_enhanced). + + + +* Visibility: **public** + + + + +### getPriority + + string PAGI\ChannelVariables\IChannelVariables::getPriority() + +Returns context priority (agi_priority). + + + +* Visibility: **public** + + + + +### getTotalArguments + + integer PAGI\ChannelVariables\IChannelVariables::getTotalArguments() + +Returns total number of agi arguments. + + + +* Visibility: **public** + + + + +### getArgument + + string PAGI\ChannelVariables\IChannelVariables::getArgument(integer $index) + +Returns the given agi argument. (agi_arg_N). + + + +* Visibility: **public** + + +#### Arguments +* $index **integer** - <p>Argument number, starting with 0.</p> + + + +### getArguments + + array PAGI\ChannelVariables\IChannelVariables::getArguments() + +Returns all arguments as an array. + + + +* Visibility: **public** + + + + +### getDirectoryConfig + + string PAGI\ChannelVariables\IChannelVariables::getDirectoryConfig() + +Returns the config directory for this running version of asterisk. + +Uses environment variable AST_CONFIG_DIR. + +* Visibility: **public** + + + + +### getConfigFile + + string PAGI\ChannelVariables\IChannelVariables::getConfigFile() + +Returns the config file for this running version of asterisk. + +Uses environment variable AST_CONFIG_FILE. + +* Visibility: **public** + + + + +### getDirectoryModules + + string PAGI\ChannelVariables\IChannelVariables::getDirectoryModules() + +Returns the modules directory for this running version of asterisk. + +Uses environment variable AST_MODULE_DIR. + +* Visibility: **public** + + + + +### getDirectorySpool + + string PAGI\ChannelVariables\IChannelVariables::getDirectorySpool() + +Returns the spool directory for this running version of asterisk. + +Uses environment variable AST_SPOOL_DIR. + +* Visibility: **public** + + + + +### getDirectoryMonitor + + string PAGI\ChannelVariables\IChannelVariables::getDirectoryMonitor() + +Returns the monitor directory for this running version of asterisk. + +Uses environment variable AST_MONITOR_DIR. + +* Visibility: **public** + + + + +### getDirectoryVar + + string PAGI\ChannelVariables\IChannelVariables::getDirectoryVar() + +Returns the var directory for this running version of asterisk. + +Uses environment variable AST_VAR_DIR. + +* Visibility: **public** + + + + +### getDirectoryData + + string PAGI\ChannelVariables\IChannelVariables::getDirectoryData() + +Returns the data directory for this running version of asterisk. + +Uses environment variable AST_DATA_DIR. + +* Visibility: **public** + + + + +### getDirectoryLog + + string PAGI\ChannelVariables\IChannelVariables::getDirectoryLog() + +Returns the log directory for this running version of asterisk. + +Uses environment variable AST_LOG_DIR. + +* Visibility: **public** + + + + +### getDirectoryAgi + + string PAGI\ChannelVariables\IChannelVariables::getDirectoryAgi() + +Returns the agi directory for this running version of asterisk. + +Uses environment variable AST_AGI_DIR. + +* Visibility: **public** + + + + +### getDirectoryKey + + string PAGI\ChannelVariables\IChannelVariables::getDirectoryKey() + +Returns the key directory for this running version of asterisk. + +Uses environment variable AST_KEY_DIR. + +* Visibility: **public** + + + + +### getDirectoryRun + + string PAGI\ChannelVariables\IChannelVariables::getDirectoryRun() + +Returns the run directory for this running version of asterisk. + +Uses environment variable AST_RUN_DIR. + +* Visibility: **public** + + + diff --git a/doc/PAGI-ChannelVariables-Impl-ChannelVariablesFacade.md b/doc/PAGI-ChannelVariables-Impl-ChannelVariablesFacade.md new file mode 100644 index 0000000..a91d857 --- /dev/null +++ b/doc/PAGI-ChannelVariables-Impl-ChannelVariablesFacade.md @@ -0,0 +1,556 @@ +PAGI\ChannelVariables\Impl\ChannelVariablesFacade +=============== + +ChannelVariables facade implementation. + +PHP Version 5 + + +* Class name: ChannelVariablesFacade +* Namespace: PAGI\ChannelVariables\Impl +* This class implements: [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +Properties +---------- + + +### $variables + + private array $variables + +Channel variables given by asterisk. + + + +* Visibility: **private** + + +### $arguments + + private array $arguments + +AGI Arguments (agi_arg_N). + + + +* Visibility: **private** + + +Methods +------- + + +### getAGIVariable + + string PAGI\ChannelVariables\Impl\ChannelVariablesFacade::getAGIVariable(string $key) + +Returns the given variable. Returns false if not set. + + + +* Visibility: **protected** + + +#### Arguments +* $key **string** - <p>Variable to get.</p> + + + +### getChannel + + string PAGI\ChannelVariables\IChannelVariables::getChannel() + +Returns channel (agi_channel). + + + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### getLanguage + + string PAGI\ChannelVariables\IChannelVariables::getLanguage() + +Returns language (agi_language). + + + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### getType + + string PAGI\ChannelVariables\IChannelVariables::getType() + +Returns channel type (agi_type). + + + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### getUniqueId + + string PAGI\ChannelVariables\IChannelVariables::getUniqueId() + +Returns channel uniqueid (agi_uniqueid). + + + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### getVersion + + string PAGI\ChannelVariables\IChannelVariables::getVersion() + +Returns asterisk version (agi_version). + + + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### getCallerId + + string PAGI\ChannelVariables\IChannelVariables::getCallerId() + +Returns caller id number (agi_callerid). + + + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### getCallerIdName + + string PAGI\ChannelVariables\IChannelVariables::getCallerIdName() + +Returns caller id name (agi_calleridname). + + + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### getCallingPres + + string PAGI\ChannelVariables\IChannelVariables::getCallingPres() + +Returns CallingPres (agi_callingpres). + + + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### getCallingAni2 + + string PAGI\ChannelVariables\IChannelVariables::getCallingAni2() + +Returns CallingAni (agi_callingani2). + + + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### getCallingTon + + string PAGI\ChannelVariables\IChannelVariables::getCallingTon() + +Returns CallingTon (agi_callington). + + + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### getCallingTns + + string PAGI\ChannelVariables\IChannelVariables::getCallingTns() + +Returns CallingTns (agi_callingtns). + + + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### getDNID + + string PAGI\ChannelVariables\IChannelVariables::getDNID() + +Returns DNID (agi_dnid). + + + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### getContext + + string PAGI\ChannelVariables\IChannelVariables::getContext() + +Returns context (agi_context). + + + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### getRDNIS + + string PAGI\ChannelVariables\IChannelVariables::getRDNIS() + +Returns RDNIS (agi_rdnis). + + + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### getRequest + + string PAGI\ChannelVariables\IChannelVariables::getRequest() + +Returns agi requested (agi_request). + + + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### getDNIS + + string PAGI\ChannelVariables\IChannelVariables::getDNIS() + +Returns extension dialed (dnis) (agi_extension). + + + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### getThreadId + + string PAGI\ChannelVariables\IChannelVariables::getThreadId() + +Returns thread id (agi_threadid). + + + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### getAccountCode + + string PAGI\ChannelVariables\IChannelVariables::getAccountCode() + +Returns account code (agi_accountcode). + + + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### getEnhanced + + string PAGI\ChannelVariables\IChannelVariables::getEnhanced() + +Returns if using enhanced (agi_enhanced). + + + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### getPriority + + string PAGI\ChannelVariables\IChannelVariables::getPriority() + +Returns context priority (agi_priority). + + + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### getTotalArguments + + integer PAGI\ChannelVariables\IChannelVariables::getTotalArguments() + +Returns total number of agi arguments. + + + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### getArgument + + string PAGI\ChannelVariables\IChannelVariables::getArgument(integer $index) + +Returns the given agi argument. (agi_arg_N). + + + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + +#### Arguments +* $index **integer** - <p>Argument number, starting with 0.</p> + + + +### getArguments + + array PAGI\ChannelVariables\IChannelVariables::getArguments() + +Returns all arguments as an array. + + + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### getDirectoryConfig + + string PAGI\ChannelVariables\IChannelVariables::getDirectoryConfig() + +Returns the config directory for this running version of asterisk. + +Uses environment variable AST_CONFIG_DIR. + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### getConfigFile + + string PAGI\ChannelVariables\IChannelVariables::getConfigFile() + +Returns the config file for this running version of asterisk. + +Uses environment variable AST_CONFIG_FILE. + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### getDirectoryModules + + string PAGI\ChannelVariables\IChannelVariables::getDirectoryModules() + +Returns the modules directory for this running version of asterisk. + +Uses environment variable AST_MODULE_DIR. + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### getDirectorySpool + + string PAGI\ChannelVariables\IChannelVariables::getDirectorySpool() + +Returns the spool directory for this running version of asterisk. + +Uses environment variable AST_SPOOL_DIR. + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### getDirectoryMonitor + + string PAGI\ChannelVariables\IChannelVariables::getDirectoryMonitor() + +Returns the monitor directory for this running version of asterisk. + +Uses environment variable AST_MONITOR_DIR. + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### getDirectoryVar + + string PAGI\ChannelVariables\IChannelVariables::getDirectoryVar() + +Returns the var directory for this running version of asterisk. + +Uses environment variable AST_VAR_DIR. + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### getDirectoryData + + string PAGI\ChannelVariables\IChannelVariables::getDirectoryData() + +Returns the data directory for this running version of asterisk. + +Uses environment variable AST_DATA_DIR. + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### getDirectoryLog + + string PAGI\ChannelVariables\IChannelVariables::getDirectoryLog() + +Returns the log directory for this running version of asterisk. + +Uses environment variable AST_LOG_DIR. + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### getDirectoryAgi + + string PAGI\ChannelVariables\IChannelVariables::getDirectoryAgi() + +Returns the agi directory for this running version of asterisk. + +Uses environment variable AST_AGI_DIR. + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### getDirectoryKey + + string PAGI\ChannelVariables\IChannelVariables::getDirectoryKey() + +Returns the key directory for this running version of asterisk. + +Uses environment variable AST_KEY_DIR. + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### getDirectoryRun + + string PAGI\ChannelVariables\IChannelVariables::getDirectoryRun() + +Returns the run directory for this running version of asterisk. + +Uses environment variable AST_RUN_DIR. + +* Visibility: **public** +* This method is defined by [PAGI\ChannelVariables\IChannelVariables](PAGI-ChannelVariables-IChannelVariables.md) + + + + +### __construct + + void PAGI\ChannelVariables\Impl\ChannelVariablesFacade::__construct(array $variables, array $arguments) + +Constructor. + + + +* Visibility: **public** + + +#### Arguments +* $variables **array<mixed,string>** - <p>Initial channel variables given by asterisk.</p> +* $arguments **array<mixed,string>** - <p>AGI arguments given by asterisk (agi_arg_N).</p> + + diff --git a/doc/PAGI-Client-AbstractClient.md b/doc/PAGI-Client-AbstractClient.md new file mode 100644 index 0000000..a9cbd62 --- /dev/null +++ b/doc/PAGI-Client-AbstractClient.md @@ -0,0 +1,1158 @@ +PAGI\Client\AbstractClient +=============== + +An abstract AGI client. + +PHP Version 5 + + +* Class name: AbstractClient +* Namespace: PAGI\Client +* This is an **abstract** class +* This class implements: [PAGI\Client\IClient](PAGI-Client-IClient.md) + + + + +Properties +---------- + + +### $logger + + protected \PAGI\Client\Logger $logger + +PSR-3 logger. + + + +* Visibility: **protected** + + +### $variables + + protected array $variables = array() + +Initial channel variables given by asterisk at start. + + + +* Visibility: **protected** + + +### $arguments + + protected array $arguments = array() + +Initial arguments given by the user in the dialplan. + + + +* Visibility: **protected** + + +### $cdrInstance + + protected mixed $cdrInstance = false + + + + + +* Visibility: **protected** + + +### $channelVariablesInstance + + protected mixed $channelVariablesInstance = false + + + + + +* Visibility: **protected** + + +### $clidInstance + + protected mixed $clidInstance = false + + + + + +* Visibility: **protected** + + +Methods +------- + + +### send + + \PAGI\Client\Result\Result PAGI\Client\AbstractClient::send(string $text) + +Sends a command to asterisk. Returns an array with: +[0] => AGI Result (3 digits) +[1] => Command result +[2] => Result data. + + + +* Visibility: **protected** +* This method is **abstract**. + + +#### Arguments +* $text **string** - <p>Command</p> + + + +### open + + void PAGI\Client\AbstractClient::open() + +Opens connection to agi. Will also read initial channel variables given +by asterisk when launching the agi. + + + +* Visibility: **protected** +* This method is **abstract**. + + + + +### close + + void PAGI\Client\AbstractClient::close() + +Closes the connection to agi. + + + +* Visibility: **protected** +* This method is **abstract**. + + + + +### getResultFromResultString + + \PAGI\Client\Result\Result PAGI\Client\AbstractClient::getResultFromResultString(\PAGI\Client\unknown_type $text) + +Returns a result object given a string (the agi result after executing +a command). + + + +* Visibility: **protected** + + +#### Arguments +* $text **PAGI\Client\unknown_type** + + + +### amd + + \PAGI\Client\Result\AmdResult PAGI\Client\IClient::amd(array $options) + +Runs the AMD() application. For a complete list of options see: +https://wiki.asterisk.org/wiki/display/AST/Application_AMD + + + +* Visibility: **public** +* This method is defined by [PAGI\Client\IClient](PAGI-Client-IClient.md) + + +#### Arguments +* $options **array<mixed,string>** + + + +### faxSend + + \PAGI\Client\Result\FaxResult PAGI\Client\IClient::faxSend(string $tiffFile) + +Sends a fax. + + + +* Visibility: **public** +* This method is defined by [PAGI\Client\IClient](PAGI-Client-IClient.md) + + +#### Arguments +* $tiffFile **string** - <p>Absolute path to a .tiff file.</p> + + + +### faxReceive + + \PAGI\Client\Result\FaxResult PAGI\Client\IClient::faxReceive(string $tiffFile) + +Receives a fax. + + + +* Visibility: **public** +* This method is defined by [PAGI\Client\IClient](PAGI-Client-IClient.md) + + +#### Arguments +* $tiffFile **string** - <p>Absolute path to a .tiff file.</p> + + + +### dial + + \PAGI\Client\Result\DialResult PAGI\Client\IClient::dial(string $channel, array $options) + +Tries to dial the given channel. + + + +* Visibility: **public** +* This method is defined by [PAGI\Client\IClient](PAGI-Client-IClient.md) + + +#### Arguments +* $channel **string** - <p>What to dial.</p> +* $options **array<mixed,string>** - <p>Dial app options</p> + + + +### exec + + \PAGI\Client\Result\ExecResult PAGI\Client\IClient::exec(string $application, array $options) + +Executes an application. Uses agi command "EXEC". + + + +* Visibility: **public** +* This method is defined by [PAGI\Client\IClient](PAGI-Client-IClient.md) + + +#### Arguments +* $application **string** - <p>Application name.</p> +* $options **array<mixed,string>** - <p>Application arguments.</p> + + + +### setAutoHangup + + void PAGI\Client\IClient::setAutoHangup(integer $time) + +Cause the channel to automatically hangup at