Fix iaxrecord so that it doesnt record rings - previous patch is not necessary with correctly configured asterix extensions - warvox - VoIP based wardialing tool, forked from rapid7/warvox.
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
       ---
 (DIR) commit 72d086e74af1fc956e851c7a27e000685c52c17a
 (DIR) parent 6b0626b2db5bb3e7bc048b961a32de39c56fe929
 (HTM) Author: HD Moore <hd_moore@rapid7.com>
       Date:   Mon, 25 May 2009 22:16:26 +0000
       
       Fix iaxrecord so that it doesnt record rings - previous patch is not necessary with correctly configured asterix extensions
       
       
       Diffstat:
         M src/iaxrecord/iaxrecord.c           |      18 +++---------------
       
       1 file changed, 3 insertions(+), 15 deletions(-)
       ---
 (DIR) diff --git a/src/iaxrecord/iaxrecord.c b/src/iaxrecord/iaxrecord.c
       @@ -29,7 +29,6 @@ int audio       = 0;
        int busy        = 0;
        int fail        = 1;
        int done        = 0;
       -int ansd        = 0;
        
        float silence_threshold = 0.0f;
        int call_state  = 0;
       @@ -91,20 +90,11 @@ int state_event_callback(struct iaxc_ev_call_state call) {
        
        int audio_event_callback( struct iaxc_ev_audio audio) {
        
       -        /* We have been recording rings, dump the file and reopen */
       -        if(call_trace != -1 && !fail && !ansd) {
       -                close(call_trace);
       -                unlink(iax_out);
       -                call_trace = -1;
       -                call_bytes  = 0;
       -                ansd = 1;
       -        }
       -        
       -        if(call_trace == -1) {
       +        if(call_trace == -1 && !fail) {
                        call_trace = open(iax_out, O_CREAT|O_TRUNC|O_WRONLY, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
                }
       -
       -        if(call_trace != -1){
       +                
       +        if(call_trace != -1) {
                        if(debug) printf("audio data: format=%d encoded=%d size=%d state=%d\n", audio.format, audio.encoded, audio.size, call_state);
                        write(call_trace, audio.data, audio.size);
                        call_bytes += audio.size;
       @@ -264,8 +254,6 @@ int main(int argc, char **argv) {
                
                if(! etime) time(&etime);
                
       -        if(call_bytes > 0 && fail == 1) fail = 0;
       -        
                fprintf(stdout, "COMPLETED %s BYTES=%d FILE=%s FAIL=%d BUSY=%d RINGTIME=%d\n", 
                        iax_num, 
                        call_bytes,