- added User-Agent and Server headers if signature is activated in the config.

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@736 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Raphael Coeffic 19 years ago
parent 0f5fafd160
commit ead79a971a

@ -198,6 +198,9 @@ int SipCtrlInterface::send(const AmSipRequest &req, string &serKey)
}
}
msg->hdrs.push_back(new sip_header(0,"User-Agent",
stl2cstr(AmConfig::Signature)));
if(!req.hdrs.empty()) {
char *c = (char*)req.hdrs.c_str();
@ -295,17 +298,36 @@ int SipCtrlInterface::send(const AmSipReply &rep)
hdrs_len += content_type_len(stl2cstr(rep.content_type));
}
if(!AmConfig::Signature.empty()) {
hdrs_len += 10 /* "Server: " + CRLF */
+ AmConfig::Signature.length();
}
char* hdrs_buf = NULL;
char* c = hdrs_buf;
if (hdrs_len) {
c = hdrs_buf = new char[hdrs_len];
copy_hdrs_wr(&c,msg.hdrs);
if(!rep.body.empty()) {
content_type_wr(&c,stl2cstr(rep.content_type));
}
c = hdrs_buf = new char[hdrs_len];
copy_hdrs_wr(&c,msg.hdrs);
if(!AmConfig::Signature.empty()) {
memcpy(c,"Server: ",8);
c += 8;
memcpy(c,AmConfig::Signature.c_str(),AmConfig::Signature.length());
c += AmConfig::Signature.length();
*(c++) = CR;
*(c++) = LF;
}
if(!rep.body.empty()) {
content_type_wr(&c,stl2cstr(rep.content_type));
}
}
int ret = tl->send_reply(get_trans_bucket(h),(sip_trans*)t,

Loading…
Cancel
Save