Commit a7761e14 authored by Julien Bonjean's avatar Julien Bonjean

[#1671] Fixed bugs introduced by \n stripping & cleaning

parent d3f04432
......@@ -61,6 +61,5 @@ AM_CPPFLAGS = \
-DCODECS_DIR=\""$(sflcodecdir)"\" \
-DPLUGINS_DIR=\""$(sflplugindir)"\" \
-DENABLE_TRACE \
-DSFLDEBUG \
$(SPEEXCODEC) \
$(GSMCODEC)
......@@ -60,7 +60,6 @@ void ConfigTree::addDefaultValue (const std::pair<std::string, std::string>& tok
std::string ConfigTree::getDefaultValue (const std::string& key)
{
_debug ("Getting default value for %s", key.c_str());
std::map<std::string, std::string>::iterator it;
it = _defaultValueMap.find (key);
......@@ -148,8 +147,6 @@ ConfigTree::getConfigTreeItemValue (const std::string& section, const std::strin
return item->getValue();
}
_debug ("Option doesn't exist: [%s] %s", section.c_str(), itemName.c_str());
return getDefaultValue (itemName);
}
......
......@@ -35,42 +35,40 @@ IAXCall::setFormat (int format)
{
_format = format;
_debug ("IAX set supported format: ");
_info ("IAX set supported format: ");
switch (format) {
case AST_FORMAT_ULAW:
printf ("PCMU");
_info("PCMU");
setAudioCodec (PAYLOAD_CODEC_ULAW);
break;
case AST_FORMAT_GSM:
printf ("GSM");
_info ("GSM");
setAudioCodec (PAYLOAD_CODEC_GSM);
break;
case AST_FORMAT_ALAW:
printf ("ALAW");
_info ("ALAW");
setAudioCodec (PAYLOAD_CODEC_ALAW);
break;
case AST_FORMAT_ILBC:
printf ("ILBC");
_info ("ILBC");
setAudioCodec (PAYLOAD_CODEC_ILBC_20);
break;
case AST_FORMAT_SPEEX:
printf ("SPEEX");
_info ("SPEEX");
setAudioCodec (PAYLOAD_CODEC_SPEEX_8000);
break;
default:
printf ("Error audio codec type %i not supported!", format);
_info ("Error audio codec type %i not supported!", format);
setAudioCodec ( (AudioCodecType) -1);
break;
}
printf ("");
}
......@@ -81,7 +79,7 @@ IAXCall::getSupportedFormat()
int format = 0;
unsigned int iter;
_debug ("IAX get supported format: ");
_info ("IAX get supported format: ");
map = getCodecMap().getActiveCodecs();
......@@ -89,27 +87,27 @@ IAXCall::getSupportedFormat()
switch (map[iter]) {
case PAYLOAD_CODEC_ULAW:
printf ("PCMU ");
_info ("PCMU ");
format |= AST_FORMAT_ULAW;
break;
case PAYLOAD_CODEC_GSM:
printf ("GSM ");
_info ("GSM ");
format |= AST_FORMAT_GSM;
break;
case PAYLOAD_CODEC_ALAW:
printf ("PCMA ");
_info ("PCMA ");
format |= AST_FORMAT_ALAW;
break;
case PAYLOAD_CODEC_ILBC_20:
printf ("ILBC ");
_info ("ILBC ");
format |= AST_FORMAT_ILBC;
break;
case PAYLOAD_CODEC_SPEEX_8000:
printf ("SPEEX ");
_info ("SPEEX ");
format |= AST_FORMAT_SPEEX;
break;
......@@ -118,8 +116,6 @@ IAXCall::getSupportedFormat()
}
}
printf ("");
return format;
}
......@@ -137,27 +133,27 @@ IAXCall::getFirstMatchingFormat (int needles)
switch (map[iter]) {
case PAYLOAD_CODEC_ULAW:
printf ("PCMU");
_debug ("PCMU");
format = AST_FORMAT_ULAW;
break;
case PAYLOAD_CODEC_GSM:
printf ("GSM");
_debug ("GSM");
format = AST_FORMAT_GSM;
break;
case PAYLOAD_CODEC_ALAW:
printf ("PCMA");
_debug ("PCMA");
format = AST_FORMAT_ALAW;
break;
case PAYLOAD_CODEC_ILBC_20:
printf ("ILBC");
_debug ("ILBC");
format = AST_FORMAT_ILBC;
break;
case PAYLOAD_CODEC_SPEEX_8000:
printf ("SPEEX");
_debug ("SPEEX");
format = AST_FORMAT_SPEEX;
break;
......@@ -171,8 +167,6 @@ IAXCall::getFirstMatchingFormat (int needles)
}
printf ("");
return 0;
}
......
......@@ -42,7 +42,7 @@ void log(const int level, const char* format, ...)
case LOG_DEBUG:
{
prefix = "<debug> ";
color_prefix = GREEN;
color_prefix = "";
break;
}
}
......
......@@ -518,8 +518,9 @@ void Sdp::toString (void)
sdp << _local_offer->media[0]->desc.fmt[i].ptr << " ";
}
_debug ("LOCAL SDP: \n%s", sdp.str().c_str());
sdp << "\n";
_debug ("LOCAL SDP: \n%s", sdp.str().c_str());
}
void Sdp::set_local_media_capabilities ()
......
......@@ -1170,7 +1170,7 @@ SIPVoIPLink::carryingDTMFdigits (const CallID& id, char code)
dtmf_body = new char[body_len];
snprintf (dtmf_body, body_len - 1, "Signal=%c\rDuration=%d\r", code, duration);
snprintf (dtmf_body, body_len - 1, "Signal=%c\r\nDuration=%d\r\n", code, duration);
pj_strdup2 (_pool, &methodName, "INFO");
pjsip_method_init_np (&method, &methodName);
......@@ -3733,7 +3733,7 @@ std::string fetch_header_value (pjsip_msg *msg, std::string field)
value = hdr->hvalue.ptr;
if ( (pos=value.find ("")) == std::string::npos) {
if ( (pos=value.find ("\n")) == std::string::npos) {
return "";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment