diff --git a/scripts/perl/tonegen/rtttl2tgml.pl b/scripts/perl/tonegen/rtttl2tgml.pl index 820e36cc4e..a8a3ed0632 100644 --- a/scripts/perl/tonegen/rtttl2tgml.pl +++ b/scripts/perl/tonegen/rtttl2tgml.pl @@ -18,8 +18,19 @@ our $NOTES = { my $file = shift or die "no file\n"; +my $rtttl; +my $cr = "\n"; -my $rtttl = `cat $file`; +if ($file eq "-nocr") { + $cr = ""; + $file = shift; +} + +if ($file eq "-") { + $rtttl = ; +} else { + $rtttl = `cat $file`; +} $rtttl =~ s/\n//g; @@ -53,7 +64,7 @@ foreach (@{$all}) { #print STDERR "$_->[0] $_->[1] $_->[2] $_->[3]\n"; - print "%($ms, 0, $NOTES->{$_->[1]}->[$_->[2]]);\n"; + print "%($ms,0,$NOTES->{$_->[1]}->[$_->[2]]);" . $cr; } diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index c2b344cdf7..f3ab8c48ef 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -8129,6 +8129,7 @@ void sofia_info_send_sipfrag(switch_core_session_t *aleg, switch_core_session_t if (zstr(acp->caller_id_name)) { snprintf(message, sizeof(message), "P-Asserted-Identity: \"%s\" <%s>", acp->caller_id_number, acp->caller_id_number); } else { + check_decode(acp->caller_id_name, aleg); snprintf(message, sizeof(message), "P-Asserted-Identity: \"%s\" <%s>", acp->caller_id_name, acp->caller_id_number); } diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index bccae9293f..4978815f98 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -72,7 +72,7 @@ static void sofia_reg_kill_reg(sofia_gateway_t *gateway_ptr) nua_handle_bind(gateway_ptr->nh, NULL); } - if (gateway_ptr->state != REG_STATE_REGED) { + if (gateway_ptr->state != REG_STATE_REGED && gateway_ptr->state != REG_STATE_UNREGISTER) { if (gateway_ptr->nh) { nua_handle_destroy(gateway_ptr->nh); gateway_ptr->nh = NULL; diff --git a/src/switch_ivr.c b/src/switch_ivr.c index 85ffa00b8a..19d3c102a1 100644 --- a/src/switch_ivr.c +++ b/src/switch_ivr.c @@ -138,7 +138,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session, unsigned char *abuf = NULL; switch_codec_implementation_t imp = { 0 }; switch_codec_t codec = { 0 }; - int sval = -1; + int sval = 0; const char *var; /* @@ -192,7 +192,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session, write_frame.codec = &codec; switch_zmalloc(abuf, SWITCH_RECOMMENDED_BUFFER_SIZE); - memset(abuf, 255, SWITCH_RECOMMENDED_BUFFER_SIZE); write_frame.data = abuf; write_frame.buflen = SWITCH_RECOMMENDED_BUFFER_SIZE; write_frame.datalen = imp.decoded_bytes_per_packet; @@ -295,9 +294,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session, } if (sval && write_frame.datalen) { - if (sval > 0) { - switch_generate_sln_silence((int16_t *) write_frame.data, write_frame.samples, sval); - } + switch_generate_sln_silence((int16_t *) write_frame.data, write_frame.samples, sval); switch_core_session_write_frame(session, &write_frame, SWITCH_IO_FLAG_NONE, 0); } else { switch_core_session_write_frame(session, &cng_frame, SWITCH_IO_FLAG_NONE, 0);