亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? gc_basic_call_model.c

?? dialogic 板卡globalcall 測試代碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
	} else {
		switch (value)
		{
			case GCCT_CAD :
				strcpy(str, "call connected - cadence break");
				break;

			case GCCT_LPC :
				strcpy(str, "call connected - loop current drop");
				break;

			case GCCT_PVD :
				strcpy(str, "call connected - voice detection");
				break;

			case GCCT_PAMD :
				strcpy(str, "call connected - answering machine");
				break;

			case GCCT_FAX :
				strcpy(str, "call connected - FAX machine");
				break;

			case GCCT_NA :
				strcpy(str, "call connected - call progress not applicable");
				break;
	
			default :
				strcpy(str, "call connected - unknown connect type");
				break;
		}
	}
	printandlog(pline->index, MISC, NULL, str); 

	pline->call_state = GCST_CONNECTED;
	pline->numb_calls++;							/* Increment the total calls on this device */
	out_calls++;									/* Increment the total outbound calls on all devices */
	outbound_application(pline);				/* call your application specific code here */
}

/****************************************************************
*			NAME: open_all_devices(void)
* DESCRIPTION: Routine calls the specific technology function, which
*					opens all the line devices. 
*		  INPUT: None
*		RETURNS: None - exits if error
*	  CAUTIONS: none
****************************************************************/
void open_all_devices(void)
{
	int	index;

	for (index = 0; index < num_devices; index++) { 
		open_device(index);
	}
}
/****************************************************************
*			NAME: open_devices(int index)
* DESCRIPTION: Routine calls the specific technology function, which
*					opens all specific line device. 
*		  INPUT: index - index into port data structure
*		RETURNS: None - exits if error
*	  CAUTIONS: Since multiple paths here, will init run-time fields of port data structure
****************************************************************/
void open_device(int index)
{
	/* reset run-time variables that might now be wrong */
	port[index].ldev = 0;
	port[index].crn = 0;
	port[index].index = index;
	port[index].call_state = GCST_NULL;
	port[index].blocked = YES;
	port[index].waitcall_active = NO;	
	port[index].dropcall_active = NO;	
	port[index].resetlinedev_active = NO;	
	port[index].resetlinedev_required_after_unblocked = NO;	
	port[index].dropcall_time = 0;


	if ((strcmp(port[index].protname, "isdn") == 0) ||
		(strcmp(port[index].protname, "ISDN") == 0)) {
		gc_demo_open_isdn_channel(index);
	} else if ((strstr(port[index].protname, "ss7") != NULL) ||
		(strstr(port[index].protname, "SS7") != NULL)) {
		gc_demo_open_ss7_channel(index);
	} else if ((strstr(port[index].protname, "_AN_") != NULL) ||
		(strstr(port[index].protname, "_an_") != NULL)) {
		gc_demo_open_analog_channel(index);
	} else {								/* assume everything else is E1 or T1 */
											/* if wrong, then gc_OpenEx() will fail */
		gc_demo_open_E1orT1_channel(index);
	}
}

/****************************************************************
*			NAME: gc_demo_makecall(index)
* DESCRIPTION: Routine calls the gc_Makecall() function if not blocked and there is not a call active
*		  INPUT: index into port[] for this channel
*		RETURNS: exits with exitdemo() if not successful
*	  CAUTIONS: none
****************************************************************/
void gc_demo_makecall(int index)
{
	char					str[MAX_STRING_SIZE];
	struct channel		*pline;
	GC_MAKECALL_BLK	*makecallblkp;				/* Variable for MAKECALL block */		

	pline = &port[index];
	if (pline->blocked == YES) {
		return;											/* cannot make a call until unblocked */
	}

	if (pline->makecall_active == YES) {
		printandlog(index, MISC, NULL, "Trying to make a call while makecall is already active\n");
		return;
	}

	/* if the makecall block has been initialized, use it */
	/* else use NULL for the makecall block pointer */
	makecallblkp = (pline->makecallblk.gclib != NULL) ? &pline->makecallblk : NULL;

	if (gc_MakeCall(pline->ldev, &pline->crn, pline->destination_num, makecallblkp, pline->makecall_timeout, EV_ASYNC) != GC_SUCCESS) {
		sprintf(str, "gc_MakeCall(linedev=%ld, numberstr=%s, mode=EV_ASYNC) Failed", pline->ldev, pline->destination_num);
		printandlog(index, GC_APIERR, NULL, str);
		exitdemo(1);
	}
	pline->makecall_active = YES;					/* indicate there is a call active */
	sprintf(str, "gc_MakeCall(linedev=%ld, numberstr=%s, mode=EV_ASYNC) Success", pline->ldev, pline->destination_num);
	printandlog(index, GC_APICALL, NULL, str);
} /* End of Function */

/****************************************************************
*			NAME: gc_demo_open_isdn_channel(index)
* DESCRIPTION: initialize a port used by an ISDN protocol
*		  INPUT: index into port[] for this channel
*		RETURNS: exits with exitdemo() if not successful
*	  CAUTIONS: none
****************************************************************/
void gc_demo_open_isdn_channel(int index)
{
	char						str[MAX_STRING_SIZE];
	GCLIB_MAKECALL_BLK	*gclib_makecallp;
	GC_PARM_BLKP			parmblkp = NULL;


	printandlog(index, MISC, NULL, "ISDN device being opened");

	/* initialize the flag blocked to YES */
	port[index].blocked = YES; 
	port[index].techtype = ISDN;
	port[index].call_state = GCST_NULL;
	port[index].makecall_timeout = 0;							/* timeout parameter is ignored for ISDN */

	/* initializes the GC_PARM_BLK with the respective set_id, parm_id and the value */
	/*To set the bearer channel transfer mode information */
	gc_util_insert_parm_val(&parmblkp, GCIS_SET_BEARERCHNL, GCIS_PARM_TRANSFERMODE, 
		sizeof(int), ISDN_ITM_CIRCUIT);

	/*To set the bearer channel transfer rate information */
	gc_util_insert_parm_val(&parmblkp, GCIS_SET_BEARERCHNL, GCIS_PARM_TRANSFERRATE, 
		sizeof(int), BEAR_RATE_64KBPS);

	/*To set Layer 1 protocol to use on bearer channel */
	gc_util_insert_parm_val(&parmblkp, GCSET_CHAN_CAPABILITY, GCPARM_TYPE, 
		sizeof(int), GCCAPTYPE_AUDIO);

	/*To set Layer 1 protocol to use on bearer channel */
	gc_util_insert_parm_val(&parmblkp, GCSET_CHAN_CAPABILITY, GCPARM_CAPABILITY, 
		sizeof(int), GCCAP_AUDIO_g711Alaw64k);

	/*To set User rate to use on bearer channel (layer 1 rate)*/
	gc_util_insert_parm_val(&parmblkp, GCSET_CHAN_CAPABILITY, GCPARM_RATE, 
		sizeof(int), GCCAPRATE_DEFAULT);

	/*To support the specific feature or service requested from the network */
	gc_util_insert_parm_val(&parmblkp, GCIS_SET_FACILITY, GCIS_PARM_FACILITY_CODINGVALUE, 
		sizeof(int), 0x03);

	/*To support the specific feature or service requested from the network */
	gc_util_insert_parm_val(&parmblkp, GCIS_SET_FACILITY, GCIS_PARM_FACILITY_FEATURESERVICE, 
		sizeof(int), ISDN_SERVICE);
		
	/* Note: gclib_makecallp is not freed since a "permanent" data */
	/* structure. Assume program exit will free the resource			*/
	gclib_makecallp = (GCLIB_MAKECALL_BLKP)
		malloc(sizeof(GCLIB_MAKECALL_BLK) + parmblkp->parm_data_size);
	if (gclib_makecallp == NULL) {
		printandlog(ALL_DEVICES, MISC, NULL, "Could not allocate memory\n");
		exitdemo(1);
	}
	port[index].makecallblk.cclib = NULL;
	port[index].makecallblk.gclib = gclib_makecallp;

  /* Set the extra data in the makecall block */
  gclib_makecallp->ext_datap = parmblkp;

	/* Set the called number plan to ISDN type  */
	gclib_makecallp->destination.address_plan = GCADDRPLAN_ISDN;

	/* Set the called number plan to ISDN type  */
	gclib_makecallp->destination.address_type = GCADDRTYPE_NAT;
	strcpy(gclib_makecallp->destination.sub_address, "456");
	gclib_makecallp->destination.sub_address_plan = 0;
	gclib_makecallp->destination.sub_address_type = GCSUBADDR_OSI;
		
	strcpy(gclib_makecallp->origination.address, "7654321");

	/* Set the calling number plan to ISDN type	*/
	gclib_makecallp->origination.address_plan = GCADDRPLAN_ISDN;

	/* Set the calling number plan to ISDN type	*/
	gclib_makecallp->origination.address_type = GCADDRTYPE_NAT;
	strcpy(gclib_makecallp->origination.sub_address, "456");
	gclib_makecallp->origination.sub_address_plan = 0;
	gclib_makecallp->origination.sub_address_type = GCSUBADDR_OSI;
	
	gclib_makecallp->call_info.address_info = GCADDRINFO_ENBLOC;
	
	/* Open the line device */
	if (gc_OpenEx(&port[index].ldev, port[index].devname, EV_SYNC, (void *)&port[index]) != GC_SUCCESS) {
		sprintf(str, "gc_OpenEx(devicename=%s, mode=EV_SYNC) Failed", port[index].devname);
		printandlog(index, GC_APIERR, NULL, str);
		exitdemo(1);
	}
	sprintf(str, "gc_OpenEx(devicename=%s, mode=EV_SYNC) Success", port[index].devname);
	printandlog(index, GC_APICALL, NULL, str);

	/* Due to implementation, must wait until get GCEV_UNBLOCKED before issueing the reset linedevice */
	port[index].resetlinedev_required_after_unblocked = YES;
} /* End of Function */

/****************************************************************
*			NAME: gc_demo_open_analog_channel(index)
* DESCRIPTION: initialize a port used by an ANAPI protocol
*		  INPUT: index into port[] for this channel
*		RETURNS: exits with exitdemo() if not successful
*	  CAUTIONS: none
****************************************************************/
void gc_demo_open_analog_channel(int index)
{
	char		str[MAX_STRING_SIZE], msgbuffer[MAX_STRING_SIZE];


	printandlog(index, MISC, NULL, "Analog device being opened");

	/* initialize the flag blocked to YES */
	port[index].blocked = YES; 
	port[index].techtype = ANALOG;
	port[index].call_state = GCST_NULL;
	port[index].makecall_timeout = 60;
	
	if (gc_OpenEx(&port[index].ldev, port[index].devname, EV_SYNC, (void *)&port[index]) != GC_SUCCESS) {
		sprintf(str, "gc_OpenEx(devicename=%s, mode=EV_SYNC) Failed", port[index].devname);
		printandlog(index, GC_APIERR, NULL, str);
		exitdemo(1);
	}
	
	sprintf(str, "gc_OpenEx(devicename=%s, mode=EV_SYNC) Success", port[index].devname);
	printandlog(index, GC_APICALL, NULL, str);

	if ((gc_LoadDxParm(port[index].ldev,"dxchan.vcp", msgbuffer, MAX_STRING_SIZE)) !=0) {
		sprintf(str, "gc_LoadDxParm(linedev=%ld) Failed)%s)", port[index].ldev, msgbuffer);
		printandlog(index, GC_APIERR, NULL, str);
		exitdemo(1);
	}
	sprintf(str, "gc_LoadDxParm(linedev=%ld) Success)", port[index].ldev);
	printandlog(index, MISC, NULL, str);

	/* Some implementations do not reset (i.e. go on-hook) if line is off-hook at open time */
	if (gc_ResetLineDev(port[index].ldev, EV_ASYNC) != GC_SUCCESS) {
		sprintf(str, "gc_ResetLineDev(linedev=%ld, EV_ASYNC) Failed", port[index].ldev);
		printandlog(index, GC_APIERR, NULL, str);
		exitdemo(1);
	}

	port[index].resetlinedev_active = YES;
	sprintf(str, "gc_ResetLineDev(linedev=%ld, EV_ASYNC) Success", port[index].ldev);
	printandlog(index, GC_APICALL, NULL, str);
} /* End of Function */

/****************************************************************
*			NAME: gc_demo_open_E1orT1_channel(index)
* DESCRIPTION: initialize a port used by an E1 or T1 protocol
*		  INPUT: index into port[] for this channel
*		RETURNS: exits with exitdemo if not successful
*	  CAUTIONS: none
****************************************************************/
void gc_demo_open_E1orT1_channel(int index) 
{
	char		str[MAX_STRING_SIZE]; 

	printandlog(index, MISC, NULL, "E1 or T1 device being opened");

	/* initialize the flag blocked to YES */
	port[index].blocked = YES; 
	port[index].techtype = E1ORT1;
	port[index].call_state = GCST_NULL;
	port[index].makecall_timeout = 60;							/* Use 1 minute */
	
	if (gc_OpenEx(&port[index].ldev, port[index].devname, EV_SYNC, (void *)&port[index]) != GC_SUCCESS) {
		sprintf(str, "gc_OpenEx(devicename=%s, mode=EV_SYNC) Failed", port[index].devname);
		printandlog(index, GC_APIERR, NULL, str);
		exitdemo(1);
	}
	
	sprintf(str, "gc_OpenEx(devicename=%s, mode=EV_SYNC) Success", port[index].devname);
	printandlog(index, GC_APICALL, NULL, str);

	set_calling_num(&port[index], "7654321");

} /* End of function */

/****************************************************************
*			NAME: gc_demo_open_ss7_channel(index)
* DESCRIPTION: initialize a port used by an SS7 protocol
*		  INPUT: index into port[] for this channel
*		RETURNS: exits with exitdemo if not successful
*	  CAUTIONS: none
****************************************************************/
void gc_demo_open_ss7_channel(int index)
{
	char		str[MAX_STRING_SIZE];
	

	printandlog(index, MISC, NULL, "SS7 device being opened");

	/* initialize the flag blocked to YES */
	port[index].blocked = YES; 
	port[index].techtype = SS7;
	port[index].call_state = GCST_NULL;
	port[index].makecall_timeout = 60;							/* timeout is supported, try 1 minute */
	
	/* 
	NOTE:
	The SS7 MakeCallBlock is not initialized currently, as Gc_MakeCallBlk->cclib is set to 
	Null to use default values. For Live Testing, initialize the SS7MakeCallBlock and set 
	its address to Gc_MakeCallBlk->cclib field.
	*/
	if (gc_OpenEx(&port[index].ldev, port[index].devname, EV_SYNC, (void *)&port[index]) != GC_SUCCESS) {
		sprintf(str, "gc_OpenEx(devicename=%s, mode=EV_SYNC) Failed", port[index].devname);
		printandlog(index, GC_APIERR, NULL, str);
		exitdemo(1);
	}
	
	sprintf(str, "gc_OpenEx(devicename=%s, mode=EV_SYNC) Success", port[index].devname);
	printandlog(index, GC_APICALL, NULL, str);

	set_calling_num(&port[index], "7654321");
} /* End of function */ 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品噜噜噜成人av农村| 精品一区二区三区香蕉蜜桃| 久久综合五月天婷婷伊人| 欧美日韩国产高清一区二区| 色婷婷国产精品| 欧美性大战久久久久久久| 色天天综合久久久久综合片| 91国内精品野花午夜精品| 欧美体内she精视频| 91精品国产乱| 久久天堂av综合合色蜜桃网| 国产香蕉久久精品综合网| 中文字幕在线观看不卡| 中文字幕一区二区三| 亚洲黄色性网站| 日韩综合一区二区| 久久99久久99精品免视看婷婷| 国产在线精品不卡| 成人激情午夜影院| 欧美日韩在线播放三区四区| 777午夜精品免费视频| 精品久久久久久久久久久久久久久久久| 日韩视频一区二区三区| 国产欧美日韩视频一区二区| 亚洲一区二区在线播放相泽| 五月天婷婷综合| 国产传媒欧美日韩成人| 欧美午夜一区二区三区免费大片| 日韩无一区二区| 国产精品久久三| 秋霞午夜av一区二区三区| 国产乱码精品一品二品| 欧美在线观看18| 久久女同精品一区二区| 婷婷久久综合九色综合绿巨人 | 国产精品高潮久久久久无| 亚洲美女精品一区| 麻豆91小视频| 91热门视频在线观看| 欧美一区二区精品在线| 一区二区三区在线免费观看| 老司机精品视频导航| 色婷婷综合激情| 久久精品人人做人人综合 | 欧美喷水一区二区| 日本一区二区动态图| 琪琪一区二区三区| 色婷婷综合视频在线观看| 国产婷婷色一区二区三区| 蜜桃视频一区二区| 精品视频在线免费观看| 最新热久久免费视频| 国产高清不卡一区二区| 日韩午夜在线观看| 日本午夜精品视频在线观看 | 美女www一区二区| 在线免费视频一区二区| 国产精品大尺度| 成人性视频网站| 久久久不卡网国产精品二区 | 风间由美一区二区av101| 日韩欧美在线观看一区二区三区| 尤物在线观看一区| 91亚洲男人天堂| 国产精品免费观看视频| 成人性视频免费网站| 国产日韩欧美不卡| 国产99精品国产| 国产片一区二区三区| 国产成人在线网站| 久久久久久久久久看片| 精品在线播放免费| 久久综合一区二区| 国产精品资源在线| 国产精品二三区| 在线观看中文字幕不卡| 亚洲免费av观看| 欧美日本精品一区二区三区| 日韩中文字幕1| 欧美一级片在线| 激情文学综合插| 国产清纯白嫩初高生在线观看91| 成人国产精品视频| 亚洲精品中文在线影院| 欧美在线观看一区| 爽好久久久欧美精品| 日韩欧美一二三四区| 狠狠色丁香九九婷婷综合五月| 日韩一区二区三区四区五区六区| 蜜臀a∨国产成人精品| 久久精品水蜜桃av综合天堂| youjizz久久| 亚洲综合激情另类小说区| 欧美日韩精品一区二区天天拍小说| 天堂久久久久va久久久久| 欧美一卡在线观看| 成人国产精品免费观看动漫| 亚洲一区二区三区影院| 日韩一区二区三区免费看| 国产精品一品二品| 亚洲伊人伊色伊影伊综合网| 91精品欧美福利在线观看| 国产麻豆精品theporn| 亚洲色图都市小说| 欧美一区二区三区四区五区 | 一区二区在线看| 欧美一级xxx| 91麻豆国产福利在线观看| 五月天国产精品| 国产欧美一区二区三区在线看蜜臀 | 午夜av电影一区| 国产丝袜欧美中文另类| 欧美在线观看18| 国产酒店精品激情| 亚洲午夜影视影院在线观看| 久久婷婷国产综合国色天香| 欧美优质美女网站| 国产精品自在欧美一区| 香蕉成人啪国产精品视频综合网| 欧美精品在线观看一区二区| 高清国产午夜精品久久久久久| 亚洲不卡一区二区三区| 国产欧美一区二区精品秋霞影院 | 成人免费黄色在线| 三级精品在线观看| 一区二区在线观看不卡| 久久久久久**毛片大全| 制服.丝袜.亚洲.另类.中文 | 亚洲电影你懂得| 亚洲欧美偷拍卡通变态| 欧美精品一区二区三区高清aⅴ| 一本色道久久综合亚洲aⅴ蜜桃| 国产一区二区精品在线观看| 视频一区二区中文字幕| 亚洲精品免费播放| 最新欧美精品一区二区三区| 国产欧美日韩精品a在线观看| 91麻豆精品国产自产在线观看一区| 成人av电影在线观看| 国产一区二区久久| 国产老妇另类xxxxx| 狠狠色综合日日| 麻豆极品一区二区三区| 久色婷婷小香蕉久久| 日韩avvvv在线播放| 天天亚洲美女在线视频| 五月天婷婷综合| 日韩电影免费一区| 久久电影网电视剧免费观看| 九九九久久久精品| 黑人巨大精品欧美黑白配亚洲| 老汉av免费一区二区三区| 久久99精品一区二区三区三区| 美女视频一区二区| 久久精品999| 国产一区二区精品久久91| 国产精品伊人色| 丁香六月久久综合狠狠色| 丁香另类激情小说| 91美女在线视频| 色欧美88888久久久久久影院| 91免费视频大全| 欧美午夜电影在线播放| 欧美肥妇bbw| 久久综合久久综合久久| 欧美国产97人人爽人人喊| 亚洲三级在线看| 亚洲一级在线观看| 久久国产精品露脸对白| 国产毛片精品视频| 99麻豆久久久国产精品免费优播| 91精品福利视频| 在线不卡的av| 久久久久九九视频| 亚洲精品国产a| 秋霞电影网一区二区| 韩国v欧美v日本v亚洲v| 成人动漫一区二区三区| 欧美日韩高清不卡| 精品国产乱码久久久久久牛牛| 国产三级欧美三级| 亚洲精品国产视频| 激情综合色综合久久| 在线免费不卡视频| 精品国产伦一区二区三区免费| 中文字幕一区二区5566日韩| 亚洲aⅴ怡春院| 国产精品99久久久久久久女警| 99re亚洲国产精品| 精品蜜桃在线看| 一区二区三区高清不卡| 九色|91porny| 欧美日韩午夜影院| 国产精品国产自产拍高清av| 日韩电影在线观看网站| 一道本成人在线| 国产日韩欧美一区二区三区乱码 | 亚洲欧美色图小说| 国产一区二区精品久久91| 精品污污网站免费看|