[asterisk-commits] branch mattf/asterisk-ss7 r37797 - in /team/mattf/asterisk-ss7: ./ build_tool...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Jul 17 11:09:18 MST 2006


Author: mattf
Date: Mon Jul 17 13:09:17 2006
New Revision: 37797

URL: http://svn.digium.com/view/asterisk?rev=37797&view=rev
Log:
Add in updates for chan_zap integration with libss7

Modified:
    team/mattf/asterisk-ss7/build_tools/menuselect-deps.in
    team/mattf/asterisk-ss7/channels/chan_zap.c
    team/mattf/asterisk-ss7/configure.ac
    team/mattf/asterisk-ss7/include/asterisk/autoconfig.h.in
    team/mattf/asterisk-ss7/makeopts.in

Modified: team/mattf/asterisk-ss7/build_tools/menuselect-deps.in
URL: http://svn.digium.com/view/asterisk/team/mattf/asterisk-ss7/build_tools/menuselect-deps.in?rev=37797&r1=37796&r2=37797&view=diff
==============================================================================
--- team/mattf/asterisk-ss7/build_tools/menuselect-deps.in (original)
+++ team/mattf/asterisk-ss7/build_tools/menuselect-deps.in Mon Jul 17 13:09:17 2006
@@ -17,6 +17,7 @@
 PGSQL=@PBX_PGSQL@
 POPT=@PBX_POPT@
 PRI=@PBX_PRI@
+SS7=@PBX_SS7@
 QT=@PBX_QT@
 RADIUS=@PBX_RADIUS@
 SPEEX=@PBX_SPEEX@

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=37797&r1=37796&r2=37797&view=diff
==============================================================================
--- team/mattf/asterisk-ss7/channels/chan_zap.c (original)
+++ team/mattf/asterisk-ss7/channels/chan_zap.c Mon Jul 17 13:09:17 2006
@@ -41,6 +41,7 @@
 	<depend>zaptel</depend>
 	<depend>tonezone</depend>
 	<use>pri</use>
+	<use>ss7</use>
  ***/
 
 #include "asterisk.h"
@@ -69,6 +70,10 @@
 
 #ifdef HAVE_PRI
 #include <libpri.h>
+#endif
+
+#ifdef HAVE_SS7
+#include <libss7.h>
 #endif
 
 #include "asterisk/lock.h"
@@ -158,6 +163,9 @@
 #ifdef HAVE_PRI
                " w/PRI"
 #endif
+#ifdef HAVEL_LIBSS7
+	       "w/SS7"
+#endif
 ;
 
 static const char config[] = "zapata.conf";
@@ -178,6 +186,7 @@
 #define SIG_FXOGS	ZT_SIG_FXOGS
 #define SIG_FXOKS	ZT_SIG_FXOKS
 #define SIG_PRI		ZT_SIG_CLEAR
+#define SIG_SS7		(0x1000000 | ZT_SIG_CLEAR)
 #define	SIG_SF		ZT_SIG_SF
 #define SIG_SFWINK 	(0x0100000 | ZT_SIG_SF)
 #define SIG_SF_FEATD	(0x0200000 | ZT_SIG_SF)
@@ -400,6 +409,28 @@
 struct zt_pvt;
 
 static int ringt_base = DEFAULT_RINGT;
+
+#ifdef HAVE_SS7
+struct zt_ss7 {
+	pthread_t master;						/*!< Thread of master */
+	ast_mutex_t lock;
+	int fds[NUM_DCHANS];
+	int numsigchans;
+	int inalarm[NUM_DCHANS];
+	int numchans;
+	struct ss7 *ss7;
+	struct zt_pvt *pvts[MAX_CHANNELS];				/*!< Member channel pvt structs */
+};
+
+static struct zt_ss7 linksets[NUM_SPANS];
+
+static int cur_ss7type = -1;
+static int cur_linkset = -1;
+static int cur_pointcode = -1;
+static int cur_cicbeginswith = -1;
+static int cur_adjpointcode = -1;
+static int cur_networkindicator = -1;
+#endif /* HAVE_SS7 */
 
 #ifdef HAVE_PRI
 
@@ -689,6 +720,10 @@
 #endif	
 	int polarity;
 	int dsp_features;
+#ifdef HAVE_SS7
+	struct zt_ss7 *ss7;
+	int cic;							/*!< CIC associated with channel */
+#endif
 } *iflist = NULL, *ifend = NULL;
 
 static struct ast_channel *zt_request(const char *type, int format, void *data, int *cause);
@@ -1147,6 +1182,8 @@
 		return "FXO Kewlstart";
 	case SIG_PRI:
 		return "PRI Signalling";
+	case SIG_SS7:
+		return "SS7 Signalling";
 	case SIG_SF:
 		return "SF (Tone) Signalling Immediate";
 	case SIG_SFWINK:
@@ -3664,7 +3701,7 @@
 								"Alarm: %s\r\n"
 								"Channel: %d\r\n",
 								alarm2str(res), p->channel);
-#ifdef HAVE_LIBPRI
+#ifdef HAVE_PRI
 			if (!p->pri || !p->pri->pri || pri_get_timer(p->pri->pri, PRI_TIMER_T309) < 0) {
 				/* fall through intentionally */
 			} else {
@@ -6941,6 +6978,16 @@
 
 #endif
 
+#ifdef HAVE_SS7
+static struct zt_ss7 * ss7_resolve_linkset(int linkset)
+{
+	if ((linkset < 0) || (linkset >= NUM_SPANS))
+		return NULL;
+	else
+		return &linksets[linkset - 1];
+}
+#endif /* HAVE_SS7 */
+
 static struct zt_pvt *mkintf(int channel, int signalling, int outsignalling, int radio, struct zt_pri *pri, int reloading)
 {
 	/* Make a zt_pvt structure for this interface (or CRV if "pri" is specified) */
@@ -7034,6 +7081,34 @@
 					return NULL;
 				}
 			}
+#ifdef HAVE_SS7
+			if (signalling == SIG_SS7) {
+				struct zt_ss7 *ss7;
+				int clear = 0;
+				if (ioctl(tmp->subs[SUB_REAL].zfd, ZT_AUDIOMODE, &clear)) {
+					ast_log(LOG_ERROR, "Unable to set clear mode on clear channel %d of span %d: %s\n", channel, p.spanno, strerror(errno));
+					destroy_zt_pvt(&tmp);
+					return NULL;
+				}
+
+				ss7 = ss7_resolve_linkset(cur_linkset);
+				if (!ss7) {
+					ast_log(LOG_ERROR, "Unable to find linkset %d\n", cur_linkset);
+					destroy_zt_pvt(&tmp);
+					return NULL;
+				}
+				if (cur_cicbeginswith < 0) {
+					ast_log(LOG_ERROR, "Need to set cicbeginswith for the channels!\n");
+					destroy_zt_pvt(&tmp);
+					return NULL;
+				}
+
+				tmp->cic = cur_cicbeginswith++;
+
+				tmp->ss7 = ss7;
+				ss7->pvts[ss7->numchans++] = tmp;
+			}
+#endif
 #ifdef HAVE_PRI
 			if ((signalling == SIG_PRI) || (signalling == SIG_GR303FXOKS) || (signalling == SIG_GR303FXSKS)) {
 				int offset;
@@ -7782,6 +7857,207 @@
 	return tmp;
 }
 
+#ifdef HAVE_SS7
+static void *ss7_linkset(void *data)
+{
+	int res, i;
+	struct timeval *next = NULL, tv;
+	struct zt_ss7 *linkset = (struct zt_ss7 *) data;
+	struct ss7 *ss7 = linkset->ss7;
+	ss7_event *e = NULL;
+	struct pollfd pollers[NUM_DCHANS];
+	int nextms = 0;
+
+	ss7_start(ss7);
+
+	while(1) {
+		ast_mutex_lock(&linkset->lock);
+		if ((next = ss7_schedule_next(ss7))) {
+			gettimeofday(&tv, NULL);
+			tv.tv_sec = next->tv_sec - tv.tv_sec;
+			tv.tv_usec = next->tv_usec - tv.tv_usec;
+			if (tv.tv_usec < 0) {
+				tv.tv_usec += 1000000;
+				tv.tv_sec -= 1;
+			}
+			if (tv.tv_sec < 0) {
+				tv.tv_sec = 0;
+				tv.tv_usec = 0;
+			}
+			nextms = tv.tv_sec * 1000;
+			nextms += tv.tv_usec / 1000;
+		}
+		ast_mutex_unlock(&linkset->lock);
+
+		for (i = 0; i < linkset->numsigchans; i++) {
+			pollers[i].fd = linkset->fds[i];
+			pollers[i].events = POLLIN | POLLOUT | POLLPRI;
+			pollers[i].revents = 0;
+		}
+
+		res = poll(pollers, linkset->numsigchans, nextms);
+		if (res < 0) {
+			ast_log(LOG_ERROR, "poll(%s)\n", strerror(errno));
+		} else if (!res) {
+			ast_mutex_lock(&linkset->lock);
+			ss7_schedule_run(ss7);
+			ast_mutex_unlock(&linkset->lock);
+			continue;
+		}
+
+		ast_mutex_lock(&linkset->lock);
+		for (i = 0; i < linkset->numsigchans; i++) {
+			if (pollers[i].revents & POLLPRI) {
+				int x;
+				if (ioctl(pollers[i].fd, ZT_GETEVENT, &x)) {
+					ast_log(LOG_ERROR, "Error in exception retrieval!\n");
+				}
+				switch (x) {
+				case ZT_EVENT_OVERRUN:
+					ast_log(LOG_ERROR, "Overrun detected!\n");
+					break;
+				case ZT_EVENT_BADFCS:
+					ast_log(LOG_ERROR, "Bad FCS!\n");
+					break;
+				case ZT_EVENT_ABORT:
+					ast_log(LOG_ERROR, "HDLC Abort!\n");
+					break;
+				default:
+					ast_log(LOG_ERROR, "Got exception %d!\n", x);
+					break;
+				}
+			}
+
+			if (pollers[i].revents & POLLIN)
+				res = ss7_read(ss7, pollers[i].fd);
+			if (pollers[i].revents & POLLOUT) {
+				res = ss7_write(ss7, pollers[i].fd);
+				if (res < 0) {
+					ast_log(LOG_ERROR, "Error in write %s", strerror(errno));
+				}
+			}
+		}
+
+#if 0
+		if (res < 0)
+			exit(-1);
+#endif
+
+		while ((e = ss7_check_event(ss7))) {
+			switch (e->e) {
+			case SS7_EVENT_UP:
+				ast_log(LOG_DEBUG, "--- SS7 Up ---\n");
+				break;
+			case MTP2_LINK_UP:
+				ast_log(LOG_DEBUG, "MTP2 link up\n");
+				break;
+			case SS7_EVENT_GRS:
+				ast_log(LOG_DEBUG, "Got GRS from cic %d to %d: Acknowledging\n", e->grs.startcic, e->grs.endcic);
+				isup_gra(ss7, e->grs.startcic, e->grs.endcic);
+				isup_grs(ss7, e->grs.startcic, e->grs.endcic);
+				break;
+			case SS7_EVENT_GRA:
+				ast_log(LOG_DEBUG, "Got GRA from cic %d to %d.\n", e->gra.startcic, e->gra.endcic);
+				break;
+			case SS7_EVENT_IAM:
+				struct zt_pvt *p;
+				ast_log(LOG_DEBUG, "Got IAM for cic %d and number %s\n", e->iam.cic, e->iam.called_party_num);
+				chanpos = ss7_find_cic(linkset);
+				if (chanpos < 0) {
+					ast_log(LOG_WARNING, "IAM on unconfigured CIC %d\n", e->iam.cic);
+					isup_rlc(ss7, e->iam.call);
+					break;
+				}
+				p = linkset->pvts[chanpos];
+				ast_mutex_lock(&p->lock);
+				if (p->owner) {
+					if (p->ss7call == e->iam.call) {
+						ast_mutex_unlock(&p->lock);
+						ast_log(LOG_WARNING, "Duplicate IAM requested on CIC %d\n", e->iam.cic);
+						break;
+					} else {
+						ast_mutex_unlock(&p->lock);
+						ast_log(LOG_WARNING, "Ring requested on CIC %d already in use!\n", e->iam.cic);
+						break;
+					}
+				}
+
+				p->ss7call = e->iam.call;
+				if (p->immediate) {
+					p->exten[0] = 's';
+					p->exten[1] = '\0';
+				} else if (!ast_strlen_zero(e->iam.called_party_num)) {
+					ast_copy_string(p->exten, e->iam.called_party_num, sizeof(p->exten));
+				} else
+					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;
+				/* Set DNID */
+				if (!ast_strlen_zero(e->iam.called_party_num))
+					ast_copy_string(p->dnid, e->iam.called_party_num, sizeof(p->exten));
+
+				if (ast_exists_extension(NULL, p->context, p->exten, 1, p->cid_num)) {
+					int law = ZT_LAW_ALAW;
+					
+					res = zt_setlaw(p->subs[SUB_REAL].zfd, law);
+					if (res < 0) 
+						ast_log(LOG_WARNING, "Unable to set law on channel %d\n", p->channel);
+					
+					isup_acm(ss7, e->iam.call);
+
+					ast_mutex_unlock(&linkset->lock);
+					c = zt_new(p, AST_STATE_RING, 1, SUB_REAL, law, e->iam.transcap);
+					ast_mutex_lock(&linkset->lock);
+					if (c)
+						ast_verbose(VERBOSE_PREFIX_3 "Accepting call to '%s' on CIC %d\n", p->exten, p->cic);
+					else
+						ast_log(LOW_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, PRI_CAUSE_UNALLOCATED);
+				}
+
+				ast_mutex_unlock(&p->lock);
+				break;
+			case SS7_EVENT_REL:
+				ast_log(LOG_DEBUG, "Got REL for cic %d\n", e->rel.cic);
+				isup_rlc(ss7, e->rel.call);
+				break;
+			case SS7_EVENT_ACM:
+				ast_log(LOG_DEBUG, "Got ACM for cic %d\n", e->acm.cic);
+				break;
+			case SS7_EVENT_ANM:
+				printf("Got ANM for cic %d\n", e->anm.cic);
+				isup_rel(ss7, e->anm.call, 16);
+				break;
+			case SS7_EVENT_RLC:
+				printf("Got RLC for cic %d\n", e->rlc.cic);
+				break;
+			default:
+				ast_log(LOG_DEBUG, "Unknown event %s\n", ss7_event2str(e->e));
+				break;
+			}
+		}
+		ast_mutex_unlock(&linkset->lock);
+	}
+
+	return 0;
+}
+
+static void zt_ss7_message(struct ss7 *ss7, char *s)
+{
+	ast_verbose("%s", s);
+}
+
+static void zt_ss7_error(struct ss7 *ss7, char *s)
+{
+	ast_log(LOG_ERROR, "%s", s);
+}
+#endif /* HAVE_SS7 */
 
 #ifdef HAVE_PRI
 static struct zt_pvt *pri_find_crv(struct zt_pri *pri, int crv)
@@ -9767,6 +10043,11 @@
 				if (tmp->slaves[x])
 					ast_cli(fd, "Slave Channel: %d\n", tmp->slaves[x]->channel);
 			}
+#ifdef HAVE_SS7
+			if (tmp->ss7) {
+				ast_cli(fd, "CIC: %d\n", tmp->cic);
+			}
+#endif
 #ifdef HAVE_PRI
 			if (tmp->pri) {
 				ast_cli(fd, "PRI Flags: ");
@@ -10187,16 +10468,138 @@
 		zt_close(pris[i].fds[i]);
 	}
 #endif
+#ifdef HAVE_SS7
+	for (i = 0; i < NUM_SPANS; i++) {
+		if (linksets[i].master && (linksets[i].master != AST_PTHREADT_NULL))
+			pthread_join(linksets[i].master, NULL);
+		zt_close(linksets[i].fds[i]);
+	}
+#endif /* HAVE_SS7 */
 	return 0;
 }
 
+static int linkset_addsigchan(int sigchan)
+{
+	struct zt_ss7 *link;
+	int res;
+	int curfd;
+	ZT_PARAMS p;
+	ZT_BUFFERINFO bi;
+	struct zt_spaninfo si;
+
+
+	link = ss7_resolve_linkset(cur_linkset);
+	if (!link) {
+		ast_log(LOG_ERROR, "Invalid linkset number.  Must be between 1 and %d\n", NUM_SPANS + 1);
+		return -1;
+	}
+
+	if (cur_ss7type < 0) {
+		ast_log(LOG_ERROR, "Unspecified or invalid ss7type\n");
+		return -1;
+	}
+
+	if (!link->ss7)
+		link->ss7 = ss7_new(cur_ss7type);
+
+	if (!link->ss7) {
+		ast_log(LOG_ERROR, "Can't create new SS7!\n");
+		return -1;
+	}
+
+	if (cur_pointcode < 0) {
+		ast_log(LOG_ERROR, "Unspecified pointcode!\n");
+		return -1;
+	} else
+		ss7_set_pc(link->ss7, cur_pointcode);
+
+	if (sigchan < 0) {
+		ast_log(LOG_ERROR, "Invalid sigchan!\n");
+		return -1;
+	} else {
+		if (link->numsigchans >= NUM_DCHANS) {
+			ast_log(LOG_ERROR, "Too many sigchans on linkset %d\n", cur_linkset);
+			return -1;
+		}
+		curfd = link->numsigchans;
+
+		link->fds[curfd] = open("/dev/zap/channel", O_RDWR, 0600);
+		if ((link->fds[curfd] < 0) || (ioctl(link->fds[curfd],ZT_SPECIFY,&sigchan) == -1)) {
+			ast_log(LOG_ERROR, "Unable to open SS7 sigchan %d (%s)\n", sigchan, strerror(errno));
+			return -1;
+		}
+		res = ioctl(link->fds[curfd], ZT_GET_PARAMS, &p);
+		if (res) {
+			zt_close(link->fds[curfd]);
+			link->fds[curfd] = -1;
+			ast_log(LOG_ERROR, "Unable to get parameters for sigchan %d (%s)\n", sigchan, strerror(errno));
+			return -1;
+		}
+		if ((p.sigtype != ZT_SIG_HDLCFCS) && (p.sigtype != ZT_SIG_HARDHDLC)) {
+			zt_close(link->fds[curfd]);
+			link->fds[curfd] = -1;
+			ast_log(LOG_ERROR, "sigchan %d is not in HDLC/FCS mode.  See /etc/zaptel.conf\n", sigchan);
+			return -1;
+		}
+
+		memset(&si, 0, sizeof(si));
+		res = ioctl(link->fds[curfd], ZT_SPANSTAT, &si);
+		if (res) {
+			zt_close(link->fds[curfd]);
+			link->fds[curfd] = -1;
+			ast_log(LOG_ERROR, "Unable to get span state for sigchan %d (%s)\n", sigchan, strerror(errno));
+		}
+
+		if (!si.alarms)
+			link->inalarm[curfd] = 0;
+		else
+			link->inalarm[curfd] = 1;
+
+		bi.txbufpolicy = ZT_POLICY_IMMEDIATE;
+		bi.rxbufpolicy = ZT_POLICY_IMMEDIATE;
+		bi.numbufs = 32;
+		bi.bufsize = 512;
+
+		if (ioctl(link->fds[curfd], ZT_SET_BUFINFO, &bi)) {
+			ast_log(LOG_ERROR, "Unable to set appropriate buffering on channel %d\n", sigchan);
+			zt_close(link->fds[curfd]);
+			link->fds[curfd] = -1;
+			return -1;
+		}
+
+		ss7_add_link(link->ss7, link->fds[curfd]);
+		
+		link->numsigchans++;
+	}
+
+	if (cur_adjpointcode < 0) {
+		ast_log(LOG_ERROR, "Unspecified adjpointcode!\n");
+		return -1;
+	} else {
+		ss7_set_default_dpc(link->ss7, cur_adjpointcode);
+		ss7_set_adjpc(link->ss7, link->fds[curfd], cur_adjpointcode);
+	}
+
+	if (cur_networkindicator < 0) {
+		ast_log(LOG_ERROR, "Invalid networkindicator!\n");
+		return -1;
+	} else
+		ss7_set_network_ind(link->ss7, cur_networkindicator);
+
+	return 0;
+}
+
 static int unload_module(void *mod)
 {
+	int y;
 #ifdef HAVE_PRI		
-	int y;
 	for (y = 0; y < NUM_SPANS; y++)
 		ast_mutex_destroy(&pris[y].lock);
 #endif
+#ifdef HAVE_SS7
+	for (y = 0; y < NUM_SPANS; y++)
+		ast_mutex_destroy(&linksets[y].lock);
+#endif /* HAVE_SS7 */
 	return __unload_module();
 }
 		
@@ -10695,6 +11098,11 @@
 					cur_radio = 0;
 					pritype = PRI_CPE;
 #endif
+#ifdef HAVE_SS7
+				} else if (!strcasecmp(v->value, "ss7")) {
+					cur_signalling = SIG_SS7;
+					cur_radio = 0;
+#endif
 				} else {
 					ast_log(LOG_ERROR, "Unknown signalling method '%s'\n", v->value);
 				}
@@ -10864,6 +11272,32 @@
 				facilityenable = ast_true(v->value);
 #endif /* PRI_GETSET_TIMERS */
 #endif /* HAVE_PRI */
+			} else if (!strcasecmp(v->name, "ss7type")) {
+				if (!strcasecmp(v->value, "itu")) {
+					cur_ss7type = SS7_ITU;
+				} else
+					ast_log(LOG_WARNING, "'%s' is an unknown ss7 switch type!\n", v->value);
+			} else if (!strcasecmp(v->name, "linkset")) {
+				cur_linkset = atoi(v->value);
+			} else if (!strcasecmp(v->name, "pointcode")) {
+				cur_pointcode = atoi(v->value);
+			} else if (!strcasecmp(v->name, "adjpointcode")) {
+				cur_adjpointcode = atoi(v->value);
+			} else if (!strcasecmp(v->name, "cicbeginswith")) {
+				cur_cicbeginswith = atoi(v->value);
+			} else if (!strcasecmp(v->name, "networkindicator")) {
+				if (!strcasecmp(v->value, "national"))
+					cur_networkindicator = SS7_NI_NAT;
+				else if (!strcasecmp(v->value, "international"))
+					cur_networkindicator = SS7_NI_INT;
+				else
+					cur_networkindicator = -1;
+			} else if (!strcasecmp(v->name, "sigchan")) {
+				int sigchan, res;
+				sigchan = atoi(v->value);
+				res = linkset_addsigchan(sigchan);
+				if (res < 0)
+					return -1;
 			} else if (!strcasecmp(v->name, "cadence")) {
 				/* setup to scan our argument */
 				int element_count, c[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
@@ -11034,6 +11468,17 @@
 		}
 	}
 #endif
+	if (!reload) {
+		for (x = 0; x < NUM_SPANS; x++) {
+			if (linksets[x].ss7) {
+				if (ast_pthread_create(&linksets[x].master, NULL, ss7_linkset, &linksets[x])) {
+					ast_log(LOG_ERROR, "Unable to start SS7 linkset on span %d\n", x + 1);
+					return -1;
+				} else if (option_verbose > 1)
+					ast_verbose(VERBOSE_PREFIX_2 "Starting SS7 linkset on span %d\n", x + 1);
+			}
+		}
+	}
 	/* And start the monitor for the first time */
 	restart_monitor();
 	return 0;
@@ -11042,9 +11487,9 @@
 static int load_module(void *mod)
 {
 	int res;
+	int y,i;
 
 #ifdef HAVE_PRI
-	int y,i;
 	memset(pris, 0, sizeof(pris));
 	for (y = 0; y < NUM_SPANS; y++) {
 		ast_mutex_init(&pris[y].lock);
@@ -11058,6 +11503,17 @@
 	ast_register_application(zap_send_keypad_facility_app, zap_send_keypad_facility_exec,
 			zap_send_keypad_facility_synopsis, zap_send_keypad_facility_descrip);
 #endif
+#ifdef HAVE_SS7
+	memset(linksets, 0, sizeof(linksets));
+	for (y = 0; y < NUM_SPANS; y++) {
+		ast_mutex_init(&linksets[y].lock);
+		linksets[y].master = AST_PTHREADT_NULL;
+		for (i = 0; i < NUM_DCHANS; i++)
+			linksets[y].fds[i] = -1;
+	}
+	ss7_set_error(zt_ss7_error);
+	ss7_set_message(zt_ss7_message);
+#endif /* HAVE_SS7 */
 	res = setup_zap(0);
 	/* Make sure we can register our Zap channel type */
 	if (res)

Modified: team/mattf/asterisk-ss7/configure.ac
URL: http://svn.digium.com/view/asterisk/team/mattf/asterisk-ss7/configure.ac?rev=37797&r1=37796&r2=37797&view=diff
==============================================================================
--- team/mattf/asterisk-ss7/configure.ac (original)
+++ team/mattf/asterisk-ss7/configure.ac Mon Jul 17 13:09:17 2006
@@ -213,6 +213,7 @@
 AST_EXT_LIB_SETUP([POPT], [popt], [popt])
 AST_EXT_LIB_SETUP([PGSQL], [PostgreSQL], [postgres])
 AST_EXT_LIB_SETUP([PRI], [ISDN PRI], [pri])
+AST_EXT_LIB_SETUP([SS7], [ISDN SS7], [ss7])
 AST_EXT_LIB_SETUP([PWLIB], [PWlib], [pwlib])
 AST_EXT_LIB_SETUP([QT], [Qt], [qt])
 AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius])
@@ -598,6 +599,8 @@
 AST_EXT_LIB_CHECK([POPT], [popt], [poptStrerror], [popt.h])
 
 AST_EXT_LIB_CHECK([PRI], [pri], [pri_call], [libpri.h])
+
+AST_EXT_LIB_CHECK([SS7], [ss7], [ss7_new], [libss7.h])
 
 PLATFORM_PTLIB="ptlib_${OSTYPE}_${MACHTYPE}_r"
 if test "${USE_PWLIB}" != "no"; then

Modified: team/mattf/asterisk-ss7/include/asterisk/autoconfig.h.in
URL: http://svn.digium.com/view/asterisk/team/mattf/asterisk-ss7/include/asterisk/autoconfig.h.in?rev=37797&r1=37796&r2=37797&view=diff
==============================================================================
--- team/mattf/asterisk-ss7/include/asterisk/autoconfig.h.in (original)
+++ team/mattf/asterisk-ss7/include/asterisk/autoconfig.h.in Mon Jul 17 13:09:17 2006
@@ -270,6 +270,9 @@
 /* Define to 1 if you have the `sqrt' function. */
 #undef HAVE_SQRT
 
+/* Define to indicate the ${SS7_DESCRIP} library */
+#undef HAVE_SS7
+
 /* Define to 1 if `stat' has the bug that it succeeds when given the
    zero-length file name argument. */
 #undef HAVE_STAT_EMPTY_STRING_BUG
@@ -508,12 +511,12 @@
    release 3. */
 #undef SETVBUF_REVERSED
 
-/* The size of `int', as computed by sizeof. */
+/* The size of a `int', as computed by sizeof. */
 #undef SIZEOF_INT
 
 /* If using the C implementation of alloca, define if you know the
    direction of stack growth for your system; otherwise it will be
-   automatically deduced at runtime.
+   automatically deduced at run-time.
 	STACK_DIRECTION > 0 => grows toward higher addresses
 	STACK_DIRECTION < 0 => grows toward lower addresses
 	STACK_DIRECTION = 0 => direction of growth unknown */
@@ -572,7 +575,7 @@
 /* Define to `int' if <sys/types.h> does not define. */
 #undef mode_t
 
-/* Define to `long int' if <sys/types.h> does not define. */
+/* Define to `long' if <sys/types.h> does not define. */
 #undef off_t
 
 /* Define to `int' if <sys/types.h> does not define. */
@@ -581,7 +584,7 @@
 /* Define to rpl_realloc if the replacement function should be used. */
 #undef realloc
 
-/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* Define to `unsigned' if <sys/types.h> does not define. */
 #undef size_t
 
 /* Define to `int' if <sys/types.h> doesn't define. */

Modified: team/mattf/asterisk-ss7/makeopts.in
URL: http://svn.digium.com/view/asterisk/team/mattf/asterisk-ss7/makeopts.in?rev=37797&r1=37796&r2=37797&view=diff
==============================================================================
--- team/mattf/asterisk-ss7/makeopts.in (original)
+++ team/mattf/asterisk-ss7/makeopts.in Mon Jul 17 13:09:17 2006
@@ -100,6 +100,9 @@
 PRI_INCLUDE=@PRI_INCLUDE@
 PRI_LIB=@PRI_LIB@
 
+SS7_INCLUDE=@SS7_INCLUDE@
+SS7_LIB=@SS7_LIB@
+
 PWLIB_INCLUDE=@PWLIB_INCLUDE@
 PWLIB_LIB=@PWLIB_LIB@
 



More information about the asterisk-commits mailing list