Wednesday, May 15, 2013

ASUS N56V 노트북에 SSD 장착, Windows 7 설치

기본적으로 N56V 에는 등신같은 Windows 8 이 설치되어있다.

물건을 사자마자 SSD 도 장착했고 Windows 7 을 설치하려 했더니 Starting Windows 라고 나오더니 뻣어버린다.

Bios setup에서 CSM 을 Enable 시키고 pxe 뭐시기도 Enable 시키고 설치하면 설치가 된다.

끝~


Tuesday, May 7, 2013

dialogic api 로 녹음중 통화 끊김 감지. dialogic api detect disconnected using dual tone


dialogic global call api를 이용한 녹음.

녹음 중 전화를 끊어버린 상황을 감지하는 소스플그램임.


This source program presents how to detect disonnected while recording.

dual tone (480, 30, 620, 40) is korean standard. find your self what tone using in your country.




//CH_DEV는 LINE 번호임. 1채널인경우 1임.

#define CH_DEV 1


CString CDialogicLib::Record(CString savefilename, int timeout_sec )
{
 CString result="";
 DV_TPT tpt[10];            /* termination parameter table */
 DX_XPB xpb;

 xpb.nSamplesPerSec = DRT_11KHZ;
 xpb.wFileFormat = FILE_FORMAT_WAVE;
 xpb.wDataFormat = DATA_FORMAT_ALAW;
 xpb.wBitsPerSample = 8;

 #define TID_1    101

 dx_clrtpt(tpt,4);

 tpt[0].tp_type   = IO_CONT;
 tpt[0].tp_termno = DX_MAXDTMF;
 tpt[0].tp_length = 1;
 tpt[0].tp_flags  = TF_MAXDTMF;

 // Terminate on Loop Current Drop (call disconnect)
 tpt[1].tp_type = IO_CONT;
 tpt[1].tp_termno = DX_LCOFF;    
 tpt[1].tp_length = 1;          //  I have also tried 3
 tpt[1].tp_flags = TF_LCOFF;

 tpt[2].tp_type = IO_CONT;
 tpt[2].tp_termno = DX_MAXTIME;        /* Function Time */
 tpt[2].tp_length = (timeout_sec * 10);    /* 10 seconds (100 msec resolution timer) */
 tpt[2].tp_flags = TF_MAXTIME;        /* Edge-triggered */

 tpt[3].tp_type = IO_EOT;
 tpt[3].tp_termno = DX_TONE;
 tpt[3].tp_length = TID_1;
 tpt[3].tp_flags = TF_TONE;
 tpt[3].tp_data = DX_TONEON;


 dx_deltones(CH_DEV);
 dx_blddt(TID_1, 480, 30, 620, 40,TN_LEADING );
 dx_addtone(CH_DEV,NULL,0);
 dx_enbtone( CH_DEV, TID_1, DM_TONEON | DM_TONEOFF );

 dx_clrdigbuf(CH_DEV);

 dx_setevtmsk(CH_DEV, GCEV_DISCONNECTED);

 /* Start 11KHz A-law recording */
 if (dx_recwav(CH_DEV, savefilename, tpt,   &xpb,PM_TONE|EV_SYNC) == -1)
 {
  return "ERROR";
 }
 else
 {
  dx_clrdigbuf(CH_DEV);


  switch(ATDX_TERMMSK(CH_DEV))
  {
  case TM_MAXDTMF:
   return "SUCCESS";
  case TM_LCOFF :
   result = "LCOFF";
   break;
  case TM_TONE:
   result ="TONE";
   break;
  case TM_MAXTIME:
   result = "MAXTIME";
   break;
  }
  return "UNKNOWN";
 }

}

Thursday, May 2, 2013

dx_gtcallid 가 전화번호를 못알아내는 경우. (dx_gtcallid not working)

Ring 이 3번 정도 울린 후에 dx_gtcallid 를 호출하면 상대방의 전화번호를 알 수 있다. Call dx_gtcallid after ring more then 3 times. example) if (dx_wtring(CH_DEV, 3, DX_OFFHOOK, 10000) != -1) { dx_gtcallid( ..... ); return true; } else return false; //timeout