* Added OpenSER version of AmSipDialog::reply_error.

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@399 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Juha Heinanen 19 years ago
parent 788be1129f
commit b93bc9d3fd

@ -449,6 +449,50 @@ int AmSipDialog::reply(const AmSipRequest& req,
#endif
#ifdef OpenSER
/* static */
int AmSipDialog::reply_error(const AmSipRequest& req, unsigned int code,
const string& reason, const string& hdrs)
{
string reply_sock = "/tmp/" + AmSession::getNewId();
string code_str = int2str(code);
int headers;
string msg =
":t_reply:\n" +
code_str + "\n" +
reason + "\n" +
req.key + "\n" +
AmSession::getNewId() + "\n";
headers = 0;
if(!hdrs.empty()) {
msg += "\"" + lf2crlf(escape(hdrs));
headers = 1;
}
if (AmConfig::Signature.length()) {
if (headers == 1) {
msg += "Server: " + AmConfig::Signature + "\r\n";
} else {
msg += "\"Server: " + AmConfig::Signature + "\r\n";
headers = 1;
}
}
if (headers == 1) {
msg += "\"\n";
} else {
msg += ".\n";
}
return AmServer::send_msg(msg,reply_sock, 500);
}
#else /* Ser */
/* static */
int AmSipDialog::reply_error(const AmSipRequest& req, unsigned int code,
const string& reason, const string& hdrs)
@ -473,6 +517,8 @@ int AmSipDialog::reply_error(const AmSipRequest& req, unsigned int code,
return AmServer::send_msg(msg,reply_sock, 500);
}
#endif
int AmSipDialog::bye()
{
switch(status){

Loading…
Cancel
Save