< Previous by Date | Date Index | Next by Date > |
< Previous in Thread | Thread Index | Next in Thread > |
I found that resiprocate already provides some methods to post commands to the dum thread. But there is no endCommand that takes an user reason as argument so I created a patch for this. It was done using 1.9.10 but it
is small so you can apply manually if you think it is worth. And this solved my problem.
Thanks again , regards. --- a/resiprocate-1.9.10/resip/dum/InviteSession.cxx +++ b/resiprocate-1.9.10/resip/dum/InviteSession.cxx @@ -736,9 +736,10 @@ InviteSession::end(EndReason reason) class InviteSessionEndCommand : public DumCommandAdapter { public: - InviteSessionEndCommand(const InviteSessionHandle& inviteSessionHandle, InviteSession::EndReason reason) + InviteSessionEndCommand(const InviteSessionHandle& inviteSessionHandle, InviteSession::EndReason reason, const Data& userReason = "") : mInviteSessionHandle(inviteSessionHandle), - mReason(reason) + mReason(reason), + mUserEndReason(userReason) { } @@ -746,7 +747,14 @@ public: { if(mInviteSessionHandle.isValid()) { - mInviteSessionHandle->end(mReason); + if (mReason == InviteSession::UserSpecified) + { + mInviteSessionHandle->end(mUserEndReason); + } + else + { + mInviteSessionHandle->end(mReason); + } } } @@ -757,6 +765,7 @@ public: private: InviteSessionHandle mInviteSessionHandle; InviteSession::EndReason mReason; + Data mUserEndReason; }; void @@ -766,6 +775,12 @@ InviteSession::endCommand(EndReason reason) } void +InviteSession::endCommand(const Data& userReason) +{ + mDum.post(new InviteSessionEndCommand(getSessionHandle(), UserSpecified, userReason)); +} + +void InviteSession::reject(int statusCode, WarningCategory *warning) { switch (mState) --- a/resiprocate-1.9.10/resip/dum/InviteSession.hxx +++ b/resiprocate-1.9.10/resip/dum/InviteSession.hxx @@ -122,6 +122,7 @@ class InviteSession : public DialogUsage virtual void provideAnswerCommand(const Contents& answer); /** Asynchronously makes the specific dialog end. Will send a BYE (not a CANCEL) */ virtual void endCommand(EndReason reason = NotSpecified); + virtual void endCommand(const Data& userReason); /** Asynchronously rejects an offer at the SIP level. Can also be used to
send a 488 to a reINVITE or UPDATE */ virtual void rejectCommand(int statusCode, WarningCategory *warning = 0); From: slgodin@xxxxxxxxx [mailto:slgodin@xxxxxxxxx]
On Behalf Of Scott Godin The dum/test/basicClient sample app is a good sample for getting started. resip/recon is a more comprehensive example. Scott On Thu, Feb 25, 2016 at 4:02 PM, Diego Carvalho Domingos <ddomingos@xxxxxxxxxxxxxxx> wrote:
|