]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
write cng frames during sleep
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 3 Oct 2008 18:14:11 +0000 (18:14 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 3 Oct 2008 18:14:11 +0000 (18:14 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9811 d0543943-73ff-0310-b7d9-9358b9ac24b2

scripts/trace/sipgrep
src/switch_ivr.c

index b1c54da7b90f8c58e427ed8ff932a51d41545c14..064a6ebf5aefe6decda6bde179a8a3bc9b45e883 100755 (executable)
@@ -17,8 +17,8 @@ $COLORS{'totag'} = 'bold green';
 $COLORS{'viabranch'} = 'bold cyan';
 
 $limit=2000;
-$ngrep="/usr/local/bin/ngrep"; #path to NGREP
-$ngrep_flags="-l"; # Flag for Ngrep
+$ngrep="/usr/bin/ngrep"; #path to NGREP
+$ngrep_flags="-l -d eth1"; # Flag for Ngrep
 
 $colorsmethods="INVITE|REGISTER|BYE|ACK|CANCEL|OPTIONS|REFER|NOTIFY|MESSAGE|INFO|PRACK|UPDATE";
 
index 080b45aef41d90d50170fe19737e7b00dc0d3ecf..1a904ecb979863f1580ef4594af1c0ea44e6b31a 100644 (file)
@@ -43,8 +43,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session,
        switch_channel_t *channel = switch_core_session_get_channel(session);
        switch_status_t status = SWITCH_STATUS_SUCCESS;
        switch_time_t start = switch_timestamp_now(), now, done = switch_timestamp_now() + (ms * 1000);
-       switch_frame_t *read_frame;
+       switch_frame_t *read_frame, cng_frame = { 0 };
        int32_t left, elapsed;
+       char data[2] = "";
+
+       cng_frame.data = data;
+       cng_frame.datalen = 2;
+       cng_frame.buflen = 2;
+       cng_frame.flags = SFF_CNG;
 
        for (;;) {
                now = switch_timestamp_now();
@@ -119,6 +125,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session,
                                break;
                        }
                }
+
+               switch_core_session_write_frame(session, &cng_frame, SWITCH_IO_FLAG_NONE, 0);
+
        }
 
        return status;