#include <astprovider.h>
Public Member Functions | |
~ASTProvider (void) | |
AC_RESULT | Connect (std::string sHost, int nPort, std::string user, std::string pwd, AUTH_TYPE eAuthType) |
connect to an asterisk box | |
bool | Disconnect () |
disconnects from asterisk box | |
AC_RESULT | Bridge (std::string channel1, std::string channel2, bool tone) |
bridge two active channels | |
AC_RESULT | Originate (std::string channel, std::string callerId, std::string callerIdName, std::string calledExtension, DWORD callid, std::string context, DWORD timeout, std::string variable, bool bLockReaderAfterResponse=false) |
originates a call | |
AC_RESULT | Hangup (std::string channel) |
hangup a given channel | |
AC_RESULT | QueueAdd (std::string queue, std::string channelInterface, int penalty, bool paused) |
adds an extension interface to a queue | |
AC_RESULT | QueueRemove (std::string queue, std::string channelInterface) |
removes an extension interface to a queue | |
AC_RESULT | QueuePause (std::string channelInterface, bool bPaused) |
pauses/upauses an already logged-in agent | |
AC_RESULT | OriginateApplication (std::string channel, std::string application, std::string data, std::string variable, DWORD timeout) |
executes an application via originate AMI | |
AC_RESULT | Redirect (std::string channel, std::string extraChannel, std::string extension, std::string context) |
Redirect (transfer) a call. | |
AC_RESULT | SetVar (std::string channel, std::string variable, std::string value) |
Set a global or local channel variable. | |
AC_RESULT | GetVar (std::string channel, std::string variable, std::string &value) |
Get a global or local channel variable. | |
AC_RESULT | Monitor (std::string channel, std::string file, std::string format, std::string mix) |
Monitor a call (Recording). | |
AC_RESULT | StopMonitor (std::string channel) |
StopMonitor a call (stop Recording). | |
AC_RESULT | PauseMonitor (std::string channel) |
PauseMonitor a call (pause Recording). | |
AC_RESULT | UnpauseMonitor (std::string channel) |
UnpauseMonitor a call (continue Recording after pause). | |
AC_RESULT | ChangeMonitor (std::string channel, std::string file) |
ChangeMonitor a call ( change filename of the Recording after start). | |
void | UnLockReader () |
UnLocks Reader Thread. | |
Static Public Member Functions | |
static ASTProvider * | Create (ASTListener *listener, ASTLogListener *logger) |
ASTProvider factory method. | |
Protected Member Functions | |
ASTProvider (void) |
ASTProvider::ASTProvider | ( | void | ) | [protected] |
Constructor
ASTProvider::~ASTProvider | ( | void | ) |
Destructor
AC_RESULT ASTProvider::Bridge | ( | std::string | channel1, | |
std::string | channel2, | |||
bool | tone | |||
) |
bridge two active channels
connects two active channels
channel1 | ||
channel2 | ||
tone |
AC_RESULT ASTProvider::ChangeMonitor | ( | std::string | channel, | |
std::string | file | |||
) |
ChangeMonitor a call ( change filename of the Recording after start).
ChangeMonitor given channel
channel | ||
file |
ACTION: ChangeMonitor Channel: SIP/x7062618529-643d File: channelsavefile
AC_RESULT ASTProvider::Connect | ( | std::string | sHost, | |
int | nPort, | |||
std::string | user, | |||
std::string | pwd, | |||
AUTH_TYPE | eAuthType | |||
) |
connect to an asterisk box
Connects to asterisk AMI port
sHost | ip host address of asterisk box | |
nPort | ip port asterisk manager api is listening to. | |
user | ie: admin | |
pwd | ie: amp111 authentification type 0-plaintext 1-md5 |
ASTProvider * ASTProvider::Create | ( | ASTListener * | listener, | |
ASTLogListener * | logger | |||
) | [static] |
ASTProvider factory method.
Factory method allows for initialization. Returns an initialized ASTProvider* instance or returns NULL in case of init failure.
listener | ||
logger |
bool ASTProvider::Disconnect | ( | ) |
disconnects from asterisk box
disconnects tcp/ip from asterisk ami port
AC_RESULT ASTProvider::GetVar | ( | std::string | channel, | |
std::string | variable, | |||
std::string & | value | |||
) |
Get a global or local channel variable.
Get a global or local channel variable.
channel | ||
variable | ||
&value |
ACTION: GetVar Channel: SIP/5060-44d225d0 Variable: extension
AC_RESULT ASTProvider::Hangup | ( | std::string | channel | ) |
hangup a given channel
Hangup call in given channel
channel |
ACTION: Hangup Channel: SIP/x7065558529-99a0
AC_RESULT ASTProvider::Monitor | ( | std::string | channel, | |
std::string | file, | |||
std::string | format, | |||
std::string | mix | |||
) |
Monitor a call (Recording).
Monitor given channel
channel | ||
file | ||
format | ||
mix |
ACTION: Monitor Channel: SIP/x7062618529-643d File: channelsavefile Format: gsm Mix: true
AC_RESULT ASTProvider::Originate | ( | std::string | channel, | |
std::string | callerId, | |||
std::string | callerIdName, | |||
std::string | calledExtension, | |||
DWORD | callid, | |||
std::string | context, | |||
DWORD | timeout, | |||
std::string | variable, | |||
bool | bLockReaderAfterResponse = false | |||
) |
originates a call
Originates a call via Asterisk API
channel | ||
callerId | ||
callerIdName | ||
calledExtension | ||
callid | Remarks: this version returns zero | |
context | used to originate call | |
timeout |
Action: Originate Channel: channel Exten: calledextension Priority: 1 Callerid: "callerIdName" <callerId> Context: context ActionID: 2 Async: 1
AC_RESULT ASTProvider::OriginateApplication | ( | std::string | channel, | |
std::string | application, | |||
std::string | data, | |||
std::string | variable, | |||
DWORD | timeout | |||
) |
executes an application via originate AMI
Originates an application via AMI originate
channel | ||
application | ||
data | ||
variable | ||
timeout | in ms |
Action: Originate Channel: channel Application: app-name Data: app-data Variable: variable_0 ActionID: 2 Async: 1
AC_RESULT ASTProvider::PauseMonitor | ( | std::string | channel | ) |
PauseMonitor a call (pause Recording).
PauseMonitor given channel
channel |
ACTION: PauseMonitor Channel: SIP/x7062618529-643d
AC_RESULT ASTProvider::QueueAdd | ( | std::string | queue, | |
std::string | channelInterface, | |||
int | penalty, | |||
bool | bPaused | |||
) |
adds an extension interface to a queue
Adds an extension interface to a queue
queue | ||
channelInterface | ||
penalty | ||
bPaused |
Action: QueueAdd Queue: 555 Interface: local/201 Penalty: 1 Paused: true
AC_RESULT ASTProvider::QueuePause | ( | std::string | channelInterface, | |
bool | bPaused | |||
) |
pauses/upauses an already logged-in agent
pauses/unpauses an extension logged into any queue
channelInterface | ||
bPaused | true/false |
Action: QueuePause Interface: local/2600 Paused: true
AC_RESULT ASTProvider::QueueRemove | ( | std::string | queue, | |
std::string | channelInterface | |||
) |
removes an extension interface to a queue
removes an extension interface to a queue
queue | ||
channelInterface |
Action: QueueRemove Queue: queue1 Interface: sip/2600
AC_RESULT ASTProvider::Redirect | ( | std::string | channel, | |
std::string | extraChannel, | |||
std::string | extension, | |||
std::string | context | |||
) |
AC_RESULT ASTProvider::SetVar | ( | std::string | channel, | |
std::string | variable, | |||
std::string | value | |||
) |
Set a global or local channel variable.
Set a global or local channel variable.
channel | ||
variable | ||
value |
Action: Setvar
Channel: Zap/1-1
Variable: AtestVariable
Value: This is now set
AC_RESULT ASTProvider::StopMonitor | ( | std::string | channel | ) |
StopMonitor a call (stop Recording).
StopMonitor given channel
channel |
ACTION: StopMonitor Channel: SIP/x7062618529-643d
AC_RESULT ASTProvider::UnpauseMonitor | ( | std::string | channel | ) |
UnpauseMonitor a call (continue Recording after pause).
UnpauseMonitor given channel
channel |
ACTION: PauseMonitor Channel: SIP/x7062618529-643d