Use SIP connect string as Mumble comment text

This commit is contained in:
Scott Hardin 2017-05-27 18:19:37 +02:00
parent 9988d9f13c
commit 18cd3cde13
5 changed files with 18 additions and 1 deletions

View File

@ -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);
}

View File

@ -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;

View File

@ -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()");

View File

@ -76,6 +76,7 @@ namespace sip {
std::function<void(int16_t *, int)> onIncomingPcmSamples;
std::function<void(int)> onMuteDeafChange;
std::function<void(mumlib::UserState field, bool val)> sendUserState;
std::function<void(mumlib::UserState field, std::string val)> sendUserStateStr;
std::function<void()> onConnect;
std::function<void()> onDisconnect;
std::function<void()> onCallerAuth;

View File

@ -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<void(mumble::MumbleCommunicator::*)(mumlib::UserState, bool)>
(&mumble::MumbleCommunicator::sendUserState),
mumcom,
_1, _2);
// Send UserState to Mumble
pjsuaCommunicator.calls[i].sendUserStateStr = std::bind(
static_cast<void(mumble::MumbleCommunicator::*)(mumlib::UserState, std::string)>
(&mumble::MumbleCommunicator::sendUserState),
mumcom,
_1, _2);