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

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

?? q931.c

?? This a software PBX driver
?? C
?? 第 1 頁 / 共 5 頁
字號:
	q931_call *cur, *prev;	prev = NULL;	cur = *pri->callpool;	while(cur) {		if ((c && (cur == c)) || (!c && (cur->cr == cr))) {			if (prev)				prev->next = cur->next;			else				*pri->callpool = cur->next;			if (pri->debug & PRI_DEBUG_Q931_STATE)				pri_message("NEW_HANGUP DEBUG: Destroying the call, ourstate %s, peerstate %s\n",callstate2str(cur->ourcallstate),callstate2str(cur->peercallstate));			if (cur->retranstimer)				pri_schedule_del(pri, cur->retranstimer);			free(cur);			return;		}		prev = cur;		cur = cur->next;	}	pri_error("Can't destroy call %d!\n", cr);}static void q931_destroycall(struct pri *pri, int cr){	return q931_destroy(pri, cr, NULL);}void __q931_destroycall(struct pri *pri, q931_call *c) {	if (pri && c)		q931_destroy(pri,0, c);	return;}static int add_ie(struct pri *pri, q931_call *call, int msgtype, int ie, q931_ie *iet, int maxlen, int *codeset){	unsigned int x;	int res;	int have_shift;	for (x=0;x<sizeof(ies) / sizeof(ies[0]);x++) {		if (ies[x].ie == ie) {			/* This is our baby */			if (ies[x].transmit) {				/* Prepend with CODE SHIFT IE if required */				if (*codeset != Q931_IE_CODESET(ies[x].ie)) {					/* Locking shift to codeset 0 isn't possible */					iet->ie = Q931_IE_CODESET(ies[x].ie) | (Q931_IE_CODESET(ies[x].ie) ? Q931_LOCKING_SHIFT : Q931_NON_LOCKING_SHIFT);					have_shift = 1;					iet = (q931_ie *)((char *)iet + 1);					maxlen--;				}				else					have_shift = 0;				iet->ie = ie;				res = ies[x].transmit(ie, pri, call, msgtype, iet, maxlen);				/* Error if res < 0 or ignored if res == 0 */				if (res <= 0)					return res;				if ((iet->ie & 0x80) == 0) /* Multibyte IE */					iet->len = res - 2;				if (have_shift) {					if (Q931_IE_CODESET(ies[x].ie))						*codeset = Q931_IE_CODESET(ies[x].ie);					return res + 1; /* Shift is single-byte IE */				}				return res;			} else {				pri_error("!! Don't know how to add an IE %s (%d)\n", ie2str(ie), ie);				return -1;			}		}	}	pri_error("!! Unknown IE %d (%s)\n", ie, ie2str(ie));	return -1;}static char *disc2str(int disc){	static struct msgtype discs[] = {		{ Q931_PROTOCOL_DISCRIMINATOR, "Q.931" },		{ GR303_PROTOCOL_DISCRIMINATOR, "GR-303" },		{ 0x3, "AT&T Maintenance" },		{ 0x43, "New AT&T Maintenance" },	};	return code2str(disc, discs, sizeof(discs) / sizeof(discs[0]));}void q931_dump(q931_h *h, int len, int txrx){	q931_mh *mh;	char c;	int x=0, r;	int cur_codeset;	int codeset;	c = txrx ? '>' : '<';	pri_message("%c Protocol Discriminator: %s (%d)  len=%d\n", c, disc2str(h->pd), h->pd, len);	pri_message("%c Call Ref: len=%2d (reference %d/0x%X) (%s)\n", c, h->crlen, q931_cr(h), q931_cr(h), (h->crv[0] & 0x80) ? "Terminator" : "Originator");	/* Message header begins at the end of the call reference number */	mh = (q931_mh *)(h->contents + h->crlen);	pri_message("%c Message type: %s (%d)\n", c, msg2str(mh->msg), mh->msg);	/* Drop length of header, including call reference */	len -= (h->crlen + 3);	codeset = cur_codeset = 0;	while(x < len) {		r = ielen((q931_ie *)(mh->data + x));		q931_dumpie(cur_codeset, (q931_ie *)(mh->data + x), c);		switch (mh->data[x] & 0xf8) {		case Q931_LOCKING_SHIFT:			if ((mh->data[x] & 7) > 0)				codeset = cur_codeset = mh->data[x] & 7;			break;		case Q931_NON_LOCKING_SHIFT:			cur_codeset = mh->data[x] & 7;			break;		default:			/* Reset temporary codeset change */			cur_codeset = codeset;		}		x += r;	}	if (x > len) 		pri_error("XXX Message longer than it should be?? XXX\n");}static int q931_handle_ie(int codeset, struct pri *pri, q931_call *c, int msg, q931_ie *ie){	unsigned int x;	int full_ie = Q931_FULL_IE(codeset, ie->ie);	if (pri->debug & PRI_DEBUG_Q931_STATE)		pri_message("-- Processing IE %d (cs%d, %s)\n", ie->ie, codeset, ie2str(full_ie));	for (x=0;x<sizeof(ies) / sizeof(ies[0]);x++) {		if (full_ie == ies[x].ie) {			if (ies[x].receive)				return ies[x].receive(full_ie, pri, c, msg, ie, ielen(ie));			else {				if (pri->debug & PRI_DEBUG_Q931_ANOMALY)					pri_error("!! No handler for IE %d (cs%d, %s)\n", ie->ie, codeset, ie2str(full_ie));				return -1;			}		}	}	pri_message("!! Unknown IE %d (cs%d, %s)\n", ie->ie, codeset, ie2str(full_ie));	return -1;}static void init_header(struct pri *pri, q931_call *call, char *buf, q931_h **hb, q931_mh **mhb, int *len){	/* Returns header and message header and modifies length in place */	q931_h *h = (q931_h *)buf;	q931_mh * mh = (q931_mh *)(h->contents + 2);	h->pd = pri->protodisc;	h->x0 = 0;		/* Reserved 0 */	h->crlen = 2;	/* Two bytes of Call Reference.  Invert the top bit to make it from our sense */	if (call->cr || call->forceinvert) {		h->crv[0] = ((call->cr ^ 0x8000) & 0xff00) >> 8;		h->crv[1] = (call->cr & 0xff);	} else {		/* Unless of course this has no call reference */		h->crv[0] = 0;		h->crv[1] = 0;	}	if (pri->subchannel) {		/* On GR-303, top bit is always 0 */		h->crv[0] &= 0x7f;	}	mh->f = 0;	*hb = h;	*mhb = mh;	*len -= 5;	}static int q931_xmit(struct pri *pri, q931_h *h, int len, int cr){	q921_transmit_iframe(pri, h, len, cr);	/* The transmit operation might dump the q921 header, so logging the q931	   message body after the transmit puts the sections of the message in the	   right order in the log */	if (pri->debug & PRI_DEBUG_Q931_DUMP)		q931_dump(h, len, 1);#ifdef LIBPRI_COUNTERS	pri->q931_txcount++;#endif	return 0;}static int send_message(struct pri *pri, q931_call *c, int msgtype, int ies[]){	unsigned char buf[1024];	q931_h *h;	q931_mh *mh;	int len;	int res;	int offset=0;	int x;	int codeset;	memset(buf, 0, sizeof(buf));	len = sizeof(buf);	init_header(pri, c, buf, &h, &mh, &len);	mh->msg = msgtype;	x=0;	codeset = 0;	while(ies[x] > -1) {		res = add_ie(pri, c, mh->msg, ies[x], (q931_ie *)(mh->data + offset), len, &codeset);		if (res < 0) {			pri_error("!! Unable to add IE '%s'\n", ie2str(ies[x]));			return -1;		}		offset += res;		len -= res;		x++;	}	/* Invert the logic */	len = sizeof(buf) - len;	q931_xmit(pri, h, len, 1);	c->acked = 1;	return 0;}static int status_ies[] = { Q931_CAUSE, Q931_CALL_STATE, -1 };static int q931_status(struct pri *pri, q931_call *c, int cause){	q931_call *cur = NULL;	if (!cause)		cause = PRI_CAUSE_RESPONSE_TO_STATUS_ENQUIRY;	if (c->cr > -1)		cur = *pri->callpool;	while(cur) {		if (cur->cr == c->cr) {			cur->cause=cause;			cur->causecode = CODE_CCITT;			cur->causeloc = LOC_USER;			break;		}		cur = cur->next;	}	if (!cur) {		pri_message("YYY Here we get reset YYY\n");		/* something went wrong, respond with "no such call" */		c->ourcallstate = Q931_CALL_STATE_NULL;		c->peercallstate = Q931_CALL_STATE_NULL;		cur=c;	}	return send_message(pri, cur, Q931_STATUS, status_ies);}static int information_ies[] = { Q931_CALLED_PARTY_NUMBER, -1 };int q931_information(struct pri *pri, q931_call *c, char digit){	c->callednum[0]=digit;	c->callednum[1]='\0';	return send_message(pri, c, Q931_INFORMATION, information_ies);}static int restart_ack_ies[] = { Q931_CHANNEL_IDENT, Q931_RESTART_INDICATOR, -1 };static int restart_ack(struct pri *pri, q931_call *c){	c->ourcallstate = Q931_CALL_STATE_NULL;	c->peercallstate = Q931_CALL_STATE_NULL;	return send_message(pri, c, Q931_RESTART_ACKNOWLEDGE, restart_ack_ies);}static int notify_ies[] = { Q931_IE_NOTIFY_IND, -1 };int q931_notify(struct pri *pri, q931_call *c, int channel, int info){	if (info >= 0)		c->notify = info & 0x7F;	else		c->notify = -1;	return send_message(pri, c, Q931_NOTIFY, notify_ies);}#ifdef ALERTING_NO_PROGRESSstatic int call_progress_ies[] = { -1 };#elsestatic int call_progress_ies[] = { Q931_PROGRESS_INDICATOR, -1 };#endifint q931_call_progress(struct pri *pri, q931_call *c, int channel, int info){	if (channel) { 		c->ds1no = (channel & 0xff00) >> 8;		channel &= 0xff;		c->channelno = channel;			}	if (info) {		c->progloc = LOC_PRIV_NET_LOCAL_USER;		c->progcode = CODE_CCITT;		c->progress = Q931_PROG_INBAND_AVAILABLE;	} else		c->progress = -1;	c->alive = 1;	return send_message(pri, c, Q931_PROGRESS, call_progress_ies);}#ifdef ALERTING_NO_PROGRESSstatic int call_proceeding_ies[] = { Q931_CHANNEL_IDENT, -1 };#elsestatic int call_proceeding_ies[] = { Q931_CHANNEL_IDENT, Q931_PROGRESS_INDICATOR, -1 };#endifint q931_call_proceeding(struct pri *pri, q931_call *c, int channel, int info){	if (channel) { 		c->ds1no = (channel & 0xff00) >> 8;		channel &= 0xff;		c->channelno = channel;			}	c->chanflags &= ~FLAG_PREFERRED;	c->chanflags |= FLAG_EXCLUSIVE;	c->ourcallstate = Q931_CALL_STATE_INCOMING_CALL_PROCEEDING;	c->peercallstate = Q931_CALL_STATE_OUTGOING_CALL_PROCEEDING;	if (info) {		c->progloc = LOC_PRIV_NET_LOCAL_USER;		c->progcode = CODE_CCITT;		c->progress = Q931_PROG_INBAND_AVAILABLE;	} else		c->progress = -1;	c->proc = 1;	c->alive = 1;	return send_message(pri, c, Q931_CALL_PROCEEDING, call_proceeding_ies);}#ifndef ALERTING_NO_PROGRESSstatic int alerting_ies[] = { Q931_PROGRESS_INDICATOR, -1 };#elsestatic int alerting_ies[] = { -1 };#endifint q931_alerting(struct pri *pri, q931_call *c, int channel, int info){	if (!c->proc) 		q931_call_proceeding(pri, c, channel, 0);	if (info) {		c->progloc = LOC_PRIV_NET_LOCAL_USER;		c->progcode = CODE_CCITT;		c->progress = Q931_PROG_INBAND_AVAILABLE;	} else		c->progress = -1;	c->ourcallstate = Q931_CALL_STATE_CALL_RECEIVED;	c->peercallstate = Q931_CALL_STATE_CALL_DELIVERED;	c->alive = 1;	return send_message(pri, c, Q931_ALERTING, alerting_ies);}static int connect_ies[] = {  Q931_CHANNEL_IDENT, Q931_PROGRESS_INDICATOR, -1 }; int q931_setup_ack(struct pri *pri, q931_call *c, int channel, int nonisdn){	if (channel) { 		c->ds1no = (channel & 0xff00) >> 8;		channel &= 0xff;		c->channelno = channel;			}	c->chanflags &= ~FLAG_PREFERRED;	c->chanflags |= FLAG_EXCLUSIVE;	if (nonisdn && (pri->switchtype != PRI_SWITCH_DMS100)) {		c->progloc  = LOC_PRIV_NET_LOCAL_USER;		c->progcode = CODE_CCITT;		c->progress = Q931_PROG_CALLED_NOT_ISDN;	} else		c->progress = -1;	c->ourcallstate = Q931_CALL_STATE_OVERLAP_RECEIVING;	c->peercallstate = Q931_CALL_STATE_OVERLAP_SENDING;	c->alive = 1;	return send_message(pri, c, Q931_SETUP_ACKNOWLEDGE, connect_ies);}static void pri_connect_timeout(void *data){	struct q931_call *c = data;	struct pri *pri = c->pri;	if (pri->debug & PRI_DEBUG_Q931_STATE)		pri_message("Timed out looking for connect acknowledge\n");	q931_disconnect(pri, c, PRI_CAUSE_NORMAL_CLEARING);	}static void pri_release_timeout(void *data){	struct q931_call *c = data;	struct pri *pri = c->pri;	if (pri->debug & PRI_DEBUG_Q931_STATE)		pri_message("Timed out looking for release complete\n");	c->t308_timedout++;	c->alive = 1;	q931_release(pri, c, PRI_CAUSE_NORMAL_CLEARING);}static void pri_release_finaltimeout(void *data){	struct q931_call *c = data;	struct pri *pri = c->pri;	c->alive = 1;	if (pri->debug & PRI_DEBUG_Q931_STATE)		pri_message("Final time-out looking for release complete\n");	c->t308_timedout++;	c->ourcallstate = Q931_CALL_STATE_NULL;	c->peercallstate = Q931_CALL_STATE_NULL;	pri->schedev = 1;	pri->ev.e = PRI_EVENT_HANGUP_ACK;	pri->ev.hangup.channel = c->channelno;	pri->ev.hangup.cref = c->cr;	pri->ev.hangup.cause = c->cause;	pri->ev.hangup.call = c;	q931_hangup(pri, c, c->cause);}static void pri_disconnect_timeout(void *data){	struct q931_call *c = data;	struct pri *pri = c->pri;	if (pri->debug & PRI_DEBUG_Q931_STATE)		p

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色婷婷综合久色| av一二三不卡影片| 日本伊人精品一区二区三区观看方式| 日韩伦理av电影| 午夜视频一区在线观看| 亚洲高清一区二区三区| 另类欧美日韩国产在线| 丁香激情综合国产| 欧美美女一区二区在线观看| 日韩欧美一区二区久久婷婷| 国产人成亚洲第一网站在线播放| 国产精品私房写真福利视频| 日韩一区欧美二区| 91在线小视频| 国产精品欧美久久久久一区二区| 亚洲一区二区3| 91丨九色丨黑人外教| 欧美一区二区在线观看| 一区二区三区国产精品| 国产乱色国产精品免费视频| 欧美一区二区三区四区在线观看 | 亚洲一区二区影院| 国产成人精品影视| 国产婷婷色一区二区三区| 奇米四色…亚洲| 欧美天堂亚洲电影院在线播放| 国产三级精品三级在线专区| 麻豆中文一区二区| 欧美最猛性xxxxx直播| 亚洲乱码国产乱码精品精小说 | 久久精品欧美一区二区三区不卡| 日韩黄色免费电影| 日韩欧美一区二区不卡| 美女视频黄久久| 2020国产精品自拍| 国产99一区视频免费| 久久精品人人做| 成人蜜臀av电影| 夜夜揉揉日日人人青青一国产精品| 91理论电影在线观看| 亚洲中国最大av网站| 欧美一级久久久| 国产成人夜色高潮福利影视| 欧美韩日一区二区三区| 99热国产精品| 久久99在线观看| 国产精品美女久久久久久| 欧美怡红院视频| 国产高清成人在线| 丝瓜av网站精品一区二区| 国产欧美精品在线观看| 欧美区视频在线观看| 成人动漫精品一区二区| 丝瓜av网站精品一区二区| 国产精品美女一区二区三区 | 国产精品66部| 免费高清视频精品| 亚洲一区二区三区视频在线 | 91污在线观看| 国产成人精品影院| 国产河南妇女毛片精品久久久| 亚洲香肠在线观看| 一区av在线播放| 亚洲九九爱视频| 亚洲欧美另类小说| 一色屋精品亚洲香蕉网站| 久久婷婷久久一区二区三区| 色屁屁一区二区| heyzo一本久久综合| 国产精品亚洲午夜一区二区三区 | 色94色欧美sute亚洲线路一ni| 国产专区欧美精品| 国产在线精品视频| 成人丝袜视频网| 99国产精品久久久久| 色综合天天性综合| 在线观看亚洲精品视频| 一本一道波多野结衣一区二区| 成人sese在线| 在线免费av一区| 久久综合精品国产一区二区三区| 欧美国产精品一区二区三区| 国产精品视频一二三区| 亚洲国产一二三| 国产精品系列在线观看| 色综合亚洲欧洲| 日韩久久免费av| 亚洲精品v日韩精品| 91在线精品一区二区三区| 免费观看成人鲁鲁鲁鲁鲁视频| 国产精品一二三在| 欧美日韩一区二区在线观看视频 | 日韩免费高清视频| 亚洲欧洲综合另类| k8久久久一区二区三区| 久久久国产午夜精品 | 日本韩国欧美一区| 国产精品福利一区| 国产成人在线观看免费网站| 欧美日韩中字一区| 亚洲综合视频在线| 色综合天天综合网天天狠天天| 精品国产成人在线影院| 秋霞午夜鲁丝一区二区老狼| 欧美日韩亚洲综合在线| 亚洲午夜视频在线| 91精品国产综合久久久蜜臀粉嫩 | 国产欧美日产一区| 欧美人与z0zoxxxx视频| 91视频国产观看| 日韩三级免费观看| 国产精品久久久久久久久免费樱桃| 久久久国产一区二区三区四区小说| 日韩主播视频在线| 欧美一级生活片| 九九**精品视频免费播放| 欧美视频一区在线观看| 一区二区三区免费观看| 成人激情免费视频| 中文字幕精品综合| 成人性视频免费网站| 久久精品夜夜夜夜久久| 成人97人人超碰人人99| 一区二区激情小说| 制服丝袜亚洲播放| 国产麻豆9l精品三级站| 国产精品初高中害羞小美女文| 成人avav影音| 五月婷婷综合网| 欧美不卡视频一区| 在线精品观看国产| 国产精品一二三在| 午夜在线电影亚洲一区| 国产亚洲一区字幕| 日本韩国一区二区| 成人的网站免费观看| 久久精品国产亚洲5555| 午夜视频在线观看一区二区三区| 日韩欧美一级在线播放| 成人午夜激情片| 精品午夜久久福利影院 | 久久精品久久精品| 亚洲国产日韩一级| 亚洲精品五月天| 国产精品久久久爽爽爽麻豆色哟哟| 日韩欧美国产一区二区三区| 一本大道久久a久久综合婷婷| 韩国视频一区二区| 亚洲成人一区在线| 亚洲国产精品麻豆| 天天色天天爱天天射综合| 国产精品天天看| 久久蜜桃av一区二区天堂| 久久色在线视频| 国产亚洲一区字幕| 亚洲欧美日韩在线播放| 亚洲免费av在线| 亚洲精品视频在线看| 日韩精品一区第一页| 久久电影国产免费久久电影 | 91蝌蚪porny| 日韩欧美一区在线| 国产精品视频免费看| 亚洲影院免费观看| 激情综合网激情| 色婷婷av一区二区三区gif| 精品视频免费看| 久久久久免费观看| 国产免费观看久久| 亚洲精品成人天堂一二三| 丝袜诱惑制服诱惑色一区在线观看 | 国产成人免费9x9x人网站视频| 99国产精品一区| 国产精品久久久久毛片软件| 国产精品国产精品国产专区不蜜| 亚洲夂夂婷婷色拍ww47| 狠狠色伊人亚洲综合成人| 91亚洲精品乱码久久久久久蜜桃| 亚洲精品一区二区三区福利 | 国产精品一二三| 日韩视频永久免费| 午夜成人免费电影| 91久久人澡人人添人人爽欧美| 欧美精品一区二区三区高清aⅴ | 欧美日韩国产123区| 久久久久久久久久久久电影| 亚洲理论在线观看| 成人深夜在线观看| 国产精品久久午夜夜伦鲁鲁| 国产.欧美.日韩| 中文字幕一区不卡| 色综合网站在线| 亚洲图片欧美综合| 91麻豆精品国产91久久久使用方法 | 一区二区三区在线影院| 欧美影视一区二区三区| 亚洲欧美日韩国产综合| 99国产精品国产精品毛片| 成人免费在线视频| 欧洲色大大久久|