QString AsteriskManager::actionQueueStatus(QString queue, QString member) { QVariantMap headers; insertNotEmpty(&headers, "Queue", queue); insertNotEmpty(&headers, "Member", member); return sendAction("QueueStatus", headers); }
QString AsteriskManager::actionPark(QString channel, QString channel2, uint timeout, QString parkinglot) { QVariantMap headers; headers["Channel"] = channel; headers["Channel2"] = channel2; insertNotEmpty(&headers, "Timeout", timeout); insertNotEmpty(&headers, "Parkinglot", parkinglot); return sendAction("Park", headers); }
QString AsteriskManager::actionQueuePause(QString interface, boolean paused, QString queue, QString reason) { QVariantMap headers; headers["Interface"] = interface; headers["Paused"] = paused; insertNotEmpty(&headers, "Queue", queue); insertNotEmpty(&headers, "Reason", reason); return sendAction("QueuePause", headers); }
QVariantHash Asterisk::redirect(QString channel, QString exten, QString context, uint priority, QString extraChannel, QString extraExten, QString extraContext, uint extraPriority) { QVariantHash headers; headers["Channel"] = channel; headers["Exten"] = exten; headers["Context"] = context; headers["Priority"] = priority; insertNotEmpty(&headers, "ExtraChannel", extraChannel); insertNotEmpty(&headers, "ExtraExten", extraExten); insertNotEmpty(&headers, "ExtraContext", extraContext); insertNotEmpty(&headers, "ExtraPriority", extraPriority); return sendPacket("Redirect", headers); }
QVariantHash Asterisk::originate(QString channel, QString exten, QString context, uint priority, QString application, QString data, uint timeout, QString callerId, QVariantHash variables, QString account, bool earlyMedia, bool async, QStringList codecs) { QVariantHash headers; headers["Channel"] = channel; headers["EarlyMedia"] = earlyMedia; headers["Async"] = async; insertNotEmpty(&headers, "Timeout", timeout); insertNotEmpty(&headers, "CallerID", callerId); insertNotEmpty(&headers, "Account", account); insertNotEmpty(&headers, "Codecs", codecs.join(",")); if (!exten.isEmpty() && !context.isEmpty() && priority > 0) { headers["Exten"] = exten; headers["Context"] = context; headers["Priority"] = priority; } if (!application.isEmpty()) { headers["Application"] = application; insertNotEmpty(&headers, "Data", data); } if (!variables.isEmpty()) { QHashIterator<QString, QVariant> variable(variables); while (variable.hasNext()) { variable.next(); headers.insertMulti("Variable", QString("%1=%2").arg(variable.key(), encodeValue(variable.value()))); } } return sendPacket("Originate", headers); }
QVariantHash Asterisk::hangup(QString channel, uint cause) { QVariantHash headers; headers["Channel"] = channel; insertNotEmpty(&headers, "Cause", cause); return sendPacket("Hangup", headers); }
QString AsteriskManager::actionQueueAdd(QString queue, QString interface, uint penalty, boolean paused, QString memberName, QString stateInterface) { QVariantMap headers; headers["Queue"] = queue; headers["Interface"] = interface; insertNotEmpty(&headers, "Penalty", penalty); insertNotEmpty(&headers, "Paused", paused); insertNotEmpty(&headers, "MemberName", memberName); insertNotEmpty(&headers, "StateInterface", stateInterface); return sendAction("QueueAdd", headers); }
QString AsteriskManager::actionLogin(QString username, QString secret) { QVariantMap headers; headers["Username"] = username; insertNotEmpty(&headers, "Secret", secret); return sendAction("Login", headers); }
QString AsteriskManager::actionHold(QString channel, boolean hold) { QVariantMap headers; headers["Channel"] = channel; insertNotEmpty(&headers, "Hold", hold); return sendAction("Hold", headers); }
QString AsteriskManager::actionHangup(QString channel, uint cause) { QVariantMap headers; headers["Channel"] = channel; insertNotEmpty(&headers, "Cause", cause); return sendAction("Hangup", headers); }
QString AsteriskManager::actionRedirect(QString channel, QString exten, QString context, uint priority, QString extraChannel, QString extraExten, QString extraContext, uint extraPriority) { QVariantMap headers; headers["Channel"] = channel; headers["Exten"] = exten; headers["Context"] = context; headers["Priority"] = priority; insertNotEmpty(&headers, "ExtraChannel", extraChannel); insertNotEmpty(&headers, "ExtraExten", extraExten); insertNotEmpty(&headers, "ExtraContext", extraContext); insertNotEmpty(&headers, "ExtraPriority", extraPriority); return sendAction("Redirect", headers); }
QString AsteriskManager::actionOriginate(QString channel, QString exten, QString context, uint priority, QString application, QString data, uint timeout, QString callerID, QVariantMap variables, QString account, boolean earlyMedia, boolean async, QStringList codecs) { QVariantMap headers; headers["Channel"] = channel; insertNotEmpty(&headers, "Exten", exten); insertNotEmpty(&headers, "Context", context); insertNotEmpty(&headers, "Priority", priority); insertNotEmpty(&headers, "Application", application); insertNotEmpty(&headers, "Data", data); insertNotEmpty(&headers, "Timeout", timeout); insertNotEmpty(&headers, "CallerID", callerID); insertNotEmpty(&headers, "Account", account); insertNotEmpty(&headers, "EarlyMedia", earlyMedia); insertNotEmpty(&headers, "Async", async); insertNotEmpty(&headers, "Codecs", codecs.join(",")); if (!variables.isEmpty()) { QMapIterator<QString, QVariant> variable(variables); while (variable.hasNext()) { variable.next(); headers.insertMulti("Variable", QString("%1=%2").arg(variable.key(), valueToString(variable.value()))); } } return sendAction("Originate", headers); }