diff --git a/src/gui/guiframework.h b/src/gui/guiframework.h index 2912b6d17b709e11bcab4962d90f323898ea832b..6b46a9bc81fab975daae16c333ce35f55b3ca20d 100644 --- a/src/gui/guiframework.h +++ b/src/gui/guiframework.h @@ -38,6 +38,7 @@ public: virtual void peerAnsweredCall (CALLID id) = 0; virtual void peerRingingCall (CALLID id) = 0; virtual void peerHungupCall (CALLID id) = 0; + virtual void incomingMessage(const std::string& message) = 0; virtual void displayStatus (const std::string& status) = 0; virtual void displayConfigError (const std::string& error) = 0; virtual void displayTextMessage (CALLID id, const std::string& message) = 0; diff --git a/src/gui/server/guiserverimpl.cpp b/src/gui/server/guiserverimpl.cpp index fd9f22f2aebef7b563bb4af61c98a43b49138567..2a6625b6a4ec3b692fc4db47a5af060eb325aefc 100644 --- a/src/gui/server/guiserverimpl.cpp +++ b/src/gui/server/guiserverimpl.cpp @@ -323,6 +323,11 @@ GUIServerImpl::incomingCall (CALLID id, const std::string& accountId, const std: return 0; } +void +GUIServerImpl::incomingMessage(const std::string& message) { + _requestManager.sendResponse(ResponseMessage("030", _getEventsSequenceId, message)); +} + void GUIServerImpl::peerAnsweredCall (CALLID id) { diff --git a/src/gui/server/guiserverimpl.h b/src/gui/server/guiserverimpl.h index b5822bdfbd089417cf9e08887a670c99c97574a6..836dc286572ec77aba044f4237084984322ba812 100644 --- a/src/gui/server/guiserverimpl.h +++ b/src/gui/server/guiserverimpl.h @@ -38,10 +38,8 @@ public: // exec loop int exec(void); - // Reimplementation of virtual functions - // TODO: remove incomingCall with one parameter - int incomingCall (CALLID id); int incomingCall(CALLID id, const std::string& accountId, const std::string& from); + void incomingMessage(const std::string& message); void peerAnsweredCall (CALLID id); void peerRingingCall (CALLID id); diff --git a/src/managerimpl.cpp b/src/managerimpl.cpp index 4acb2c3791a87054d6d686e033fb478e3030a80a..63aca562cfab670216a3d33c544eff80b2cd5eb9 100644 --- a/src/managerimpl.cpp +++ b/src/managerimpl.cpp @@ -744,6 +744,17 @@ ManagerImpl::incomingCall (CALLID id, const std::string& name, const std::string return _gui->incomingCall(id, accountId, from); } +/** + * SipEvent Thread + * for outgoing message, send by SipEvent + */ +void +ManagerImpl::incomingMessage(const std::string& message) { + if (_gui) { + _gui->incomingMessage(message); + } +} + /** * SipEvent Thread * for outgoing call, send by SipEvent diff --git a/src/managerimpl.h b/src/managerimpl.h index d210d6eee4ec5047da575aa8fcc229141585fb74..5cb69410d18538dbe434c6681da2572420705828 100644 --- a/src/managerimpl.h +++ b/src/managerimpl.h @@ -150,6 +150,8 @@ public: void peerAnsweredCall (CALLID id); int peerRingingCall (CALLID id); int peerHungupCall (CALLID id); + void incomingMessage(const std::string& message); + void displayTextMessage (CALLID id, const std::string& message); void displayErrorText (CALLID id, const std::string& message); void displayError (const std::string& error); diff --git a/src/sipvoiplink.cpp b/src/sipvoiplink.cpp index 8b44fef49b75dfc46d6146b686450a7f5988de18..4f7cc7579bc06d0d548ab40354aa1eabbe641be5 100644 --- a/src/sipvoiplink.cpp +++ b/src/sipvoiplink.cpp @@ -972,6 +972,7 @@ SipVoIPLink::getEvent (void) strcmp(c_t->subtype,"plain") == 0 ) { _debug(" Text body: %s\n", body->body); + Manager::instance().incomingMessage(body->body); } } }