diff options
-rw-r--r-- | voice/voice.cpp | 19 | ||||
-rw-r--r-- | voice/voice.h | 4 |
2 files changed, 9 insertions, 14 deletions
diff --git a/voice/voice.cpp b/voice/voice.cpp index 2a83c94..f200b95 100644 --- a/voice/voice.cpp +++ b/voice/voice.cpp @@ -45,7 +45,7 @@ Voice::~Voice() void Voice::scan() { - VoiceMessage *vmsg = new VoiceMessage(); + VoiceMessage *vmsg = new VoiceMessage(); QJsonObject parameter; vmsg->createRequest("enumerateVoiceAgents", parameter); @@ -55,13 +55,13 @@ void Voice::scan() void Voice::getCBLpair(QString id) { - subscribeAgentToLoginEvents(id); + triggerCBLProcess(id); } void Voice::subscribeAgentToVshlEvents(QString id) { QJsonArray events = QJsonArray::fromStringList(vshl_events); - VoiceMessage *vmsg = new VoiceMessage(); + VoiceMessage *vmsg = new VoiceMessage(); QJsonObject parameter; parameter.insert("va_id", id); @@ -74,7 +74,7 @@ void Voice::subscribeAgentToVshlEvents(QString id) void Voice::unsubscribeAgentFromVshlEvents(QString id) { QJsonArray events = QJsonArray::fromStringList(vshl_events); - VoiceMessage *vmsg = new VoiceMessage(); + VoiceMessage *vmsg = new VoiceMessage(); QJsonObject parameter; parameter.insert("va_id", id); @@ -84,18 +84,15 @@ void Voice::unsubscribeAgentFromVshlEvents(QString id) delete vmsg; } -void Voice::subscribeAgentToLoginEvents(QString id) +void Voice::triggerCBLProcess(QString id) { - QJsonArray events = QJsonArray::fromStringList(login_events); - VoiceMessage *vmsg = new VoiceMessage(); + QJsonArray events; + VoiceMessage *vmsg = new VoiceMessage(); QJsonObject parameter; parameter.insert("va_id", id); parameter.insert("events", events); vmsg->createRequest("subscribeToLoginEvents", parameter); - m_loop->sendMessage(vmsg); - //subscribe to events from vshl: - vmsg->createRequest("subscribe", parameter); m_loop->sendMessage(vmsg); delete vmsg; } @@ -125,7 +122,7 @@ void Voice::processVshlEvent(VoiceMessage *vmsg) } if (vmsg->isAuthStateEvent()) { const QString authstate = obj.value("state").toString(); - if (!authstate.isEmpty()) + if (!authstate.isEmpty()) m_var->setAuthState( agentId, static_cast<VoiceAgentRegistry::ServiceAuthState>( diff --git a/voice/voice.h b/voice/voice.h index be3d15d..d4c288e 100644 --- a/voice/voice.h +++ b/voice/voice.h @@ -48,7 +48,7 @@ class Voice : public QObject void subscribeAgentToVshlEvents(QString id); void unsubscribeAgentFromVshlEvents(QString id); - void subscribeAgentToLoginEvents(QString id); + void triggerCBLProcess(QString id); void parseAgentsList(QJsonArray agents); void processVshlEvent(VoiceMessage *vmsg); void processLoginEvent(VoiceMessage *vmsg); @@ -65,8 +65,6 @@ class Voice : public QObject "voice_authstate_event", "voice_dialogstate_event", "voice_connectionstate_event", - }; - const QStringList login_events { "voice_cbl_codepair_received_event", "voice_cbl_codepair_expired_event", }; |