This is part of the code in my test module. The ast_dsp_call_progress
always return 0. I have setup an system calling into the * box and this
module is called from a extension. 

        xcpa = ast_dsp_new();

        if (!xcpa)
                return 0;


        /* Set read format to signed linear so we get signed linear
frames in */
        readFormat = chan->readformat;
        if (ast_set_read_format(chan, AST_FORMAT_SLINEAR) < 0 ) {
                ast_dsp_free(xcpa);
                return 0;
        }

        while ((res = ast_waitfor(chan, 40000)) > -1) 
        {
                /* If we fail to read in a frame, that means they hung
up */
                if (!(f = ast_read(chan))) 
                        break;

                if (f->frametype == AST_FRAME_VOICE) 
                {
                        /* get total time spent here */                 
                        TotalTime += (ast_codec_get_samples(f) /
DEFAULT_SAMPLES_PER_MS);;

                        rc = ast_dsp_call_progress(xcpa, f);
                        if (rc) ast_verbose(VERBOSE_PREFIX_3
"ast_dsp_call_progress %d.\r\n", rc);
                        if (TotalTime >= 40000) 
                                break;
                }
                ast_frfree(f);
        }
        if (readFormat)
                ast_set_read_format(chan, readFormat);
        ast_dsp_free(xcpa);
        return 0;

_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev

Reply via email to