mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-06-02 19:40:08 +00:00
Merge branch 'master' into v1.4
This commit is contained in:
commit
d18c45a5fd
@ -175,15 +175,6 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (switch_core_file_open(&fh_output, output, channels, rate, out_flags, NULL) != SWITCH_STATUS_SUCCESS) {
|
|
||||||
fprintf(stderr, "Couldn't open %s\n", output);
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (switch_test_flag(&fh_input, SWITCH_FILE_NATIVE)) {
|
|
||||||
in_asis = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (out_asis) {
|
if (out_asis) {
|
||||||
if (switch_core_codec_init_with_bitrate(&codec, format, fmtp, rate, ptime, channels, bitrate, SWITCH_CODEC_FLAG_ENCODE, NULL, pool) != SWITCH_STATUS_SUCCESS) {
|
if (switch_core_codec_init_with_bitrate(&codec, format, fmtp, rate, ptime, channels, bitrate, SWITCH_CODEC_FLAG_ENCODE, NULL, pool) != SWITCH_STATUS_SUCCESS) {
|
||||||
fprintf(stderr, "Couldn't initialize codec for %s@%dh@%di\n", format, rate, ptime);
|
fprintf(stderr, "Couldn't initialize codec for %s@%dh@%di\n", format, rate, ptime);
|
||||||
@ -206,6 +197,20 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (switch_core_file_open(&fh_output, output, channels, codec.implementation->actual_samples_per_second, out_flags, NULL) != SWITCH_STATUS_SUCCESS) {
|
||||||
|
fprintf(stderr, "Couldn't open %s\n", output);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (switch_test_flag(&fh_input, SWITCH_FILE_NATIVE)) {
|
||||||
|
in_asis = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (in_asis) {
|
if (in_asis) {
|
||||||
blocksize = len = codec.implementation->encoded_bytes_per_packet;
|
blocksize = len = codec.implementation->encoded_bytes_per_packet;
|
||||||
} else {
|
} else {
|
||||||
|
@ -2667,7 +2667,8 @@ switch_status_t sofia_glue_send_notify(sofia_profile_t *profile, const char *use
|
|||||||
contact_str = profile->tcp_public_contact;
|
contact_str = profile->tcp_public_contact;
|
||||||
break;
|
break;
|
||||||
case SOFIA_TRANSPORT_TCP_TLS:
|
case SOFIA_TRANSPORT_TCP_TLS:
|
||||||
contact_str = profile->tls_public_contact;
|
contact_str = sofia_test_pflag(profile, PFLAG_TLS) ?
|
||||||
|
profile->tls_public_contact : profile->tcp_public_contact;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
contact_str = profile->public_url;
|
contact_str = profile->public_url;
|
||||||
@ -2690,7 +2691,8 @@ switch_status_t sofia_glue_send_notify(sofia_profile_t *profile, const char *use
|
|||||||
contact_str = profile->tcp_contact;
|
contact_str = profile->tcp_contact;
|
||||||
break;
|
break;
|
||||||
case SOFIA_TRANSPORT_TCP_TLS:
|
case SOFIA_TRANSPORT_TCP_TLS:
|
||||||
contact_str = profile->tls_contact;
|
contact_str = sofia_test_pflag(profile, PFLAG_TLS) ?
|
||||||
|
profile->tls_contact : profile->tcp_contact;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
contact_str = profile->url;
|
contact_str = profile->url;
|
||||||
|
@ -2227,7 +2227,8 @@ static void _send_presence_notify(sofia_profile_t *profile,
|
|||||||
contact_str = profile->tcp_public_contact;
|
contact_str = profile->tcp_public_contact;
|
||||||
break;
|
break;
|
||||||
case SOFIA_TRANSPORT_TCP_TLS:
|
case SOFIA_TRANSPORT_TCP_TLS:
|
||||||
contact_str = profile->tls_public_contact;
|
contact_str = sofia_test_pflag(profile, PFLAG_TLS) ?
|
||||||
|
profile->tls_public_contact : profile->tcp_public_contact;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
contact_str = profile->public_url;
|
contact_str = profile->public_url;
|
||||||
@ -2241,7 +2242,8 @@ static void _send_presence_notify(sofia_profile_t *profile,
|
|||||||
contact_str = profile->tcp_contact;
|
contact_str = profile->tcp_contact;
|
||||||
break;
|
break;
|
||||||
case SOFIA_TRANSPORT_TCP_TLS:
|
case SOFIA_TRANSPORT_TCP_TLS:
|
||||||
contact_str = profile->tls_contact;
|
contact_str = sofia_test_pflag(profile, PFLAG_TLS) ?
|
||||||
|
profile->tls_contact : profile->tcp_contact;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
contact_str = profile->url;
|
contact_str = profile->url;
|
||||||
@ -2687,7 +2689,8 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char *
|
|||||||
contact_str = profile->tcp_public_contact;
|
contact_str = profile->tcp_public_contact;
|
||||||
break;
|
break;
|
||||||
case SOFIA_TRANSPORT_TCP_TLS:
|
case SOFIA_TRANSPORT_TCP_TLS:
|
||||||
contact_str = profile->tls_public_contact;
|
contact_str = sofia_test_pflag(profile, PFLAG_TLS) ?
|
||||||
|
profile->tls_public_contact : profile->tcp_public_contact;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
contact_str = profile->public_url;
|
contact_str = profile->public_url;
|
||||||
@ -2706,7 +2709,8 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char *
|
|||||||
contact_str = profile->tcp_contact;
|
contact_str = profile->tcp_contact;
|
||||||
break;
|
break;
|
||||||
case SOFIA_TRANSPORT_TCP_TLS:
|
case SOFIA_TRANSPORT_TCP_TLS:
|
||||||
contact_str = profile->tls_contact;
|
contact_str = sofia_test_pflag(profile, PFLAG_TLS) ?
|
||||||
|
profile->tls_contact : profile->tcp_contact;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
contact_str = profile->url;
|
contact_str = profile->url;
|
||||||
@ -4036,9 +4040,11 @@ void sofia_presence_handle_sip_i_subscribe(int status,
|
|||||||
}
|
}
|
||||||
} else if (switch_stristr("port=tls", contact->m_url->url_params)) {
|
} else if (switch_stristr("port=tls", contact->m_url->url_params)) {
|
||||||
if (np.is_auto_nat) {
|
if (np.is_auto_nat) {
|
||||||
cs = profile->tls_public_contact;
|
cs = sofia_test_pflag(profile, PFLAG_TLS) ?
|
||||||
|
profile->tls_public_contact : profile->tcp_public_contact;
|
||||||
} else {
|
} else {
|
||||||
cs = profile->tls_contact;
|
cs = sofia_test_pflag(profile, PFLAG_TLS) ?
|
||||||
|
profile->tls_contact : profile->tcp_contact;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -498,6 +498,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (asis && read_impl.encoded_bytes_per_packet == 0) {
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "%s cannot play or record native files with variable length data\n", switch_channel_get_name(channel));
|
||||||
|
switch_core_session_reset(session, SWITCH_TRUE, SWITCH_TRUE);
|
||||||
|
arg_recursion_check_stop(args);
|
||||||
|
return SWITCH_STATUS_GENERR;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
vval = switch_channel_get_variable(channel, "enable_file_write_buffering");
|
vval = switch_channel_get_variable(channel, "enable_file_write_buffering");
|
||||||
if (!vval || switch_true(vval)) {
|
if (!vval || switch_true(vval)) {
|
||||||
fh->pre_buffer_datalen = SWITCH_DEFAULT_FILE_BUFFER_LEN;
|
fh->pre_buffer_datalen = SWITCH_DEFAULT_FILE_BUFFER_LEN;
|
||||||
@ -1330,6 +1338,20 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
|
|||||||
write_frame.codec = switch_core_session_get_read_codec(session);
|
write_frame.codec = switch_core_session_get_read_codec(session);
|
||||||
samples = read_impl.samples_per_packet;
|
samples = read_impl.samples_per_packet;
|
||||||
framelen = read_impl.encoded_bytes_per_packet;
|
framelen = read_impl.encoded_bytes_per_packet;
|
||||||
|
if (framelen == 0) {
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "%s cannot play or record native files with variable length data\n", switch_channel_get_name(channel));
|
||||||
|
|
||||||
|
switch_core_session_io_write_lock(session);
|
||||||
|
switch_channel_set_private(channel, "__fh", NULL);
|
||||||
|
switch_core_session_io_rwunlock(session);
|
||||||
|
|
||||||
|
switch_core_file_close(fh);
|
||||||
|
|
||||||
|
switch_core_session_reset(session, SWITCH_TRUE, SWITCH_FALSE);
|
||||||
|
status = SWITCH_STATUS_GENERR;
|
||||||
|
continue;
|
||||||
|
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
write_frame.codec = &codec;
|
write_frame.codec = &codec;
|
||||||
samples = codec.implementation->samples_per_packet;
|
samples = codec.implementation->samples_per_packet;
|
||||||
@ -1523,6 +1545,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
|
|||||||
write_frame.codec = switch_core_session_get_read_codec(session);
|
write_frame.codec = switch_core_session_get_read_codec(session);
|
||||||
samples = read_impl.samples_per_packet;
|
samples = read_impl.samples_per_packet;
|
||||||
framelen = read_impl.encoded_bytes_per_packet;
|
framelen = read_impl.encoded_bytes_per_packet;
|
||||||
|
if (framelen == 0) {
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "%s cannot play or record native files with variable length data\n", switch_channel_get_name(channel));
|
||||||
|
eof++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
write_frame.codec = &codec;
|
write_frame.codec = &codec;
|
||||||
samples = codec.implementation->samples_per_packet;
|
samples = codec.implementation->samples_per_packet;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user