- suppressed all hard-coded "P-Iptel-..." and replaced through PARAM_HDR and APPNAME_HDR.

- changed PARAM_HDR to "P-App-Param"
- changed APPNAME_HDR to "P-App-Name"


git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@272 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Raphael Coeffic 20 years ago
parent 13aadbfe7d
commit 4ddc7a6714

@ -115,7 +115,7 @@ void AnnounceTransferDialog::onSessionStart(const AmSipRequest& req)
callee_uri = getHeader(req.hdrs, "P-Refer-To");
if (callee_uri.length()) {
INFO("Use of P-Refer-To header is deprecated. "
"Use 'P-Iptel-Param: Refer-To=<uri>' instead.\n");
"Use '%s: Refer-To=<uri>' instead.\n",PARAM_HDR);
}
}
if (!callee_uri.length())

@ -496,13 +496,13 @@ void ConferenceDialog::onSipRequest(const AmSipRequest& req)
dlg.remote_tag = "";
// get route set and next hop
string iptel_app_param = getHeader(req.hdrs, "P-Iptel-Param");
string iptel_app_param = getHeader(req.hdrs, PARAM_HDR);
if (iptel_app_param.length()) {
dlg.setRoute(get_header_keyvalue(iptel_app_param,"Transfer-RR"));
dlg.next_hop = get_header_keyvalue(iptel_app_param,"Transfer-NH");
} else {
INFO("Use of P-Transfer-RR/P-Transfer-NH is deprecated. "
"Use 'P-Iptel-Param: Transfer-RR=<rr>;Transfer-NH=<nh>' instead.\n");
"Use '%s: Transfer-RR=<rr>;Transfer-NH=<nh>' instead.\n",PARAM_HDR);
dlg.setRoute(getHeader(req.hdrs,"P-Transfer-RR"));
dlg.next_hop = getHeader(req.hdrs,"P-Transfer-NH");

@ -163,7 +163,7 @@ void EarlyAnnounceDialog::process(AmEvent* event)
unsigned int code_i = 404;
string reason = "Not Found";
string iptel_app_param = getHeader(localreq.hdrs, "P-Iptel-Param");
string iptel_app_param = getHeader(localreq.hdrs, PARAM_HDR);
if (iptel_app_param.length()) {
string code = get_header_keyvalue(iptel_app_param,"Final-Reply-Code");
if (code.length() && str2i(code, code_i)) {
@ -179,8 +179,8 @@ void EarlyAnnounceDialog::process(AmEvent* event)
string h_reason = getHeader(localreq.hdrs,"P-Final-Reply-Reason");
if (h_reason.length()) {
INFO("Use of P-Final-Reply-Code/P-Final-Reply-Reason is deprecated. ");
INFO("Use 'P-Iptel-Param: Final-Reply-Code=<code>;"
"Final-Reply-Reason=<rs>' instead.\n");
INFO("Use '%s: Final-Reply-Code=<code>;"
"Final-Reply-Reason=<rs>' instead.\n",PARAM_HDR);
reason = h_reason;
}
}

@ -118,12 +118,12 @@ extern "C" {
return NULL;
string res;
string iptel_app_param = getHeader(headers, "P-Iptel-Param");
string iptel_app_param = getHeader(headers, PARAM_HDR);
if (iptel_app_param.length()) {
res = get_header_keyvalue(iptel_app_param,header_name);
} else {
INFO("Use of P-%s is deprecated. \n", header_name);
INFO("Use 'P-Iptel-Param: %s=<addr>' instead.\n", header_name);
INFO("Use '%s: %s=<addr>' instead.\n", PARAM_HDR, header_name);
res = getHeader(headers,string("P-") + header_name);
}

@ -11,7 +11,9 @@ TTS ?= y
#
# PYTHON_VERSION might also be 2.2 -- except for the use of GIL
# do a ls /usr/include/python2.3/Python.h to see if it's there
PY_VER = 2.3
PYTHON_VERSION ?= 2.4
PY_VER = $(PYTHON_VERSION)
PY_EXE = python$(PY_VER)
# adjust to point to python include path
# can also be /usr/include/python$(PY_VER)
# look for Python.h in the specified path

@ -147,7 +147,7 @@ AmSession* AnswerMachineFactory::onInvite(const AmSipRequest& req)
string language;
string email;
string iptel_app_param = getHeader(req.hdrs, "P-Iptel-Param");
string iptel_app_param = getHeader(req.hdrs, PARAM_HDR);
if (iptel_app_param.length()) {
language = get_header_keyvalue(iptel_app_param,"Language");
@ -158,8 +158,8 @@ AmSession* AnswerMachineFactory::onInvite(const AmSipRequest& req)
if (email.length()) {
INFO("Use of P-Email-Address/P-Language is deprecated. \n");
INFO("Use 'P-Iptel-Param: Email-Address=<addr>;"
"Language=<lang>' instead.\n");
INFO("Use '%s: Email-Address=<addr>;"
"Language=<lang>' instead.\n",PARAM_HDR);
}
}

@ -313,9 +313,9 @@ AmSession* AmSessionContainer::createSession(AmSipRequest& req)
}
else if(plugin_name == "sems"){
plugin_name = getHeader(req.hdrs,"P-Iptel-App");
plugin_name = getHeader(req.hdrs,APPNAME_HDR);
if(plugin_name.empty())
throw string("AmSessionContainer::createSession: missing 'P-Iptel-App' header.\n");
throw string("AmSessionContainer::createSession: missing '%s' header.\n",APPNAME_HDR);
}
AmSessionFactory* state_factory = AmPlugIn::instance()->getFactory4App(plugin_name);

@ -493,7 +493,7 @@ int AmSipDialog::transfer(const string& target)
}
if (!(next_hop.empty() && route.empty())) {
hdrs = "P-Iptel-Param: ";
hdrs = PARAM_HDR ": ";
if (!next_hop.empty())
hdrs+="Transfer-NH=\"" + next_hop +"\";";

@ -803,7 +803,7 @@ string get_header_keyvalue(const string& param_hdr, const string& name) {
/** get the value of key @param name from P-Iptel-Param header in hdrs */
string get_session_param(const string& hdrs, const string& name) {
string iptel_app_param = getHeader(hdrs, "P-Iptel-Param");
string iptel_app_param = getHeader(hdrs, PARAM_HDR);
if (!iptel_app_param.length()) {
// DBG("call parameters header P-Iptel-Param not found "
// "(need to configure ser's tw_append?).\n");

@ -37,6 +37,9 @@ using std::string;
#define FIFO_PERM S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH
#define PARAM_HDR "P-App-Param"
#define APPNAME_HDR "P-App-Name"
/** @file AmUtils.h */
/**

@ -52,13 +52,13 @@ there are quite a few possibilities to call a certain script:
no matter which URI has been dialed.
* based on the "P-Iptel-App" header:
* based on the "P-App-Name" header:
- in ser.cfg:
t_write_unix("/tmp/sems_sock","sems")
- the SIP message should contain following header:
P-Iptel-App: whatEverScriptYouWantToUse
P-App-Name: whatEverScriptYouWantToUse
- this form will start the application/script mentioned in the header value.

Loading…
Cancel
Save