* In OpenSER mode cr is added after lf only if it is not already there.

There may be a bug in sems, because sometimes cr is in sdp body (like
  when calling out using di_dial) and sometimes not (like inviting a new
  member to conference).


git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@535 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Juha Heinanen 19 years ago
parent 476ff73f20
commit 1e49381d0e

@ -193,15 +193,10 @@ void AmSipDialog::updateStatus(const AmSipReply& reply)
if(!reply.route.empty())
setRoute(reply.route);
if (!reply.next_hop.empty())
next_hop = reply.next_hop;
next_hop = reply.next_hop;
}
if (!reply.next_request_uri.empty()) {
DBG("updating remote Contact: %s -> %s\n",
remote_uri.c_str(), reply.next_request_uri.c_str());
remote_uri = reply.next_request_uri;
}
remote_uri = reply.next_request_uri;
switch(status){
case Disconnecting:
@ -298,15 +293,19 @@ string escape(string s)
return s;
}
/* Add CR before each LF */
/* Add CR before each LF if not already there */
string lf2crlf(string s)
{
string::size_type pos;
pos = 0;
while ((pos = s.find("\n", pos)) != string::npos) {
s.insert(pos, "\r");
pos = pos + 2;
if ((pos > 0) && (s[pos - 1] == 13)) {
pos = pos + 1;
} else {
s.insert(pos, "\r");
pos = pos + 2;
}
}
return s;
}

Loading…
Cancel
Save