[Opalvoip-svn] SF.net SVN: opalvoip:[34729] opal/trunk
Brought to you by:
csoutheren,
rjongbloed
From: <rjo...@us...> - 2016-03-28 16:48:23
|
Revision: 34729 http://sourceforge.net/p/opalvoip/code/34729 Author: rjongbloed Date: 2016-03-28 16:48:20 +0000 (Mon, 28 Mar 2016) Log Message: ----------- Merged revision(s) 34701-34728 from opal/branches/v3_16: --------------------- r34726 Small change to assure SIP INVITE has registered username in Contact field in some pathological conditions. --------------------- r34725 Tried to make sure RRFC 2833 codec (aka "telephone-event") uses payload type 101. Extra debugging added to figure out why it is not doing so, if attempted fix does not work. --------------------- r34724 Plugged race condition where after receiving a BYE and sending 200, we try and send another BYE. THis is mostly cosmetic, and it should be noted this behaviour can still happen, as there is an "over the wire" race condition which the protocol is designed to deal with. --------------------- r34723 Added "Refer-To" data to OnTransfterNotify() call back, so application does not have to keep track of who the transfer is being made to. Revision Links: -------------- http://sourceforge.net/p/opalvoip/code/34726 http://sourceforge.net/p/opalvoip/code/34725 http://sourceforge.net/p/opalvoip/code/34724 http://sourceforge.net/p/opalvoip/code/34723 Modified Paths: -------------- opal/trunk/include/sip/sipcon.h opal/trunk/src/codec/opalpluginmgr.cxx opal/trunk/src/opal/mediafmt.cxx opal/trunk/src/sip/sipcon.cxx opal/trunk/src/sip/sipep.cxx Property Changed: ---------------- opal/trunk/ Index: opal/trunk =================================================================== --- opal/trunk 2016-03-28 16:46:34 UTC (rev 34728) +++ opal/trunk 2016-03-28 16:48:20 UTC (rev 34729) Property changes on: opal/trunk ___________________________________________________________________ Modified: svn:mergeinfo ## -10,7 +10,7 ## /opal/branches/v3_10:25182-29485,30896,32927-32928,32933 /opal/branches/v3_12:28489-31709 /opal/branches/v3_14:31505-33613 -/opal/branches/v3_16:34090-34700 +/opal/branches/v3_16:34090-34728 /opal/branches/v3_2:21143,21220,21227,21253,21455 /opal/branches/v3_4:21060,21062,21088,21092,21111,21113,21115,21119,21143,21148,21151-21152,21155,21158,21184,21188,21253,21265-21266,21283-21284,21298,21300,21303,21307,21309,21311,21327,21331,21333,21359,21367,21369,21488,21556,21564-21565,21568,21570,21620,21625,21631,21748,21751,21756,21759,21761,21767,21770,22246,23044,23140,23143,23286 /opal/branches/v3_6:22169,22178,22184,22186,22197,22204,22216,22251,22253,22255,22258,22260,22291,22296,22300,22306,22308,22313,22319,22336,22353,22358,22436,22447,22449,22497,22511,22517,22519-22521,22527,22536,22538,22589,22596,22599,22617,22620,22622,22630,22640,22655,22675,22682,22726-22728,22730,22733,22738,22745-22746,22800,22820-22821,22842,22844-22845,22851,22853,22889,22896,22902,22904,22906,22918,22924,22928,22946,22965,22967,22976,22978,22980,22982,22994,23028,23123,23125-23126,23128,23157,23165,23173,23175,23183,23294,23341,23465,23467,23474,23521,23829,24346,24809 \ No newline at end of property Modified: opal/trunk/include/sip/sipcon.h =================================================================== --- opal/trunk/include/sip/sipcon.h 2016-03-28 16:46:34 UTC (rev 34728) +++ opal/trunk/include/sip/sipcon.h 2016-03-28 16:48:20 UTC (rev 34729) @@ -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/trunk/src/codec/opalpluginmgr.cxx =================================================================== --- opal/trunk/src/codec/opalpluginmgr.cxx 2016-03-28 16:46:34 UTC (rev 34728) +++ opal/trunk/src/codec/opalpluginmgr.cxx 2016-03-28 16:48:20 UTC (rev 34729) @@ -1743,6 +1743,9 @@ GetOpalYUV420P(); #endif + // Make sure "telephone-event" payload type allocated + GetOpalRFC2833(); + for (unsigned i = 0; i < count; i++,codecDefn++) { #if PTRACING OpalPluginControl setLogFn(codecDefn, PLUGINCODEC_CONTROL_SET_LOG_FUNCTION); Modified: opal/trunk/src/opal/mediafmt.cxx =================================================================== --- opal/trunk/src/opal/mediafmt.cxx 2016-03-28 16:46:34 UTC (rev 34728) +++ opal/trunk/src/opal/mediafmt.cxx 2016-03-28 16:48:20 UTC (rev 34729) @@ -1313,10 +1313,14 @@ // If we had a conflict we change the older one, as it is assumed that the // application really wanted that value and internal OPAL ones can move - if (conflictingFormat != NULL) + if (conflictingFormat == NULL) + rtpPayloadType = (RTP_DataFrame::PayloadTypes)nextUnused; + else { + PTRACE(3, "Conflicting payload type: " + << *conflictingFormat << " moved to " << nextUnused + << " as " << fullName << " requires " << rtpPayloadType); conflictingFormat->SetPayloadType((RTP_DataFrame::PayloadTypes)nextUnused); - else - rtpPayloadType = (RTP_DataFrame::PayloadTypes)nextUnused; + } } Modified: opal/trunk/src/sip/sipcon.cxx =================================================================== --- opal/trunk/src/sip/sipcon.cxx 2016-03-28 16:46:34 UTC (rev 34728) +++ opal/trunk/src/sip/sipcon.cxx 2016-03-28 16:48:20 UTC (rev 34729) @@ -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")); @@ -2671,12 +2674,13 @@ SIPTransaction * response = new SIPResponse(GetEndPoint(), request, SIP_PDU::Successful_OK); response->Send(); + + releaseMethod = ReleaseWithNothing; if (IsReleased()) { PTRACE(2, "Already released " << *this); return; } - releaseMethod = ReleaseWithNothing; m_dialog.Update(request); UpdateRemoteAddresses(); @@ -2899,6 +2903,7 @@ PStringToString info; info.SetAt("result", "blind"); info.SetAt("party", "B"); + info.SetAt("Refer-To", m_sentReferTo); OnTransferNotify(info, this); Release(OpalConnection::EndedByCallForwarded); Modified: opal/trunk/src/sip/sipep.cxx =================================================================== --- opal/trunk/src/sip/sipep.cxx 2016-03-28 16:46:34 UTC (rev 34728) +++ opal/trunk/src/sip/sipep.cxx 2016-03-28 16:48:20 UTC (rev 34729) @@ -2208,6 +2208,26 @@ PTRACE(4, "No registrar for aor sip:" << user << '@' << domain); } + if (isMethod && registrar != NULL) { + if (!mime.Has("Route")) { + if (!pdu.SetRoute(registrar->GetServiceRoute())) + pdu.SetRoute(registrar->GetProxy()); + } + + // For many servers the From address must be address-of-record, but don't touch if dialog already done + if (connection == NULL || !connection->GetDialog().IsEstablished()) { + PStringToString fieldParams = from.GetFieldParameters(); + from = registrar->GetAddressOfRecord(); + from.GetFieldParameters() = fieldParams; + if (connection != NULL) + from.SetDisplayName(connection->GetDisplayName()); + from.Sanitise(SIPURL::FromURI); + mime.SetFrom(from); + PTRACE(4, "Adjusted 'From' to " << from << " from registered user."); + user = from.GetUserName(); + } + } + if (!mime.Has("Contact") && pdu.GetStatusCode() != SIP_PDU::Information_Trying) { OpalTransportAddress remoteAddress = pdu.GetURI().GetTransportAddress(); SIPURL contact; @@ -2248,25 +2268,6 @@ contact.Sanitise(SIPURL::ContactURI); mime.SetContact(contact.AsQuotedString()); } - - if (isMethod && registrar != NULL) { - if (!mime.Has("Route")) { - if (!pdu.SetRoute(registrar->GetServiceRoute())) - pdu.SetRoute(registrar->GetProxy()); - } - - // For many servers the From address must be address-of-record, but don't touch if dialog already done - if (connection == NULL || !connection->GetDialog().IsEstablished()) { - PStringToString fieldParams = from.GetFieldParameters(); - from = registrar->GetAddressOfRecord(); - from.GetFieldParameters() = fieldParams; - if (connection != NULL) - from.SetDisplayName(connection->GetDisplayName()); - from.Sanitise(SIPURL::FromURI); - mime.SetFrom(from); - PTRACE(4, "Adjusted 'From' to " << from << " from registered user."); - } - } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |