Revision: 34726
http://sourceforge.net/p/opalvoip/code/34726
Author: rjongbloed
Date: 2016-03-28 15:45:49 +0000 (Mon, 28 Mar 2016)
Log Message:
-----------
Small change to assure SIP INVITE has registered username in Contact field in some pathological conditions.
Modified Paths:
--------------
opal/branches/v3_16/src/sip/sipep.cxx
Modified: opal/branches/v3_16/src/sip/sipep.cxx
===================================================================
--- opal/branches/v3_16/src/sip/sipep.cxx 2016-03-28 15:20:12 UTC (rev 34725)
+++ opal/branches/v3_16/src/sip/sipep.cxx 2016-03-28 15:45:49 UTC (rev 34726)
@@ -2184,6 +2184,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;
@@ -2224,25 +2244,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.
|