diff --git a/MumbleCommunicator.cpp b/MumbleCommunicator.cpp index ab115d2..8e4d980 100644 --- a/MumbleCommunicator.cpp +++ b/MumbleCommunicator.cpp @@ -168,3 +168,7 @@ void mumble::MumbleCommunicator::sendUserState(mumlib::UserState field, bool val mum->sendUserState(field, val); } +void mumble::MumbleCommunicator::sendUserState(mumlib::UserState field, std::string val) { + mum->sendUserState(field, val); +} + diff --git a/MumbleCommunicator.hpp b/MumbleCommunicator.hpp index 2ea5828..6d59936 100644 --- a/MumbleCommunicator.hpp +++ b/MumbleCommunicator.hpp @@ -82,6 +82,8 @@ namespace mumble { void sendUserState(mumlib::UserState field, bool val); + void sendUserState(mumlib::UserState field, std::string val); + MumbleUserState userState; int callId; diff --git a/PjsuaCommunicator.cpp b/PjsuaCommunicator.cpp index abb02c5..7c2fe97 100644 --- a/PjsuaCommunicator.cpp +++ b/PjsuaCommunicator.cpp @@ -154,6 +154,7 @@ namespace sip { pj_thread_sleep(500); // sleep a moment to allow connection to stabilize communicator.logger.notice(msgText); + communicator.calls[ci.id].sendUserStateStr(mumlib::UserState::COMMENT, msgText); communicator.calls[ci.id].onStateChange(msgText); pj_thread_sleep(500); // sleep a moment to allow connection to stabilize @@ -193,6 +194,7 @@ namespace sip { communicator.calls[ci.id].mixer->clear(); communicator.logger.notice(msgText); + communicator.calls[ci.id].sendUserStateStr(mumlib::UserState::COMMENT, msgText); communicator.calls[ci.id].onStateChange(msgText); communicator.calls[ci.id].sendUserState(mumlib::UserState::SELF_DEAF, true); communicator.logger.notice("MYDEBUG: call joinDefaultChannel()"); diff --git a/PjsuaCommunicator.hpp b/PjsuaCommunicator.hpp index 3ee0113..c42c1dc 100644 --- a/PjsuaCommunicator.hpp +++ b/PjsuaCommunicator.hpp @@ -76,6 +76,7 @@ namespace sip { std::function onIncomingPcmSamples; std::function onMuteDeafChange; std::function sendUserState; + std::function sendUserStateStr; std::function onConnect; std::function onDisconnect; std::function onCallerAuth; diff --git a/main.cpp b/main.cpp index f4b96f9..41a83c9 100644 --- a/main.cpp +++ b/main.cpp @@ -183,7 +183,15 @@ int main(int argc, char *argv[]) { // Send UserState to Mumble pjsuaCommunicator.calls[i].sendUserState = std::bind( - &mumble::MumbleCommunicator::sendUserState, + static_cast + (&mumble::MumbleCommunicator::sendUserState), + mumcom, + _1, _2); + + // Send UserState to Mumble + pjsuaCommunicator.calls[i].sendUserStateStr = std::bind( + static_cast + (&mumble::MumbleCommunicator::sendUserState), mumcom, _1, _2);