diff --git a/core/AmSession.cpp b/core/AmSession.cpp index 5987770e..d6b7b672 100644 --- a/core/AmSession.cpp +++ b/core/AmSession.cpp @@ -823,6 +823,8 @@ void AmSession::sendReinvite(bool updateSDP, const string& headers) int AmSession::sendInvite(const string& headers) { + onOutgoingInvite(headers); + // Set local IP first, so that IP is set when // getLocalPort/setLocalPort may bind. rtp_str.setLocalIP(AmConfig::LocalIP); diff --git a/core/AmSession.h b/core/AmSession.h index f0351d48..295e6589 100644 --- a/core/AmSession.h +++ b/core/AmSession.h @@ -328,10 +328,10 @@ public: */ static string getNewId(); - /** - * Gets the number of running sessions - */ - static unsigned int getSessionNum(); + /** + * Gets the number of running sessions + */ + static unsigned int getSessionNum(); /** * Entry point for DTMF events @@ -358,6 +358,12 @@ public: */ virtual void onInvite(const AmSipRequest& req); + /** + * onOutgoingInvite will be called if an INVITE + * is sent in the session. + */ + virtual void onOutgoingInvite(const string& headers) { } + /** * onCancel will be called if a CANCEL for a running * dialog has been received. At this point, the CANCEL