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

Forum Post: RE: The demo have not received Unbolock event

$
0
0
Thanks Jeff. I have already do as you say,  The PABX  config as T1 -B8ZS,ESF ANSI. The log have not show any error , but still have not text message in telephone.Please you help me see the below code: // Open device static void gc_demo_open_E1orT1_channel(int index) { char str[MAX_STRING_SIZE]; printandlog(index, MISC, NULL, "E1 or T1 device being opened", 0); /* Initial channel state is blocked */ port[index].blocked = YES; port[index].techtype = E1ORT1_CAS; 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, 0); exitdemo(1); } sprintf(str, "gc_OpenEx(devicename=%s, mode=EV_SYNC) Success", port[index].devname); printandlog(index, GC_APICALL, NULL, str, 0); }  //Make Call static void makecall(int index) { char str[MAX_STRING_SIZE]; struct channel *pline; GC_MAKECALL_BLK makecallblkp; /* Variable for MAKECALL block */ char *numberstr; pline = &port[index]; numberstr = "1001"; if (pline- makecall_active == YES) { sprintf(str, "gc_demo_makecall pline- makecall_active =%d, ", pline- makecall_active); printandlog(index, MISC, NULL, str, 0); return; } /*Start gc_SetInfoElem*/ GC_IE_BLK gcIeBlk; IE_BLK ieBlk; gcIeBlk.gclib = NULL; gcIeBlk.cclib = &ieBlk; InitIEBlk(&ieBlk); if (gc_SetInfoElem(pline- ldev, &gcIeBlk) 0 ) { printandlog(index, GC_APICALL, NULL, "gc_SetInfoElem failed", 0); } printandlog(index, GC_APICALL, NULL, "gc_SetInfoElem success", 0); /*End gc_SetInfoElem*/ /*Start gc_MakeCall*/ GCLIB_MAKECALL_BLK *gclib_makecallp; GC_PARM_BLKP parmblkp = NULL; gc_util_insert_parm_val(&parmblkp, GCIS_SET_BEARERCHNL, GCIS_PARM_TRANSFERMODE,sizeof(int), ISDN_ITM_CIRCUIT); 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", 0); exitdemo(1); } makecallblkp.cclib = NULL; makecallblkp.gclib = gclib_makecallp; gclib_makecallp- ext_datap = parmblkp; gclib_makecallp- destination.address_plan = GCADDRPLAN_ISDN;// GCADDRPLAN_UNKNOWN; gclib_makecallp- destination.address_type = GCADDRTYPE_NAT;// GCADDRTYPE_TRANSPARENT; gclib_makecallp- destination.sub_address[0] = '\x0'; gclib_makecallp- destination.sub_address_plan = 0; gclib_makecallp- destination.sub_address_type = 0; strcpy(gclib_makecallp- origination.address, "1002"); gclib_makecallp- origination.address_plan = GCADDRPLAN_ISDN;// GCADDRPLAN_UNKNOWN; gclib_makecallp- origination.address_type = GCADDRTYPE_TRANSPARENT; gclib_makecallp- origination.sub_address[0] = '\x0'; gclib_makecallp- origination.sub_address_plan = 0; gclib_makecallp- origination.sub_address_type = 0; gclib_makecallp- call_info.address_info = GCADDRINFO_ENBLOC; /*End gc_MakeCall*/ printandlog(index, GC_APICALL, NULL, "Start Make call", 0); if (gc_MakeCall(pline- ldev, &pline- call[0].crn, numberstr, &makecallblkp, pline- makecall_timeout, EV_ASYNC) == GC_SUCCESS) { 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, 0); Sleep(5 * 1000); } } //InitIEBlk static void InitIEBlk(IE_BLK *ie_blk_ptr) { ie_blk_ptr- length = 6; /* 6 bytes of data */ /* The IE header */ ie_blk_ptr- data[0] = 0x7E; ie_blk_ptr- data[1] = 0x04; /* the length of IE data */ ie_blk_ptr- data[2] = 'C'; ie_blk_ptr- data[3] = 'a'; ie_blk_ptr- data[4] = 'M'; ie_blk_ptr- data[5] = 'S'; }; The Log as below: 05/13 15:36:51.647 [GC_APICALL]: gc_Start(startp = NULL) Success 05/13 15:36:51.647 [MISC]: E1 or T1 device being opened 05/13 15:36:51.855 [GC_APICALL]: gc_OpenEx(devicename=:N_dtiB1T1:P_DM3:V_dxxxB1C1, mode=EV_SYNC) Success 05/13 15:36:51.857 [MISC]: gc_SetCallingNum(linedev=4, phone_num = 1002) Success 05/13 15:36:51.965 [MISC]: ********* Received a GC event ********* 05/13 15:36:51.965 [EVENT]: GCEV_UNBLOCKED 05/13 15:36:51.965 [STATE]: GCST_NULL is the current GC call state 05/13 15:36:51.965 [MISC]: gc_demo_makecall pline- makecall_time =1, pline- intercall_time =0, 05/13 15:36:51.965 [STATE]: GCST_NULL is the new GC call state after processing the event 05/13 15:36:51.965 [GC_APICALL]: gc_SetInfoElem success 05/13 15:36:51.967 [GC_APICALL]: Start Make call 05/13 15:36:51.967 [GC_APICALL]: gc_MakeCall(linedev=4, numberstr=1001, mode=EV_ASYNC) Success Thanks Franks

Viewing all articles
Browse latest Browse all 1888

Trending Articles



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