Merge branch 'master' of git@git.freeswitch.org:freeswitch

This commit is contained in:
Michal Bielicki 2010-10-14 22:30:17 +02:00
commit a346530fa4
6 changed files with 1210 additions and 519 deletions

File diff suppressed because it is too large Load Diff

View File

@ -265,10 +265,12 @@ static void *ftdm_sangoma_isdn_run(ftdm_thread_t *me, void *obj)
}
while (ftdm_running() && !(ftdm_test_flag(span, FTDM_SPAN_STOP_THREAD))) {
/* find out why we returned from the interrupt queue */
ret_status = ftdm_interrupt_multiple_wait(ftdm_sangoma_isdn_int, 2, sleep);
/* Check if there are any timers to process */
ftdm_sched_run(signal_data->sched);
ret_status = ftdm_interrupt_multiple_wait(ftdm_sangoma_isdn_int, 2, sleep);
/* find out why we returned from the interrupt queue */
switch (ret_status) {
case FTDM_SUCCESS: /* there was a state change on the span */
/* process all pending state changes */
@ -289,13 +291,30 @@ static void *ftdm_sangoma_isdn_run(ftdm_thread_t *me, void *obj)
/* twiddle */
break;
case FTDM_FAIL:
ftdm_log(FTDM_LOG_ERROR,"ftdm_interrupt_wait returned error!\non span = %s\n", span->name);
ftdm_log(FTDM_LOG_ERROR,"%s:ftdm_interrupt_wait returned error!\n", span->name);
break;
default:
ftdm_log(FTDM_LOG_ERROR,"ftdm_interrupt_wait returned with unknown code on span = %s\n", span->name);
ftdm_log(FTDM_LOG_ERROR,"%s:ftdm_interrupt_wait returned with unknown code\n", span->name);
break;
}
/* Poll for events, e.g HW DTMF */
ret_status = ftdm_span_poll_event(span, 0);
switch(ret_status) {
case FTDM_SUCCESS:
{
ftdm_event_t *event;
while (ftdm_span_next_event(span, &event) == FTDM_SUCCESS);
}
break;
case FTDM_TIMEOUT:
/* No events pending */
break;
default:
ftdm_log(FTDM_LOG_WARNING, "%s:Failed to poll span event\n", span->name);
}
if (ftdm_sched_get_time_to_next_timer(signal_data->sched, &sleep) == FTDM_SUCCESS) {
if (sleep < 0 || sleep > SNGISDN_EVENT_POLL_RATE) {
sleep = SNGISDN_EVENT_POLL_RATE;

View File

@ -188,11 +188,11 @@ ftdm_status_t cpy_called_num_from_stack(ftdm_caller_data_t *ftdm, CdPtyNmb *cdPt
}
if (cdPtyNmb->nmbPlanId.pres == PRSNT_NODEF) {
ftdm->cid_num.plan = cdPtyNmb->nmbPlanId.val;
ftdm->dnis.plan = cdPtyNmb->nmbPlanId.val;
}
if (cdPtyNmb->typeNmb0.pres == PRSNT_NODEF) {
ftdm->cid_num.type = cdPtyNmb->typeNmb0.val;
ftdm->dnis.type = cdPtyNmb->typeNmb0.val;
}
if (cdPtyNmb->nmbDigits.pres == PRSNT_NODEF) {

View File

@ -189,6 +189,9 @@
<ProjectReference Include="..\..\..\..\libs\win32\openssl\ssleay32.2010.vcxproj">
<Project>{b4b62169-5ad4-4559-8707-3d933ac5db39}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\..\libs\win32\pthread\pthread.2010.vcxproj">
<Project>{df018947-0fff-4eb3-bdee-441dc81da7a4}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\..\libs\win32\sofia\libsofia_sip_ua_static.2010.vcxproj">
<Project>{70a49bc2-7500-41d0-b75d-edcc5be987a0}</Project>
</ProjectReference>

View File

@ -898,37 +898,40 @@ SWITCH_STANDARD_API(sangoma_function)
if (sess->encoder.rxrtp) {
stats = switch_rtp_get_stats(sess->encoder.rxrtp, NULL);
stream->write_function(stream, "=== Encoder ===\n");
stream->write_function(stream, "=== %s Encoder ===\n", sess->impl->iananame);
stream->write_function(stream, "Remote address: %s:%d\n\n", switch_rtp_get_remote_host(sess->encoder.rxrtp), switch_rtp_get_remote_port(sess->encoder.rxrtp));
stream->write_function(stream, "Tx ULAW from %d.%d.%d.%d:%d to %d.%d.%d.%d:%d\n\n", SNGTC_NIPV4(sess->encoder.reply.a.host_ip), sess->encoder.reply.a.host_udp_port,
SNGTC_NIPV4(sess->encoder.reply.a.codec_ip), sess->encoder.reply.a.codec_udp_port);
stream->write_function(stream, "Rx %s at %d.%d.%d.%d:%d from %d.%d.%d.%d:%d\n\n", sess->impl->iananame, SNGTC_NIPV4(sess->encoder.reply.b.host_ip), sess->encoder.reply.b.host_udp_port,
SNGTC_NIPV4(sess->encoder.reply.b.codec_ip), sess->encoder.reply.b.codec_udp_port);
stream->write_function(stream, "-- Encoder Inbound Stats --\n");
stream->write_function(stream, "-- Inbound Stats --\n");
stream->write_function(stream, "Rx Discarded: %lu\n", sess->encoder.rxdiscarded);
sangoma_print_stats(stream, &stats->inbound);
stats = switch_rtp_get_stats(sess->encoder.txrtp, NULL);
stream->write_function(stream, "-- Encoder Outbound Stats --\n");
stream->write_function(stream, "-- Outbound Stats --\n");
sangoma_print_stats(stream, &stats->outbound);
} else {
stream->write_function(stream, "\n=== No Encoder ===\n\n");
}
if (sess->decoder.rxrtp) {
stats = switch_rtp_get_stats(sess->decoder.rxrtp, NULL);
stream->write_function(stream, "=== Decoder ===\n");
stream->write_function(stream, "Remote address: %s:%d\n\n", switch_rtp_get_remote_host(sess->decoder.rxrtp), switch_rtp_get_remote_port(sess->decoder.rxrtp));
stream->write_function(stream, "=== %s Decoder ===\n", sess->impl->iananame);
stream->write_function(stream, "Tx %s from %d.%d.%d.%d:%d to %d.%d.%d.%d:%d\n\n", sess->impl->iananame, SNGTC_NIPV4(sess->decoder.reply.a.host_ip), sess->decoder.reply.a.host_udp_port,
SNGTC_NIPV4(sess->decoder.reply.a.codec_ip), sess->decoder.reply.a.codec_udp_port);
stream->write_function(stream, "Rx ULAW at %d.%d.%d.%d:%d from %d.%d.%d.%d:%d\n\n", SNGTC_NIPV4(sess->decoder.reply.b.host_ip), sess->decoder.reply.b.host_udp_port,
SNGTC_NIPV4(sess->decoder.reply.b.codec_ip), sess->decoder.reply.b.codec_udp_port);
stream->write_function(stream, "-- Decoder Inbound Stats --\n");
stream->write_function(stream, "-- Inbound Stats --\n");
stream->write_function(stream, "Rx Discarded: %lu\n", sess->decoder.rxdiscarded);
sangoma_print_stats(stream, &stats->inbound);
stats = switch_rtp_get_stats(sess->decoder.txrtp, NULL);
stream->write_function(stream, "-- Decoder Outbound Stats --\n");
stream->write_function(stream, "-- Outbound Stats --\n");
sangoma_print_stats(stream, &stats->outbound);
} else {
stream->write_function(stream, "\n=== No Decoder ===\n\n");
}
} else if (!strcasecmp(argv[0], "debug")) {
struct sangoma_transcoding_session *sess;

View File

@ -906,6 +906,7 @@ static switch_bool_t record_callback(switch_media_bug_t *bug, void *user_data, s
switch_core_file_close(rh->fh);
if (rh->fh->samples_out < rh->fh->samplerate * rh->min_sec) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Discarding short file %s\n", rh->file);
switch_channel_set_variable(channel, "RECORD_DISCARDED", "true");
switch_file_remove(rh->file, switch_core_session_get_pool(session));
}
}