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

Forum Post: RE: RECORD NON-CONF CALL

$
0
0
Actually this should be able to be built into the existing application just as long as you have the resources for the extra dxxx devices needed for the transaction records in this case. Upon receipt of the CONNECT or ANSWER event (pending call type) you can go straight to the separate routine for transaction record (since that what its really called in this case). Just take the timeslot number returned from calling both gc_GetXmitSlot (for the device handling the SIP call) and then dx_getmistslot (for the device handling the media). Something like this: port[index].tsinfoN.sc_numts = 1; port[index].tsinfoN.sc_tsarrayp = &(sctsN[index]); if (gc_GetXmitSlot(port[index].ldev, &(port[index].tsinfoN)) != GC_SUCCESS) { //handle error } port[index].tsinfoV.sc_numts = 1; port[index].tsinfoV.sc_tsarrayp = &(sctsV[index]); if (dx_getxmitslot(port[index].vceh, &(port[index].tsinfoV)) 0) { //handle error } Then store those two values retuned from above calls in a new sc_tsinfo block similar to what is done in the docs or like I had below. void trans_rec_file(int idx1, int idx2) { DV_TPT tpt;    DX_IOTT iott;    DX_XPB xpb;    char filename[25]; SC_TSINFO tsinfoR; long tslots[2];    xpb.wFileFormat = FILE_FORMAT_VOX; xpb.wDataFormat = DATA_FORMAT_MULAW; xpb.nSamplesPerSec = DRT_8KHZ; xpb.wBitsPerSample = 8; dx_clrtpt(&tpt, 1);    tpt.tp_type   = IO_EOT;    tpt.tp_termno = DX_MAXTIME;    tpt.tp_length = 400;    tpt.tp_flags  = TF_MAXTIME;    sprintf(filename,"trans_%d_%d.pcm",idx1,idx2);    if ((port[idx2].trfile = open(filename,_O_RDWR|_O_CREAT|_O_TRUNC|_O_BINARY,0666)) == -1) { printf("Error in open: %s record file.\n",filename); exit(1);    }    iott.io_type = IO_DEV|IO_UIO|IO_EOT;    iott.io_bufp    = 0;    iott.io_offset  = 0;    iott.io_length  = -1;    iott.io_fhandle = port[idx2].trfile; printf("file handle: %ld\n",port[idx2].trfile); tslots[0] = sctsV[idx2];  // from the voice device tslots[1] = sctsN[idx1]; // from the network device tsinfoR.sc_numts = 2; tsinfoR.sc_tsarrayp = &tslots[0];    printf("Start Transaction Recording on: %s\n",ATDV_NAMEP(port[idx2].vceh)); if (dx_mreciottdata(port[idx2].vceh, &iott, &tpt, &xpb, EV_ASYNC, &tsinfoR) == -1) { printf("Error in dx_reciottdata: %s\n",ATDV_ERRMSGP(port[idx2].vceh));        exit(1); } } Jeff

Viewing all articles
Browse latest Browse all 1888

Trending Articles



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