Quantcast
Channel: Developer Group
Viewing all articles
Browse latest Browse all 1888

Forum Post: RE: RECORD NON-CONF CALL

$
0
0
Jeff, Thanks a million for the help.  If I understand you correctly, as long as I keep the code in the main engine I run async, I won't need another dxxx resource.  Is that correct?  Here's what I'm doing, which seems straightforward, but of course doesn't work. int start_rec_call(int ch) {    int voxdev, ipmdev, recdev;    DX_IOTT iott = {0};    DV_TPT tpt = {0};    DX_XPB xpb = {0};    SC_TSINFO voxtsinfo, ipmtsinfo;    long recslots[1024], voxscts, ipmscts;    iott.io_type = IO_DEV | IO_EOT;    iott.io_offset = 0;    iott.io_length = -1;    if((iott.io_fhandle = open("/audio/tmp/recordcall.vox",O_RDWR|O_TRUNC|O_CREAT,0666)) 0) {        dlog(ch,"Error opening call recording file");        return(-1);    }    dx_clrtpt(&tpt,1);    tpt.tp_type = IO_EOT;    tpt.tp_termno = DX_LCOFF;    tpt.tp_length = 1;    tpt.tp_flags = TF_LCOFF;    dlog(ch,"RECC:TPT setup");    xpb.wFileFormat = FILE_FORMAT_VOX;    xpb.wDataFormat = DATA_FORMAT_MULAW;    xpb.nSamplesPerSec = DRT_8KHZ;    xpb.wBitsPerSample = 8;    dlog(ch,"RECC:XPB setup");    voxtsinfo.sc_numts = 1;    voxtsinfo.sc_tsarrayp = &voxscts;    if(dx_getxmitslot(port[ch].voxfd,&voxtsinfo) == -1) {        dlog(ch,"Error on record call getsmitslot");        return(-1);    }    ipmtsinfo.sc_numts = 1;    ipmtsinfo.sc_tsarrayp = &ipmscts;    if(dx_getxmitslot(ipmdev,&ipmtsinfo) == -1) {        dlog(ch,"Error on record call getsmitslot");        return(-1);    }    recslots[1] = voxscts;    recslots[0] = ipmscts;    rectsinfo.sc_numts = 2;    rectsinfo.sc_tsarrayp = &recslots[0];    if(dx_mreciottdata(ipmdev,&iott, &tpt, &xpb, EV_ASYNC | TM_TONE, &rectsinfo) == -1) {        dlog(ch,"Error starting mreciottdata on vox dev");        dlog(ch,"Lasterr %d errmsg [%s]",ATDV_LASTERR(port[ch].voxfd),ATDV_ERRMSGP(port[ch].voxfd));        return(-1);    } }

Viewing all articles
Browse latest Browse all 1888

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>