[asterisk-commits] mattf: branch mattf/asterisk-ss7 r38680 - /team/mattf/asterisk-ss7/channels/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Aug 1 13:35:34 MST 2006


Author: mattf
Date: Tue Aug  1 15:35:33 2006
New Revision: 38680

URL: http://svn.digium.com/view/asterisk?rev=38680&view=rev
Log:
Add callerid number support (tx and rx) as well as handle better error conditions.

Modified:
    team/mattf/asterisk-ss7/channels/chan_zap.c

Modified: team/mattf/asterisk-ss7/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/mattf/asterisk-ss7/channels/chan_zap.c?rev=38680&r1=38679&r2=38680&view=diff
==============================================================================
--- team/mattf/asterisk-ss7/channels/chan_zap.c (original)
+++ team/mattf/asterisk-ss7/channels/chan_zap.c Tue Aug  1 15:35:33 2006
@@ -2080,6 +2080,12 @@
 		else
 			c = dest;
 
+		if (!p->hidecallerid) {
+			l = ast->cid.cid_num;
+		} else {
+			l = NULL;
+		}
+
 		ss7_grab(p, p->ss7);
 		p->digital = IS_DIGITAL(ast->transfercapability);
 		p->ss7call = isup_new_call(p->ss7->ss7);
@@ -2091,7 +2097,7 @@
 			return -1;
 		}
 
-		isup_init_call(p->ss7call, p->cic, c + p->stripmsd);
+		isup_init_call(p->ss7call, p->cic, c + p->stripmsd, l);
 
 		isup_iam(p->ss7->ss7, p->ss7call);
 		ss7_rel(p->ss7);
@@ -8019,8 +8025,12 @@
 	struct ast_channel *c;
 	struct zt_pvt *p;
 	int chanpos;
+	pthread_attr_t attr;
 	struct pollfd pollers[NUM_DCHANS];
 	int nextms = 0;
+
+	pthread_attr_init(&attr);
+	pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 
 	ss7_start(ss7);
 
@@ -8118,7 +8128,7 @@
 				chanpos = ss7_find_cic(linkset, e->iam.cic);
 				if (chanpos < 0) {
 					ast_log(LOG_WARNING, "IAM on unconfigured CIC %d\n", e->iam.cic);
-					isup_rlc(ss7, e->iam.call);
+					isup_rel(ss7, e->iam.call, -1);
 					break;
 				}
 				p = linkset->pvts[chanpos];
@@ -8136,6 +8146,12 @@
 				}
 
 				p->ss7call = e->iam.call;
+
+				if (p->use_callerid)
+					ast_copy_string(p->cid_num, e->iam.calling_party_num, sizeof(p->cid_num));
+				else
+					p->cid_num[0] = 0;
+
 				if (p->immediate) {
 					p->exten[0] = 's';
 					p->exten[1] = '\0';
@@ -8149,7 +8165,6 @@
 					p->exten[0] = '\0';
 
 				/* Need to fill these fields */
-				p->cid_num[0] = '\0';
 				p->cid_ani[0] = '\0';
 				p->cid_name[0] = '\0';
 				p->cid_ton = 0;
@@ -8179,7 +8194,7 @@
 						ast_log(LOG_WARNING, "Unable to start PBX on CIC %d\n", p->cic);
 				} else {
 					ast_log(LOG_DEBUG, "Call on CIC for unconfigured extension %s\n", p->exten);
-					isup_rlc(ss7, e->iam.call);
+					isup_rel(ss7, e->iam.call, -1);
 				}
 
 				ast_mutex_unlock(&p->lock);
@@ -8188,7 +8203,6 @@
 				chanpos = ss7_find_cic(linkset, e->rel.cic);
 				if (chanpos < 0) {
 					ast_log(LOG_WARNING, "REL on unconfigured CIC %d\n", e->rel.cic);
-					isup_rlc(ss7, e->rel.call);
 					break;
 				}
 				p = linkset->pvts[chanpos];
@@ -8208,7 +8222,7 @@
 				chanpos = ss7_find_cic(linkset, e->acm.cic);
 				if (chanpos < 0) {
 					ast_log(LOG_WARNING, "ACM on unconfigured CIC %d\n", e->acm.cic);
-					isup_rlc(ss7, e->acm.call);
+					isup_rel(ss7, e->acm.call, -1);
 					break;
 				} else {
 					struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_PROCEEDING, };
@@ -8229,7 +8243,7 @@
 				chanpos = ss7_find_cic(linkset, e->anm.cic);
 				if (chanpos < 0) {
 					ast_log(LOG_WARNING, "ANM on unconfigured CIC %d\n", e->anm.cic);
-					isup_rlc(ss7, e->anm.call);
+					isup_rel(ss7, e->anm.call, -1);
 					break;
 				} else {
 					p = linkset->pvts[chanpos];



More information about the asterisk-commits mailing list