Merge pull request #505 in FS/freeswitch from ~SAFAROV/freeswitch2:fix_udptl_SDP to master

* commit '62d4d47b1a09075acc19cd792a90468d50e6cb14':
  FS-8198: Fixed default CRLF sequence in t38 SDP
This commit is contained in:
Mike Jerris 2015-10-07 12:32:53 -05:00
commit b205355c24

View File

@ -8312,13 +8312,13 @@ SWITCH_DECLARE(void) switch_core_media_set_udptl_image_sdp(switch_core_session_t
uint32_t port; uint32_t port;
const char *family = "IP4"; const char *family = "IP4";
const char *username; const char *username;
const char *bit_removal_on = "a=T38FaxFillBitRemoval\n"; const char *bit_removal_on = "a=T38FaxFillBitRemoval\r\n";
const char *bit_removal_off = ""; const char *bit_removal_off = "";
const char *mmr_on = "a=T38FaxTranscodingMMR\n"; const char *mmr_on = "a=T38FaxTranscodingMMR\r\n";
const char *mmr_off = ""; const char *mmr_off = "";
const char *jbig_on = "a=T38FaxTranscodingJBIG\n"; const char *jbig_on = "a=T38FaxTranscodingJBIG\r\n";
const char *jbig_off = ""; const char *jbig_off = "";
const char *var; const char *var;
int broken_boolean; int broken_boolean;
@ -8381,46 +8381,46 @@ SWITCH_DECLARE(void) switch_core_media_set_udptl_image_sdp(switch_core_session_t
switch_snprintf(buf, sizeof(buf), switch_snprintf(buf, sizeof(buf),
"v=0\n" "v=0\r\n"
"o=%s %010u %010u IN %s %s\n" "o=%s %010u %010u IN %s %s\r\n"
"s=%s\n" "c=IN %s %s\n" "t=0 0\n", username, smh->owner_id, smh->session_id, family, ip, username, family, ip); "s=%s\r\n" "c=IN %s %s\r\n" "t=0 0\r\n", username, smh->owner_id, smh->session_id, family, ip, username, family, ip);
if (t38_options->T38FaxMaxBuffer) { if (t38_options->T38FaxMaxBuffer) {
switch_snprintf(max_buf, sizeof(max_buf), "a=T38FaxMaxBuffer:%d\n", t38_options->T38FaxMaxBuffer); switch_snprintf(max_buf, sizeof(max_buf), "a=T38FaxMaxBuffer:%d\r\n", t38_options->T38FaxMaxBuffer);
}; };
if (t38_options->T38FaxMaxDatagram) { if (t38_options->T38FaxMaxDatagram) {
switch_snprintf(max_data, sizeof(max_data), "a=T38FaxMaxDatagram:%d\n", t38_options->T38FaxMaxDatagram); switch_snprintf(max_data, sizeof(max_data), "a=T38FaxMaxDatagram:%d\r\n", t38_options->T38FaxMaxDatagram);
}; };
if (broken_boolean) { if (broken_boolean) {
bit_removal_on = "a=T38FaxFillBitRemoval:1\n"; bit_removal_on = "a=T38FaxFillBitRemoval:1\r\n";
bit_removal_off = "a=T38FaxFillBitRemoval:0\n"; bit_removal_off = "a=T38FaxFillBitRemoval:0\r\n";
mmr_on = "a=T38FaxTranscodingMMR:1\n"; mmr_on = "a=T38FaxTranscodingMMR:1\r\n";
mmr_off = "a=T38FaxTranscodingMMR:0\n"; mmr_off = "a=T38FaxTranscodingMMR:0\r\n";
jbig_on = "a=T38FaxTranscodingJBIG:1\n"; jbig_on = "a=T38FaxTranscodingJBIG:1\r\n";
jbig_off = "a=T38FaxTranscodingJBIG:0\n"; jbig_off = "a=T38FaxTranscodingJBIG:0\r\n";
} }
switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
"m=image %d udptl t38\n" "m=image %d udptl t38\r\n"
"a=T38FaxVersion:%d\n" "a=T38FaxVersion:%d\r\n"
"a=T38MaxBitRate:%d\n" "a=T38MaxBitRate:%d\r\n"
"%s" "%s"
"%s" "%s"
"%s" "%s"
"a=T38FaxRateManagement:%s\n" "a=T38FaxRateManagement:%s\r\n"
"%s" "%s"
"%s" "%s"
"a=T38FaxUdpEC:%s\n", "a=T38FaxUdpEC:%s\r\n",
//"a=T38VendorInfo:%s\n", //"a=T38VendorInfo:%s\r\n",
port, port,
t38_options->T38FaxVersion, t38_options->T38FaxVersion,
t38_options->T38MaxBitRate, t38_options->T38MaxBitRate,
@ -8437,7 +8437,7 @@ SWITCH_DECLARE(void) switch_core_media_set_udptl_image_sdp(switch_core_session_t
if (insist) { if (insist) {
switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "m=audio 0 RTP/AVP 19\n"); switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "m=audio 0 RTP/AVP 19\r\n");
} }
switch_core_media_set_local_sdp(session, buf, SWITCH_TRUE); switch_core_media_set_local_sdp(session, buf, SWITCH_TRUE);