Hi
I am using the following code for detecting/retrieving CALLER ID in my IVRS Application using D4PCI Card.
My code is very simple like C Lang. its not using any Handlers, Events etc.
I always get the following error
Error: Caller ID info/sub-msg not available
if (dx_wtring(chdev, 3, DX_OFFHOOK, -1) == -1){
printf("Ring Detect /* process error */");
DoErrorPlay(chdev,"Ring Detect error (Using dx_wtring function) ",2) ;
goto end_para;
}
getCallerID(chdev) ;
void getCallerID(int chdev)
{
unsigned short parmval ;
unsigned char buffer[81];
parmval = DX_CALLIDENABLE;
if (dx_setparm(chdev, DXCH_CALLID, (void *) &parmval) == -1)
exit(0) ;
if (dx_gtcallid(chdev, buffer) == -1)
/* Can check the specific error code */
if (ATDV_LASTERR(chdev) == EDX_CLIDBLK)
printf("\nCaller ID information blocked \n");
else if (ATDV_LASTERR(chdev) == EDX_CLIDOOA)
printf("\nCaller out of area \n");
else
/* Or print the pre-formatted error message */
printf("\nError: %s \n", ATDV_ERRMSGP(chdev)) ;
printf("\nCaller ID = %s\n", buffer) ;
Regards
R. K. Aggarwalhttp://allfree-stuff.com
Hello. It appears that the caller ID is simply not available, based on the error message you get. In other words, it is not being passed through to the D/4PCI board. To verify, remove the line going to the D/4PCI and plug it into an analog phone w/ caller id display to see if it is coming through or not.
I hope this helps!
Hi,
1 ) Waitfor rings dont OFF HOOK
dx_wtring(chdev, 3, DX_ONHOOK, -1)
2) Get DTMF callerid in buffer
DV_TPT tpt_cid[3];
DV_DIGIT dig_cid;
tpt_cid[0].tp_type = IO_CONT;
tpt_cid[0].tp_termno = DX_MAXDTMF;
tpt_cid[0].tp_length = 12 ;
tpt_cid[0].tp_flags = TF_MAXDTMF;
tpt_cid[1].tp_type = IO_CONT; //CONT ;
tpt_cid[1].tp_termno = DX_IDDTIME;
tpt_cid[1].tp_length = 5;
tpt_cid[1].tp_flags = TF_FIRST;
tpt_cid[2].tp_type = IO_EOT; //IO_EOT ;
tpt_cid[2].tp_termno = DX_MAXTIME ;
tpt_cid[2].tp_length = 10;
tpt_cid[2].tp_flags = TF_10MS;
dx_getdig (voiceh, tpt_cid , &dig_cid, EV_SYNC );
//dig_cid is DTMF buffer
3) Answer the call
dx_sethook(chdev,DX_OFFHOOK,EV_SYNC);
Regards, Sudhakar Babu.G
Dear Sudhakar,
Thanks a ton