Module: sems Branch: master Commit: e9eae2154e0258be48e9fb40738042d2db3ca990 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=e9eae2154e0258be48e9fb40738042d2db3ca990
Author: Stefan Sayer <[email protected]> Committer: Stefan Sayer <[email protected]> Date: Fri Oct 29 01:05:25 2010 +0200 moved error reply string to #define --- core/AmSessionContainer.cpp | 4 ++-- core/AmSipDialog.cpp | 4 ++-- core/AmSipHeaders.h | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/core/AmSessionContainer.cpp b/core/AmSessionContainer.cpp index ded48a2..1dd9f06 100644 --- a/core/AmSessionContainer.cpp +++ b/core/AmSessionContainer.cpp @@ -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; } diff --git a/core/AmSipDialog.cpp b/core/AmSipDialog.cpp index 7984da6..44da382 100644 --- a/core/AmSipDialog.cpp +++ b/core/AmSipDialog.cpp @@ -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; } diff --git a/core/AmSipHeaders.h b/core/AmSipHeaders.h index dd240e7..c13020d 100644 --- a/core/AmSipHeaders.h +++ b/core/AmSipHeaders.h @@ -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__ */ _______________________________________________ Semsdev mailing list [email protected] http://lists.iptel.org/mailman/listinfo/semsdev
