diff --git a/scripts/socket/sock.pl b/scripts/socket/sock.pl index 946adab02f..3fe8c02b11 100755 --- a/scripts/socket/sock.pl +++ b/scripts/socket/sock.pl @@ -21,12 +21,12 @@ print "Call: $data->{'caller-channel-name'} $data->{'unique-id'}\n"; $o = $fs->call_command("answer"); #to turn on events when in async mode -#$o = $fs->raw_command("myevents"); +$o = $fs->raw_command("myevents"); $o = $fs->call_command("playback", "/ram/swimp.raw"); $o = $fs->call_command("hangup"); #comment exit in async mode -exit; +#exit; while(my $r = $fs->readhash(undef)) { if ($r->{socketerror}) { diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 301248fc42..ac1f1e3e7e 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -964,12 +964,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ if (status == SWITCH_STATUS_BREAK || bytes == 0) { if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_DATAWAIT)) { - if (rtp_session->ms_per_packet) { - switch_yield((rtp_session->ms_per_packet / 1000) * 750); - } else { - switch_yield(1000); - } - continue; + goto do_continue; } return 0; } @@ -1005,12 +1000,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ if (bytes && rtp_session->cng_pt && rtp_session->recv_msg.header.pt == rtp_session->cng_pt) { - if (rtp_session->ms_per_packet) { - switch_yield((rtp_session->ms_per_packet / 1000) * 750); - } else { - switch_yield(1000); - } - continue; + goto do_continue; } @@ -1059,11 +1049,19 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_ } } - continue; + goto do_continue; } break; + + do_continue: + + if (rtp_session->ms_per_packet) { + switch_yield((rtp_session->ms_per_packet / 1000) * 750); + } else { + switch_yield(1000); + } } *payload_type = (switch_payload_t) rtp_session->recv_msg.header.pt;