From: Damien S. <dsa...@us...> - 2005-04-28 07:59:47
|
Update of /cvsroot/openh323/opal/src/sip In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15169/src/sip Modified Files: sipcon.cxx sipep.cxx sippdu.cxx Log Message: Applied patch from Ted Szoczei to fix problem when answering to PDUs containing multiple Via fields in the message header. Thanks! Index: sipep.cxx =================================================================== RCS file: /cvsroot/openh323/opal/src/sip/sipep.cxx,v retrieving revision 2.44 retrieving revision 2.45 diff -C2 -d -r2.44 -r2.45 *** sipep.cxx 26 Apr 2005 19:50:15 -0000 2.44 --- sipep.cxx 28 Apr 2005 07:59:37 -0000 2.45 *************** *** 25,28 **** --- 25,32 ---- * * $Log$ + * Revision 2.45 2005/04/28 07:59:37 dsandras + * Applied patch from Ted Szoczei to fix problem when answering to PDUs containing + * multiple Via fields in the message header. Thanks! + * * Revision 2.44 2005/04/26 19:50:15 dsandras * Fixed remoteAddress and user parameters in MWIReceived. *************** *** 422,427 **** // Calculate default return address if (pdu->GetMethod() != SIP_PDU::NumMethods) { ! PString via = pdu->GetMIME().GetVia(); ! transport.SetRemoteAddress(via.Mid(via.FindLast(' '))); } } --- 426,436 ---- // Calculate default return address if (pdu->GetMethod() != SIP_PDU::NumMethods) { ! if (pdu->GetMethod() != SIP_PDU::NumMethods) { ! PStringList viaList = pdu->GetMIME().GetViaList(); ! PString via = viaList[0]; ! OpalTransportAddress viaAddress(via.Mid(via.FindLast(' ') + 1), GetDefaultSignalPort(), "udp$"); ! transport.SetRemoteAddress(viaAddress); ! PTRACE(4, "SIP\tTranport remote address change from Via: " << &transport << "=" << transport); ! } } } Index: sippdu.cxx =================================================================== RCS file: /cvsroot/openh323/opal/src/sip/sippdu.cxx,v retrieving revision 2.49 retrieving revision 2.50 diff -C2 -d -r2.49 -r2.50 *** sippdu.cxx 15 Apr 2005 14:01:39 -0000 2.49 --- sippdu.cxx 28 Apr 2005 07:59:37 -0000 2.50 *************** *** 25,28 **** --- 25,32 ---- * * $Log$ + * Revision 2.50 2005/04/28 07:59:37 dsandras + * Applied patch from Ted Szoczei to fix problem when answering to PDUs containing + * multiple Via fields in the message header. Thanks! + * * Revision 2.49 2005/04/15 14:01:39 dsandras * Added User Agent string in REGISTER and SUBSCRIBE PDUs. *************** *** 583,586 **** --- 587,616 ---- + PStringList SIPMIMEInfo::GetViaList() const + { + PStringList viaList; + PString s = GetVia(); + if (s.FindOneOf("\r\n") != P_MAX_INDEX) + viaList = s.Lines(); + else + viaList.AppendString(s); + + return viaList; + } + + + void SIPMIMEInfo::SetViaList(const PStringList & v) + { + PString fieldValue; + if (v.GetSize() > 0) + { + fieldValue = v[0]; + for (PINDEX i = 1; i < v.GetSize(); i++) + fieldValue += '\n' + v[i]; + } + SetAt(compactForm ? "v" : "Via", fieldValue); + } + + PString SIPMIMEInfo::GetReferTo() const { Index: sipcon.cxx =================================================================== RCS file: /cvsroot/openh323/opal/src/sip/sipcon.cxx,v retrieving revision 2.58 retrieving revision 2.59 diff -C2 -d -r2.58 -r2.59 *** sipcon.cxx 18 Apr 2005 17:07:17 -0000 2.58 --- sipcon.cxx 28 Apr 2005 07:59:37 -0000 2.59 *************** *** 25,28 **** --- 25,32 ---- * * $Log$ + * Revision 2.59 2005/04/28 07:59:37 dsandras + * Applied patch from Ted Szoczei to fix problem when answering to PDUs containing + * multiple Via fields in the message header. Thanks! + * * Revision 2.58 2005/04/18 17:07:17 dsandras * Fixed cut and paste error in last commit thanks to Ted Szoczei. *************** *** 1053,1058 **** if (contact.IsEmpty()) { targetAddress = mime.GetFrom(); ! PString via = mime.GetVia(); ! transport->SetRemoteAddress(via.Mid(via.FindLast(' '))); } else { --- 1057,1065 ---- if (contact.IsEmpty()) { targetAddress = mime.GetFrom(); ! PStringList viaList = request.GetMIME().GetViaList(); ! PString via = viaList[0]; ! OpalTransportAddress viaAddress(via.Mid(via.FindLast(' ') + 1), endpoint.GetDefaultSignalPort(), "udp$"); ! transport->SetRemoteAddress(viaAddress); ! PTRACE(4, "SIP\tOnReceivedINVITE Changed remote address of transport " << *transport); } else { |