PHP Class PAGI\CallSpool\CallFile

PHP Version 5
Author: Marcelo Gornstein ([email protected])
Mostrar archivo Open project: marcelog/pagi Class Usage Examples

Public Methods

Method Description
__construct ( DialDescriptor $dialDescriptor ) : void Constructor.
getAccount ( ) : string Returns account code to use for this call.
getAlwaysDelete ( ) : boolean If the file's modification time is in the future, the call file will not be deleted
getApplication ( ) : string Returns Asterisk Application to run (use instead of specifiying context, extension and priority)
getApplicationData ( ) : string Returns the options to be passed to application.
getArchive ( ) : boolean Sets if should move to subdir "outgoing_done" with "Status: value", where value can be Completed, Expired or Failed.
getCallerId ( ) : string Returns Caller ID, Please note: It may not work if you do not respect the format: CallerID: "Some Name" <1234>
getChannel ( ) : string Returns channel to use for the call.
getContext ( ) : string Returns context to use for this call when answered.
getExtension ( ) : string Returns extension to use for this call when answered.
getMaxRetries ( ) : integer 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.
getPriority ( ) : string Returns priority to use for this call when answered.
getRetryTime ( ) : integer Returns seconds between retries, Don't hammer an unavailable phone.
getVariable ( string $key ) : string Returns the value for the given variable.
getWaitTime ( ) : integer Returns seconds to wait for an answer. Default is 45.
serialize ( ) : string Returns the text describing this call file, ready to be spooled.
setAccount ( string $value ) : void Sets account code to use for this call.
setAlwaysDelete ( boolean $value ) : void If the file's modification time is in the future, the call file will not be deleted
setApplication ( string $value ) : void Sets Asterisk Application to run (use instead of specifiying context, extension and priority)
setApplicationData ( array $options = [] ) : void Sets the options to be passed to application.
setArchive ( boolean $value ) : void Sets if should move to subdir "outgoing_done" with "Status: value", where value can be Completed, Expired or Failed.
setCallerId ( string $value ) : void Sets the Caller ID, Please note: It may not work if you do not respect the format: CallerID: "Some Name" <1234>
setContext ( string $value ) : void Sets context to use for this call when answered.
setExtension ( string $value ) : void Sets extension to use for this call when answered.
setMaxRetries ( integer $value ) : void 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.
setPriority ( string $value ) : void Sets priority to use for this call when answered.
setRetryTime ( integer $value ) : void Sets seconds between retries, Don't hammer an unavailable phone.
setVariable ( string $key, string $value ) : void Sets a given variable with the given value.
setWaitTime ( integer $value ) : void Sets seconds to wait for an answer. Default is 45.
unserialize ( string $text ) : void Deconstructs a call file from the given text.

Protected Methods

Method Description
getParameter ( string $key ) : string Returns the value for the given parameter.
setParameter ( string $key, string $value ) : void Sets a given parameter with the given value.

Method Details

__construct() public method

Constructor.
public __construct ( DialDescriptor $dialDescriptor ) : void
$dialDescriptor PAGI\DialDescriptor\DialDescriptor
return void

getAccount() public method

Returns account code to use for this call.
public getAccount ( ) : string
return string

getAlwaysDelete() public method

If the file's modification time is in the future, the call file will not be deleted
public getAlwaysDelete ( ) : boolean
return boolean

getApplication() public method

Returns Asterisk Application to run (use instead of specifiying context, extension and priority)
public getApplication ( ) : string
return string

getApplicationData() public method

Returns the options to be passed to application.
public getApplicationData ( ) : string
return string

getArchive() public method

Sets if should move to subdir "outgoing_done" with "Status: value", where value can be Completed, Expired or Failed.
public getArchive ( ) : boolean
return boolean

getCallerId() public method

Returns Caller ID, Please note: It may not work if you do not respect the format: CallerID: "Some Name" <1234>
public getCallerId ( ) : string
return string

getChannel() public method

Returns channel to use for the call.
public getChannel ( ) : string
return string

getContext() public method

Returns context to use for this call when answered.
public getContext ( ) : string
return string

getExtension() public method

Returns extension to use for this call when answered.
public getExtension ( ) : string
return string

getMaxRetries() public method

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.
public getMaxRetries ( ) : integer
return integer

getParameter() protected method

Returns the value for the given parameter.
protected getParameter ( string $key ) : string
$key string Parameter name.
return string

getPriority() public method

Returns priority to use for this call when answered.
public getPriority ( ) : string
return string

getRetryTime() public method

Default is 300 (5 min).
public getRetryTime ( ) : integer
return integer

getVariable() public method

Returns the value for the given variable.
public getVariable ( string $key ) : string
$key string Variable name.
return string

getWaitTime() public method

Returns seconds to wait for an answer. Default is 45.
public getWaitTime ( ) : integer
return integer

serialize() public method

Returns the text describing this call file, ready to be spooled.
public serialize ( ) : string
return string

setAccount() public method

Sets account code to use for this call.
public setAccount ( string $value ) : void
$value string Value to set.
return void

setAlwaysDelete() public method

If the file's modification time is in the future, the call file will not be deleted
public setAlwaysDelete ( boolean $value ) : void
$value boolean Value to set.
return void

setApplication() public method

Sets Asterisk Application to run (use instead of specifiying context, extension and priority)
public setApplication ( string $value ) : void
$value string Value to set.
return void

setApplicationData() public method

Sets the options to be passed to application.
public setApplicationData ( array $options = [] ) : void
$options array
return void

setArchive() public method

Sets if should move to subdir "outgoing_done" with "Status: value", where value can be Completed, Expired or Failed.
public setArchive ( boolean $value ) : void
$value boolean Value to set.
return void

setCallerId() public method

Sets the Caller ID, Please note: It may not work if you do not respect the format: CallerID: "Some Name" <1234>
public setCallerId ( string $value ) : void
$value string Value to set.
return void

setContext() public method

Sets context to use for this call when answered.
public setContext ( string $value ) : void
$value string Value to set.
return void

setExtension() public method

Sets extension to use for this call when answered.
public setExtension ( string $value ) : void
$value string Value to set.
return void

setMaxRetries() public method

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.
public setMaxRetries ( integer $value ) : void
$value integer Value to set.
return void

setParameter() protected method

Sets a given parameter with the given value.
protected setParameter ( string $key, string $value ) : void
$key string Parameter name.
$value string Value.
return void

setPriority() public method

Sets priority to use for this call when answered.
public setPriority ( string $value ) : void
$value string Value to set.
return void

setRetryTime() public method

Default is 300 (5 min).
public setRetryTime ( integer $value ) : void
$value integer Value to set.
return void

setVariable() public method

Sets a given variable with the given value.
public setVariable ( string $key, string $value ) : void
$key string Variable name.
$value string Value.
return void

setWaitTime() public method

Sets seconds to wait for an answer. Default is 45.
public setWaitTime ( integer $value ) : void
$value integer Value to set.
return void

unserialize() public method

Deconstructs a call file from the given text.
public unserialize ( string $text ) : void
$text string A call file (intended to be pre-loaded, with file_get_contents() or similar).
return void