moved error reply string to #define

sayer/1.4-spce2.6
Stefan Sayer 16 years ago
parent 4df4eb0e20
commit e9eae2154e

@ -292,7 +292,7 @@ void AmSessionContainer::startSessionUAS(AmSipRequest& req)
if (!addSession(req.callid,req.from_tag,local_tag,session)) {
ERROR("adding session to session container\n");
delete session;
throw string("internal server error");
throw string(SIP_REPLY_SERVER_INTERNAL_ERROR);
}
MONITORING_LOG5(local_tag.c_str(),
@ -380,7 +380,7 @@ AmSession* AmSessionContainer::createSession(AmSipRequest& req,
if(!session_factory) {
ERROR("No session factory for application\n");
AmSipDialog::reply_error(req,500,"Server Internal Error");
AmSipDialog::reply_error(req,500,SIP_REPLY_SERVER_INTERNAL_ERROR);
return NULL;
}

@ -90,12 +90,12 @@ void AmSipDialog::updateStatus(const AmSipRequest& req)
if (r_cseq_i && req.cseq <= r_cseq){
INFO("remote cseq lower than previous ones - refusing request\n");
// see 12.2.2
reply_error(req, 500, "Server Internal Error");
reply_error(req, 500, SIP_REPLY_SERVER_INTERNAL_ERROR);
return;
}
if ((req.method == "INVITE") && pending_invites) {
reply_error(req,500,"Server Internal Error",
reply_error(req,500, SIP_REPLY_SERVER_INTERNAL_ERROR,
"Retry-After: " + int2str(get_random() % 10) + CRLF);
return;
}

@ -46,4 +46,6 @@
#define SIP_IS_200_CLASS(code) ((code >= 200) && (code < 300))
#define SIP_APPLICATION_SDP "application/sdp"
#define SIP_REPLY_SERVER_INTERNAL_ERROR "Server Internal Error"
#endif /* __AMSIPHEADERS_H__ */

Loading…
Cancel
Save