[Opalvoip-svn] SF.net SVN: opalvoip:[34723] opal/branches/v3_16
Brought to you by:
csoutheren,
rjongbloed
From: <rjo...@us...> - 2016-03-28 14:36:46
|
Revision: 34723 http://sourceforge.net/p/opalvoip/code/34723 Author: rjongbloed Date: 2016-03-28 14:36:44 +0000 (Mon, 28 Mar 2016) Log Message: ----------- Added "Refer-To" data to OnTransfterNotify() call back, so application does not have to keep track of who the transfer is being made to. Modified Paths: -------------- opal/branches/v3_16/include/sip/sipcon.h opal/branches/v3_16/src/sip/sipcon.cxx Modified: opal/branches/v3_16/include/sip/sipcon.h =================================================================== --- opal/branches/v3_16/include/sip/sipcon.h 2016-03-24 17:47:03 UTC (rev 34722) +++ opal/branches/v3_16/include/sip/sipcon.h 2016-03-28 14:36:44 UTC (rev 34723) @@ -760,6 +760,7 @@ bool m_referOfRemoteInProgress; PoolTimer m_delayedReferTimer; SIPURL m_delayedReferTo; + SIPURL m_sentReferTo; PSafeList<SIPTransaction> m_forkedInvitations; // Not for re-INVITE PSafeList<SIPTransaction> m_pendingInvitations; // For re-INVITE Modified: opal/branches/v3_16/src/sip/sipcon.cxx =================================================================== --- opal/branches/v3_16/src/sip/sipcon.cxx 2016-03-24 17:47:03 UTC (rev 34722) +++ opal/branches/v3_16/src/sip/sipcon.cxx 2016-03-28 14:36:44 UTC (rev 34723) @@ -333,6 +333,7 @@ PStringToString info; info.SetAt("result", "blind"); info.SetAt("party", "B"); + info.SetAt("Refer-To", m_sentReferTo); OnTransferNotify(info, this); } @@ -496,10 +497,10 @@ // Check for valid RFC2396 scheme if (!PURL::ExtractScheme(remoteParty).IsEmpty()) { - SIPURL referTo(remoteParty); - referTo.Sanitise(SIPURL::RedirectURI); - PTRACE(3, "Blind transfer of " << *this << " to " << referTo << ", referSubMode=" << referSubMode); - SIPRefer * referTransaction = new SIPRefer(*this, referTo, m_dialog.GetLocalURI(), referSubMode); + m_sentReferTo = remoteParty; + m_sentReferTo.Sanitise(SIPURL::RedirectURI); + PTRACE(3, "Blind transfer of " << *this << " to " << m_sentReferTo << ", referSubMode=" << referSubMode); + SIPRefer * referTransaction = new SIPRefer(*this, m_sentReferTo, m_dialog.GetLocalURI(), referSubMode); m_referOfRemoteInProgress = referTransaction->Start(); return m_referOfRemoteInProgress; } @@ -530,18 +531,18 @@ what they told us to use. They can't do the REFER without a username part, but they never gave us a username to give them. Give me a break! */ - SIPURL referTo = sip->GetRemotePartyURL(); - referTo.Sanitise(SIPURL::RedirectURI); - if (remoteProductInfo.name == "Avaya" && referTo.GetUserName().IsEmpty()) - referTo.SetUserName("anonymous"); + m_sentReferTo = sip->GetRemotePartyURL(); + m_sentReferTo.Sanitise(SIPURL::RedirectURI); + if (remoteProductInfo.name == "Avaya" && m_sentReferTo.GetUserName().IsEmpty()) + m_sentReferTo.SetUserName("anonymous"); PStringStream id; id << sip->GetDialog().GetCallID() << ";to-tag=" << sip->GetDialog().GetRemoteTag() << ";from-tag=" << sip->GetDialog().GetLocalTag(); - referTo.SetQueryVar("Replaces", id); + m_sentReferTo.SetQueryVar("Replaces", id); - SIPRefer * referTransaction = new SIPRefer(*this, referTo, m_dialog.GetLocalURI(), referSubMode); + SIPRefer * referTransaction = new SIPRefer(*this, m_sentReferTo, m_dialog.GetLocalURI(), referSubMode); referTransaction->GetMIME().AddSupported("replaces"); m_referOfRemoteInProgress = referTransaction->Start(); return m_referOfRemoteInProgress; @@ -1882,6 +1883,7 @@ PStringToString info; info.SetAt("result", "error"); info.SetAt("party", "B"); + info.SetAt("Refer-To", m_sentReferTo); info.SetAt("code", psprintf("%u", response.GetStatusCode())); OnTransferNotify(info, this); } @@ -2384,14 +2386,14 @@ if (m_ciscoRemotePartyID == newRemotePartyID) { // We did a REFER but remote address did not change party-ID info.SetAt("result", "failed"); - info.SetAt("party", "B"); } else { // We did a REFER and remote address did change party-ID info.SetAt("result", "success"); - info.SetAt("party", "B"); info.SetAt("Remote-Party", newRemotePartyID.AsString()); } + info.SetAt("party", "B"); + info.SetAt("Refer-To", m_sentReferTo); OnTransferNotify(info, this); } else if (m_ciscoRemotePartyID == newRemotePartyID) @@ -2530,6 +2532,7 @@ PCaselessString state = mime.GetSubscriptionState(info); m_referOfRemoteInProgress = state != "terminated"; info.SetAt("party", "B"); // We are B party in consultation transfer + info.SetAt("Refer-To", m_sentReferTo); info.SetAt("state", state); info.SetAt("code", psprintf("%u", code)); info.SetAt("result", m_referOfRemoteInProgress ? "progress" : (code < 300 ? "success" : "failed")); @@ -2899,6 +2902,7 @@ PStringToString info; info.SetAt("result", "blind"); info.SetAt("party", "B"); + info.SetAt("Refer-To", m_sentReferTo); OnTransferNotify(info, this); Release(OpalConnection::EndedByCallForwarded); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |