getHeader:support content spanning multipe headers

Patch by Robert Szokovacs
sayer/1.4-spce2.6
Stefan Sayer 15 years ago
parent 24d93e326f
commit 77853863ab

@ -112,7 +112,7 @@ void AnnounceTransferDialog::onSessionStart(const AmSipRequest& req)
status = Announcing;
callee_uri = get_session_param(req.hdrs, "Refer-To");
if (!callee_uri.length()) {
callee_uri = getHeader(req.hdrs, "P-Refer-To");
callee_uri = getHeader(req.hdrs, "P-Refer-To", true);
if (callee_uri.length()) {
INFO("Use of P-Refer-To header is deprecated. "
"Use '%s: Refer-To=<uri>' instead.\n",PARAM_HDR);
@ -140,7 +140,7 @@ void AnnounceTransferDialog::onSipRequest(const AmSipRequest& req)
(req.method == "NOTIFY")) {
try {
if (strip_header_params(getHeader(req.hdrs,"Event", "o")) != "refer")
if (strip_header_params(getHeader(req.hdrs,"Event", "o", true)) != "refer")
throw AmSession::Exception(481, "Subscription does not exist");
if ((strip_header_params(req.content_type) != "message/sipfrag"))

@ -142,7 +142,7 @@ void AnnRecorderFactory::getAppParams(const AmSipRequest& req, map<string, strin
typ = DEFAULT_TYPE;
}
else {
string iptel_app_param = getHeader(req.hdrs, PARAM_HDR);
string iptel_app_param = getHeader(req.hdrs, PARAM_HDR, true);
if (!iptel_app_param.length()) {
throw AmSession::Exception(500, MOD_NAME ": parameters not found");

@ -113,7 +113,7 @@ void AuthB2BDialog::onInvite(const AmSipRequest& req)
setInOut(NULL,NULL);
if (AuthB2BFactory::user.empty()) {
string app_param = getHeader(req.hdrs, PARAM_HDR);
string app_param = getHeader(req.hdrs, PARAM_HDR, true);
if (!app_param.length()) {
AmSession::Exception(500, "auth_b2b: parameters not found");

@ -88,7 +88,7 @@ AmSession* CallTimerFactory::onInvite(const AmSipRequest& req)
throw AmSession::Exception(500,"could not get a user timer reference");
}
string app_param = getHeader(req.hdrs, PARAM_HDR);
string app_param = getHeader(req.hdrs, PARAM_HDR, true);
unsigned int call_time = CallTimerFactory::DefaultCallTimer;

@ -379,22 +379,22 @@ void ConferenceDialog::onSessionStart(const AmSipRequest& req)
int i, len;
string lonely_user_file;
string app_param_hdr = getHeader(req.hdrs, PARAM_HDR);
string app_param_hdr = getHeader(req.hdrs, PARAM_HDR, true);
if (app_param_hdr.length()) {
from_header = get_header_keyvalue(app_param_hdr, "Dialout-From");
extra_headers = get_header_keyvalue(app_param_hdr, "Dialout-Extra");
dialout_suffix = get_header_keyvalue(app_param_hdr, "Dialout-Suffix");
language = get_header_keyvalue(app_param_hdr, "Language");
} else {
from_header = getHeader(req.hdrs, "P-Dialout-From");
extra_headers = getHeader(req.hdrs, "P-Dialout-Extra");
dialout_suffix = getHeader(req.hdrs, "P-Dialout-Suffix");
from_header = getHeader(req.hdrs, "P-Dialout-From", true);
extra_headers = getHeader(req.hdrs, "P-Dialout-Extra", true);
dialout_suffix = getHeader(req.hdrs, "P-Dialout-Suffix", true);
if (from_header.length() || extra_headers.length()
|| dialout_suffix.length()) {
DBG("Warning: P-Dialout- style headers are deprecated."
" Please use P-App-Param header instead.\n");
}
language = getHeader(req.hdrs, "P-Language");
language = getHeader(req.hdrs, "P-Language", true);
if (language.length()) {
DBG("Warning: P-Language header is deprecated."
" Please use P-App-Param header instead.\n");
@ -837,14 +837,14 @@ void ConferenceDialog::onSipRequest(const AmSipRequest& req)
dlg.remote_tag = "";
// get route set and next hop
string iptel_app_param = getHeader(req.hdrs, PARAM_HDR);
string iptel_app_param = getHeader(req.hdrs, PARAM_HDR, true);
if (iptel_app_param.length()) {
dlg.route = get_header_keyvalue(iptel_app_param,"Transfer-RR");
} else {
INFO("Use of P-Transfer-RR/P-Transfer-NH is deprecated. "
"Use '%s: Transfer-RR=<rr>;Transfer-NH=<nh>' instead.\n",PARAM_HDR);
dlg.route = getHeader(req.hdrs,"P-Transfer-RR");
dlg.route = getHeader(req.hdrs,"P-Transfer-RR", true);
}
DBG("ConferenceDialog::onSipRequest: local_party = %s\n",dlg.local_party.c_str());

@ -457,7 +457,7 @@ void DSMFactory::addVariables(DSMCall* s, const string& prefix,
void DSMFactory::addParams(DSMCall* s, const string& hdrs) {
// TODO: use real parser with quoting and optimize
map<string, string> params;
vector<string> items = explode(getHeader(hdrs, PARAM_HDR), ";");
vector<string> items = explode(getHeader(hdrs, PARAM_HDR, true), ";");
for (vector<string>::iterator it=items.begin();
it != items.end(); it++) {
vector<string> kv = explode(*it, "=");
@ -510,7 +510,7 @@ void DSMFactory::runMonitorAppSelect(const AmSipRequest& req, string& start_diag
from_parser.uri = req.from_uri;
else {
size_t end;
string pai = getHeader(req.hdrs, SIP_HDR_P_ASSERTED_IDENTITY);
string pai = getHeader(req.hdrs, SIP_HDR_P_ASSERTED_IDENTITY, true);
if (!from_parser.parse_contact(pai, 0, end)) {
WARN("Failed to parse " SIP_HDR_P_ASSERTED_IDENTITY " '%s'\n",
pai.c_str());

@ -81,7 +81,7 @@ EXEC_ACTION_START(URIGetHeaderAction) {
string hname = resolveVars(par1, sess, sc_sess, event_params);
string dstname = resolveVars(par2, sess, sc_sess, event_params);
sc_sess->var[dstname] = getHeader(sc_sess->var["hdrs"], hname);
sc_sess->var[dstname] = getHeader(sc_sess->var["hdrs"], hname, true);
DBG("got header '%s' value '%s' as $%s\n",
hname.c_str(), sc_sess->var[dstname].c_str(), dstname.c_str());

@ -298,7 +298,7 @@ AmSession* EarlyAnnounceFactory::onInvite(const AmSipRequest& req)
#ifdef USE_MYSQL
string iptel_app_param = getHeader(req.hdrs, PARAM_HDR);
string iptel_app_param = getHeader(req.hdrs, PARAM_HDR, true);
string language = get_header_keyvalue(iptel_app_param,"Language");
string announce_file = "";
@ -385,11 +385,11 @@ void EarlyAnnounceDialog::process(AmEvent* event)
continue_b2b = true;
} else if (EarlyAnnounceFactory::ContinueB2B ==
EarlyAnnounceFactory::AppParam) {
string iptel_app_param = getHeader(invite_req.hdrs, PARAM_HDR);
string iptel_app_param = getHeader(invite_req.hdrs, PARAM_HDR, true);
if (iptel_app_param.length()) {
continue_b2b = get_header_keyvalue(iptel_app_param,"B2B")=="yes";
} else {
continue_b2b = getHeader(invite_req.hdrs,"P-B2B")=="yes";
continue_b2b = getHeader(invite_req.hdrs,"P-B2B", true)=="yes";
}
}
DBG("determined: continue_b2b = %s\n", continue_b2b?"true":"false");
@ -398,7 +398,7 @@ void EarlyAnnounceDialog::process(AmEvent* event)
unsigned int code_i = 404;
string reason = "Not Found";
string iptel_app_param = getHeader(invite_req.hdrs, PARAM_HDR);
string iptel_app_param = getHeader(invite_req.hdrs, PARAM_HDR, true);
if (iptel_app_param.length()) {
string code = get_header_keyvalue(iptel_app_param,"Final-Reply-Code");
if (code.length() && str2i(code, code_i)) {
@ -408,11 +408,11 @@ void EarlyAnnounceDialog::process(AmEvent* event)
if (!reason.length())
reason = "Not Found";
} else {
string code = getHeader(invite_req.hdrs,"P-Final-Reply-Code");
string code = getHeader(invite_req.hdrs,"P-Final-Reply-Code", true);
if (code.length() && str2i(code, code_i)) {
ERROR("while parsing P-Final-Reply-Code\n");
}
string h_reason = getHeader(invite_req.hdrs,"P-Final-Reply-Reason");
string h_reason = getHeader(invite_req.hdrs,"P-Final-Reply-Reason", true);
if (h_reason.length()) {
INFO("Use of P-Final-Reply-Code/P-Final-Reply-Reason is deprecated. ");
INFO("Use '%s: Final-Reply-Code=<code>;"

@ -78,7 +78,7 @@ AmSession* b2b_connectFactory::onInvite(const AmSipRequest& req)
// throw AmSession::Exception(500,"could not get a user timer reference");
// }
string app_param = getHeader(req.hdrs, PARAM_HDR);
string app_param = getHeader(req.hdrs, PARAM_HDR, true);
if (!app_param.length()) {
throw AmSession::Exception(500, "b2b_connect: parameters not found");
@ -108,7 +108,7 @@ void b2b_connectDialog::onInvite(const AmSipRequest& req)
return;
}
string app_param = getHeader(req.hdrs, PARAM_HDR);
string app_param = getHeader(req.hdrs, PARAM_HDR, true);
string remote_party, remote_uri;
if (!app_param.length()) {

@ -90,7 +90,7 @@ extern "C" {
if(!PyArg_ParseTuple(args,"ss",&headers,&header_name))
return NULL;
string res = getHeader(headers,header_name);
string res = getHeader(headers,header_name, true);
return PyString_FromString(res.c_str());
}
@ -115,14 +115,14 @@ extern "C" {
return NULL;
string res;
string iptel_app_param = getHeader(headers, PARAM_HDR);
string iptel_app_param = getHeader(headers, PARAM_HDR, true);
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 '%s: %s=<addr>' instead.\n", PARAM_HDR, header_name);
res = getHeader(headers,string("P-") + header_name);
res = getHeader(headers,string("P-") + header_name, true);
}

@ -128,7 +128,7 @@ extern "C" {
if(!PyArg_ParseTuple(args,"ss",&headers,&header_name))
return NULL;
string res = getHeader(headers,header_name);
string res = getHeader(headers,header_name, true);
return PyString_FromString(res.c_str());
}

@ -383,7 +383,7 @@ void SIPRegistration::onSipReply(const AmSipReply& reply, int old_dlg_status)
string contacts = reply.contact;
if (contacts.empty())
contacts = getHeader(reply.hdrs, "Contact", "m");
contacts = getHeader(reply.hdrs, "Contact", "m", true);
bool found = false;
if (!contacts.length()) {

@ -121,25 +121,25 @@ void SWPrepaidSIPDialog::onInvite(const AmSipRequest& req)
// this will prevent us from being added to media processor
setInOut(NULL,NULL);
m_uuid = getHeader(req.hdrs,"P-Caller-Uuid");
m_uuid = getHeader(req.hdrs,"P-Caller-Uuid", true);
if(!m_uuid.length()) {
ERROR("Application header P-Caller-Uuid not found\n");
throw AmSession::Exception(500, "could not get UUID parameter");
}
m_proxy = getHeader(req.hdrs,"P-Proxy");
m_proxy = getHeader(req.hdrs,"P-Proxy", true);
if(!m_proxy.length()) {
ERROR("Application header P-Proxy not found\n");
throw AmSession::Exception(500, "could not get PROXY parameter");
}
m_ruri = getHeader(req.hdrs,"P-R-Uri");
m_ruri = getHeader(req.hdrs,"P-R-Uri", true);
if(!m_ruri.length()) {
ERROR("Application header P-R-Uri not found\n");
throw AmSession::Exception(500, "could not get RURI parameter");
}
m_dest = getHeader(req.hdrs,"P-Acc-Dest");
m_dest = getHeader(req.hdrs,"P-Acc-Dest", true);
if(!m_dest.length()) {
ERROR("Application header P-Acc-Dest not found\n");

@ -312,7 +312,7 @@ AmSession* VoiceboxFactory::onInvite(const AmSipRequest& req)
domain = "default";
}
else {
string iptel_app_param = getHeader(req.hdrs, PARAM_HDR);
string iptel_app_param = getHeader(req.hdrs, PARAM_HDR, true);
if (!iptel_app_param.length()) {
throw AmSession::Exception(500, APP_NAME ": parameters not found");

@ -529,7 +529,7 @@ AmSession* AnswerMachineFactory::onInvite(const AmSipRequest& req)
}
else {
iptel_app_param = getHeader(req.hdrs, PARAM_HDR);
iptel_app_param = getHeader(req.hdrs, PARAM_HDR, true);
mode = get_header_keyvalue(iptel_app_param,"mod", "Mode");
if (!EmailAddress.length()) {

@ -851,7 +851,7 @@ AmSessionFactory* AmPlugIn::findSessionFactory(AmSipRequest& req)
req.cmd = req.user;
break;
case AmConfig::App_APPHDR:
req.cmd = getHeader(req.hdrs, APPNAME_HDR);
req.cmd = getHeader(req.hdrs, APPNAME_HDR, true);
break;
case AmConfig::App_RURIPARAM:
req.cmd = get_header_param(req.r_uri, "app");

@ -851,7 +851,7 @@ int AmSession::acceptAudio(const string& body,
try {
try {
// handle codec and send reply
string str_msg_flags = getHeader(hdrs,"P-MsgFlags");
string str_msg_flags = getHeader(hdrs,"P-MsgFlags", true);
unsigned int msg_flags = 0;
if(reverse_hex2int(str_msg_flags,msg_flags)){
ERROR("while parsing 'P-MsgFlags' header\n");

@ -4,34 +4,43 @@
#include "AmSipMsg.h"
string getHeader(const string& hdrs,const string& hdr_name)
string getHeader(const string& hdrs,const string& hdr_name, bool single)
{
size_t pos1;
size_t pos2;
size_t pos_s;
if (findHeader(hdrs,hdr_name, pos1, pos2, pos_s))
return hdrs.substr(pos1,pos2-pos1);
size_t skip = 0;
string ret = "";
while(findHeader(hdrs, hdr_name, skip, pos1, pos2, pos_s))
{
if(skip)
ret.append(", ");
else
return "";
if(single) return hdrs.substr(pos1,pos2-pos1);
ret.append(hdrs.substr(pos1,pos2-pos1));
skip = pos2+1;
}
return ret;
}
string getHeader(const string& hdrs,const string& hdr_name,
const string& compact_hdr_name)
const string& compact_hdr_name, bool single)
{
string res = getHeader(hdrs, hdr_name);
string res = getHeader(hdrs, hdr_name, single);
if (!res.length())
return getHeader(hdrs, compact_hdr_name);
return getHeader(hdrs, compact_hdr_name, single);
return res;
}
bool findHeader(const string& hdrs,const string& hdr_name,
bool findHeader(const string& hdrs,const string& hdr_name, const size_t skip,
size_t& pos1, size_t& pos2, size_t& hdr_start)
{
unsigned int p;
char* hdr = strdup(hdr_name.c_str());
const char* hdrs_c = hdrs.c_str();
if(skip >= hdrs.length()) return false;
const char* hdrs_c = hdrs.c_str() + skip;
char* hdr_c = hdr;
const char* hdrs_end = hdrs_c + hdrs.length();
const char* hdrs_end = hdrs.c_str() + hdrs.length();
const char* hdr_end = hdr_c + hdr_name.length();
while(hdr_c != hdr_end){
@ -101,19 +110,19 @@ bool findHeader(const string& hdrs,const string& hdr_name,
bool removeHeader(string& hdrs, const string& hdr_name) {
size_t pos1, pos2, hdr_start;
bool found = false;
if (findHeader(hdrs,hdr_name, pos1, pos2,
hdr_start)) {
while (findHeader(hdrs, hdr_name, 0, pos1, pos2, hdr_start)) {
while (pos2 < hdrs.length() &&
(hdrs[pos2]=='\r' || hdrs[pos2]=='\n'))
pos2++;
hdr_start -= hdr_name.length();
hdrs.erase(hdr_start, pos2 - hdr_start);
return true;
found = true;
}
return false;
return found;
}
/* Print Member */

@ -70,16 +70,16 @@ class AmSipRequest : public _AmSipMsgInDlg
string print();
};
string getHeader(const string& hdrs,const string& hdr_name);
string getHeader(const string& hdrs,const string& hdr_name, bool single = false);
string getHeader(const string& hdrs,const string& hdr_name,
const string& compact_hdr_name);
const string& compact_hdr_name, bool single = false);
/** find a header,
/** find a header, starting from char skip
if found, value is between pos1 and pos2
and hdr start is the start of the header
@return true if found */
bool findHeader(const string& hdrs,const string& hdr_name,
bool findHeader(const string& hdrs,const string& hdr_name, const size_t skip,
size_t& pos1, size_t& pos2,
size_t& hdr_start);

@ -788,6 +788,18 @@ string get_header_keyvalue(const string& param_hdr, const string& short_name, co
* while skipping escaped values
*/
string get_header_keyvalue(const string& param_hdr, const string& name) {
vector <string> parts = explode(param_hdr, ",");
vector<string>::iterator vit;
string part;
for ( vit=parts.begin() ; vit < parts.end(); vit++ )
{
part = get_header_keyvalue_single(*vit, name);
if(!part.empty()) break;
}
return part;
}
string get_header_keyvalue_single(const string& param_hdr, const string& name) {
// ugly, but we need escaping
#define ST_FINDKEY 0
#define ST_FK_ESC 1
@ -902,7 +914,7 @@ string get_header_keyvalue(const string& param_hdr, const string& name) {
/** get the value of key @param name from \ref PARAM_HDR header in hdrs */
string get_session_param(const string& hdrs, const string& name) {
string iptel_app_param = getHeader(hdrs, PARAM_HDR);
string iptel_app_param = getHeader(hdrs, PARAM_HDR, true);
if (!iptel_app_param.length()) {
// DBG("call parameters header PARAM_HDR not found "
// "(need to configure ser's tw_append?).\n");

@ -268,6 +268,9 @@ string get_header_param(const string& hdr_string, const string& param_name);
/** get the value of key @param name from the list param_hdr*/
string get_header_keyvalue(const string& param_hdr, const string& name);
/** get the value of key @param name from the list param_hdr, no comma separated values*/
string get_header_keyvalue_single(const string& param_hdr, const string& name);
/** get the value of key @param short_name or @param name or from the list param_hdr*/
string get_header_keyvalue(const string& param_hdr, const string& short_name, const string& name);

@ -1,333 +0,0 @@
/*
* Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
* Universitaet Berlin. See the accompanying file "COPYRIGHT" for
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
/* $Header: /cvsroot/sems/answer_machine/plug-in/gsm/gsm-1.0-pl10/src/toast_alaw.c.orig,v 1.1 2003/02/03 15:04:56 rco Exp $ */
#include "toast.h"
/* toast_alaw.c -- manipulate A-law encoded sound.
*/
extern FILE * in, * out;
#define A2S(x) (a2s[ (unsigned char )(x) ])
#define S2A(x) (s2a[ ((unsigned short)(x)) >> 4 ])
static unsigned short a2s[] = {
5120,60160, 320,65200,20480,44032, 1280,64192,
2560,62848, 64,65456,10240,54784, 640,64864,
7168,58112, 448,65072,28672,35840, 1792,63680,
3584,61824, 192,65328,14336,50688, 896,64608,
4096,61184, 256,65264,16384,48128, 1024,64448,
2048,63360, 0,65520, 8192,56832, 512,64992,
6144,59136, 384,65136,24576,39936, 1536,63936,
3072,62336, 128,65392,12288,52736, 768,64736,
5632,59648, 352,65168,22528,41984, 1408,64064,
2816,62592, 96,65424,11264,53760, 704,64800,
7680,57600, 480,65040,30720,33792, 1920,63552,
3840,61568, 224,65296,15360,49664, 960,64544,
4608,60672, 288,65232,18432,46080, 1152,64320,
2304,63104, 32,65488, 9216,55808, 576,64928,
6656,58624, 416,65104,26624,37888, 1664,63808,
3328,62080, 160,65360,13312,51712, 832,64672,
5376,59904, 336,65184,21504,43008, 1344,64128,
2688,62720, 80,65440,10752,54272, 672,64832,
7424,57856, 464,65056,29696,34816, 1856,63616,
3712,61696, 208,65312,14848,50176, 928,64576,
4352,60928, 272,65248,17408,47104, 1088,64384,
2176,63232, 16,65504, 8704,56320, 544,64960,
6400,58880, 400,65120,25600,38912, 1600,63872,
3200,62208, 144,65376,12800,52224, 800,64704,
5888,59392, 368,65152,23552,40960, 1472,64000,
2944,62464, 112,65408,11776,53248, 736,64768,
7936,57344, 496,65024,31744,32768, 1984,63488,
3968,61440, 240,65280,15872,49152, 992,64512,
4864,60416, 304,65216,19456,45056, 1216,64256,
2432,62976, 48,65472, 9728,55296, 608,64896,
6912,58368, 432,65088,27648,36864, 1728,63744,
3456,61952, 176,65344,13824,51200, 864,64640
};
static unsigned char s2a[] = {
170, 42,234,106,138, 10,202, 74,186, 58,250,122,154, 26,218, 90,
162, 34,226, 98,130, 2,194, 66,178, 50,242,114,146, 18,210, 82,
174, 46, 46,238,238,110,110,142,142, 14, 14,206,206, 78, 78,190,
190, 62, 62,254,254,126,126,158,158, 30, 30,222,222, 94, 94,166,
166, 38, 38, 38, 38,230,230,230,230,102,102,102,102,134,134,134,
134, 6, 6, 6, 6,198,198,198,198, 70, 70, 70, 70,182,182,182,
182, 54, 54, 54, 54,246,246,246,246,118,118,118,118,150,150,150,
150, 22, 22, 22, 22,214,214,214,214, 86, 86, 86, 86,168,168,168,
168, 40, 40, 40, 40, 40, 40, 40, 40,232,232,232,232,232,232,232,
232,104,104,104,104,104,104,104,104,136,136,136,136,136,136,136,
136, 8, 8, 8, 8, 8, 8, 8, 8,200,200,200,200,200,200,200,
200, 72, 72, 72, 72, 72, 72, 72, 72,184,184,184,184,184,184,184,
184, 56, 56, 56, 56, 56, 56, 56, 56,248,248,248,248,248,248,248,
248,120,120,120,120,120,120,120,120,152,152,152,152,152,152,152,
152, 24, 24, 24, 24, 24, 24, 24, 24,216,216,216,216,216,216,216,
216, 88, 88, 88, 88, 88, 88, 88, 88,160,160,160,160,160,160,160,
160, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
32,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,
224, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
96,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,
192, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
64,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,
176, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
48,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,
240,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,
112,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,
144, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
16,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,
208, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
80,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,
172, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44,236,236,236,236,236,236,236,236,236,236,236,236,236,236,236,
236,236,236,236,236,236,236,236,236,236,236,236,236,236,236,236,
236,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,108,
108,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,
140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,
140, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,204,
204, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
76,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,
188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,
188, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60,
60,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,
252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,
252,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,
124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,124,
124,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,
156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,
156, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
28,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,
220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,220,
220, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
92,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,
164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,
164, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
36,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,
228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,
228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,
228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,
228,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,
100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,
100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,
100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,
100,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,
132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,
132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,
132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,
132, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,
196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,
196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,
196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,
196, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
68,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,
180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,
180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,
180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,
180, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
52,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,
244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,
244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,
244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,
244,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,
116,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,
148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,
148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,
148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,
148, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,
212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,
212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,
212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,
212, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
84, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
85,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,
213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,
213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,
213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,
213, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
21,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,
149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,
149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,
149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,
149,117,117,117,117,117,117,117,117,117,117,117,117,117,117,117,
117,117,117,117,117,117,117,117,117,117,117,117,117,117,117,117,
117,117,117,117,117,117,117,117,117,117,117,117,117,117,117,117,
117,117,117,117,117,117,117,117,117,117,117,117,117,117,117,117,
117,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,
245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,
245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,
245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,245,
245, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53,
53,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,
181, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
69,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,
197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,
197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,
197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,197,
197, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,
133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,
133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,
133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,
133,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,
101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,
101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,
101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,
101,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
37,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,
165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,
165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,
165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,
165, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93,
93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93,
93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93,
93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93,
93,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,
221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,221,
221, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
29,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,
157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,
157,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,
125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,
125,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,
253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,
253, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
61,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,
189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,
189, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,
205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,
205, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
13,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,
141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,
141,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,
109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,109,
109,237,237,237,237,237,237,237,237,237,237,237,237,237,237,237,
237,237,237,237,237,237,237,237,237,237,237,237,237,237,237,237,
237, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
45,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,
173, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
81,209,209,209,209,209,209,209,209,209,209,209,209,209,209,209,
209, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,
145,113,113,113,113,113,113,113,113,113,113,113,113,113,113,113,
113,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,
241, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
49,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,
177, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
65,193,193,193,193,193,193,193,193,193,193,193,193,193,193,193,
193, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,
129, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
97,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,
225, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33,
33,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,
161, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
89,217,217,217,217,217,217,217,217, 25, 25, 25, 25, 25, 25, 25,
25,153,153,153,153,153,153,153,153,121,121,121,121,121,121,121,
121,249,249,249,249,249,249,249,249, 57, 57, 57, 57, 57, 57, 57,
57,185,185,185,185,185,185,185,185, 73, 73, 73, 73, 73, 73, 73,
73,201,201,201,201,201,201,201,201, 9, 9, 9, 9, 9, 9, 9,
9,137,137,137,137,137,137,137,137,105,105,105,105,105,105,105,
105,233,233,233,233,233,233,233,233, 41, 41, 41, 41, 41, 41, 41,
41,169,169,169,169,169,169,169,169, 87, 87, 87, 87, 87, 87, 87,
87,215,215,215,215, 23, 23, 23, 23,151,151,151,151,119,119,119,
119,247,247,247,247, 55, 55, 55, 55,183,183,183,183, 71, 71, 71,
71,199,199,199,199, 7, 7, 7, 7,135,135,135,135,103,103,103,
103,231,231,231,231, 39, 39, 39, 39,167,167,167,167, 95, 95, 95,
95,223,223, 31, 31,159,159,127,127,255,255, 63, 63,191,191, 79,
79,207,207, 15, 15,143,143,111,111,239,239, 47, 47,175,175, 83,
83,211, 19,147,115,243, 51,179, 67,195, 3,131, 99,227, 35,163,
91,219, 27,155,123,251, 59,187, 75,203, 11,139,107,235, 43,171
};
int alaw_input P1((buf), gsm_signal * buf)
{
int i, c;
for (i = 0; i < 160 && (c = fgetc(in)) != EOF; i++) buf[i] = A2S( c );
if (c == EOF && ferror(in)) return -1;
return i;
}
int alaw_output P1((buf), gsm_signal * buf)
{
int i;
for (i = 0; i < 160; i++, buf++)
if (fputc( S2A( *buf ), out) == EOF) return -1;
return 0;
}

@ -152,7 +152,7 @@ int SessionTimer::configure(AmConfigReader& conf)
*/
bool SessionTimerFactory::checkSessionExpires(const AmSipRequest& req)
{
string session_expires = getHeader(req.hdrs, "Session-Expires", "x");
string session_expires = getHeader(req.hdrs, "Session-Expires", "x", true);
if (session_expires.length()) {
unsigned int i_se;
@ -174,10 +174,10 @@ void SessionTimer::updateTimer(AmSession* s, const AmSipRequest& req) {
if((req.method == "INVITE")||(req.method == "UPDATE")){
remote_timer_aware =
key_in_list(getHeader(req.hdrs, SIP_HDR_SUPPORTED),"timer");
key_in_list(getHeader(req.hdrs, SIP_HDR_SUPPORTED),"timer", true);
// determine session interval
string sess_expires_hdr = getHeader(req.hdrs, "Session-Expires", "x");
string sess_expires_hdr = getHeader(req.hdrs, "Session-Expires", "x", true);
bool rem_has_sess_expires = false;
unsigned int rem_sess_expires=0;
@ -193,7 +193,7 @@ void SessionTimer::updateTimer(AmSession* s, const AmSipRequest& req) {
// get Min-SE
unsigned int i_minse = min_se;
string min_se_hdr = getHeader(req.hdrs, "Min-SE");
string min_se_hdr = getHeader(req.hdrs, "Min-SE", true);
if (!min_se_hdr.empty()) {
if (str2i(strip_header_params(min_se_hdr),
i_minse)) {
@ -251,9 +251,9 @@ void SessionTimer::updateTimer(AmSession* s, const AmSipReply& reply)
return;
// determine session interval
string sess_expires_hdr = getHeader(reply.hdrs, "Session-Expires");
string sess_expires_hdr = getHeader(reply.hdrs, "Session-Expires", true);
if (sess_expires_hdr.empty())
sess_expires_hdr = getHeader(reply.hdrs, "x"); // compact form
sess_expires_hdr = getHeader(reply.hdrs, "x", true); // compact form
session_refresher = refresh_local;
session_refresher_role = UAC;

@ -134,13 +134,14 @@ bool UACAuth::onSipReply(const AmSipReply& reply)
// credential->user.c_str(),
// credential->pwd.c_str());
if (((reply.code == 401) &&
getHeader(ri->second.hdrs, "Authorization").length()) ||
getHeader(ri->second.hdrs, "Authorization", true).length()) ||
((reply.code == 407) &&
getHeader(ri->second.hdrs, "Proxy-Authorization").length())) {
getHeader(ri->second.hdrs, "Proxy-Authorization", true).length())) {
DBG("Authorization failed!\n");
} else {
string auth_hdr = (reply.code==407) ? getHeader(reply.hdrs, "Proxy-Authenticate") :
getHeader(reply.hdrs, "WWW-Authenticate");
string auth_hdr = (reply.code==407) ?
getHeader(reply.hdrs, "Proxy-Authenticate", true) :
getHeader(reply.hdrs, "WWW-Authenticate", true);
string result;
string auth_uri;

@ -0,0 +1 @@
sems_tests

@ -18,7 +18,11 @@
#include "fct.h"
FCT_BGN() {
FCTMF_SUITE_CALL(test_headers);
init_logging();
log_stderr = true;
log_level = 3;
FCTMF_SUITE_CALL(test_headers);
} FCT_END();

@ -1,5 +1,7 @@
#include "fct.h"
#include "log.h"
#include "AmSipHeaders.h"
#include "AmSipMsg.h"
@ -9,7 +11,9 @@ FCTMF_SUITE_BGN(test_headers) {
fct_chk( getHeader("P-My-Test: myval" CRLF, "P-My-Test") == "myval");
} FCT_TEST_END();
FCT_TEST_BGN(getHeader_multi) {
fct_chk( getHeader("P-My-Test: myval" CRLF "P-My-Test: myval2" CRLF , "P-My-Test") == "myval");
fct_chk( getHeader("P-My-Test: myval" CRLF "P-My-Test: myval2" CRLF , "P-My-Test", true) == "myval" );
fct_chk( getHeader("P-My-Test: myval" CRLF "P-My-Test: myval2" CRLF , "P-My-Test", false) == "myval, myval2" );
fct_chk( getHeader("P-My-Test: myval" CRLF "P-My-Otherheader: myval2" CRLF "P-My-Test: myval2" CRLF , "P-My-Test", false) == "myval, myval2" );
} FCT_TEST_END();
} FCTMF_SUITE_END();

Loading…
Cancel
Save