correct version of proposed patch

This commit is contained in:
Anthony Minessale
2015-09-23 11:58:57 -05:00
parent 819a2c13a9
commit 43ef01fbbe
4 changed files with 46 additions and 24 deletions
+8 -16
View File
@@ -1541,7 +1541,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
break;
case SWITCH_MESSAGE_INDICATE_MESSAGE:
{
char *ct = "text/plain";
char ct[256] = "text/plain";
int ok = 0;
if (!zstr(msg->string_array_arg[3]) && !strcmp(msg->string_array_arg[3], tech_pvt->caller_profile->uuid)) {
@@ -1550,7 +1550,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
}
if (!zstr(msg->string_array_arg[0]) && !zstr(msg->string_array_arg[1])) {
ct = switch_core_session_sprintf(session, "%s/%s", msg->string_array_arg[0], msg->string_array_arg[1]);
switch_snprintf(ct, sizeof(ct), "%s/%s", msg->string_array_arg[0], msg->string_array_arg[1]);
ok = 1;
}
@@ -1582,26 +1582,14 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
break;
case SWITCH_MESSAGE_INDICATE_INFO:
{
char *ct = "freeswitch/data";
char ct[256] = "freeswitch/data";
int ok = 0;
if (!zstr(msg->string_array_arg[0]) && !zstr(msg->string_array_arg[1])) {
ct = switch_core_session_sprintf(session, "%s/%s", msg->string_array_arg[0], msg->string_array_arg[1]);
ok = 1;
}
if (switch_stristr("send_info", tech_pvt->x_freeswitch_support_remote)) {
ok = 1;
}
/* TODO: 1.4 remove this stanza */
if (switch_true(switch_channel_get_variable(channel, "fs_send_unspported_info"))) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING,
"fs_send_unspported_info is deprecated in favor of correctly spelled fs_send_unsupported_info\n");
ok = 1;
}
if (switch_true(switch_channel_get_variable(channel, "fs_send_unsupported_info"))) {
if (switch_true(switch_channel_get_variable_dup(channel, "fs_send_unsupported_info", SWITCH_FALSE, -1))) {
ok = 1;
}
@@ -1609,6 +1597,10 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
char *headers = sofia_glue_get_extra_headers(channel, SOFIA_SIP_INFO_HEADER_PREFIX);
const char *pl = NULL;
if (!zstr(msg->string_array_arg[0]) && !zstr(msg->string_array_arg[1])) {
switch_snprintf(ct, sizeof(ct), "%s/%s", msg->string_array_arg[0], msg->string_array_arg[1]);
}
if (!zstr(msg->string_array_arg[2])) {
pl = msg->string_array_arg[2];
}