[asterisk-commits] branch jcollie/bug6082 r35698 - in /team/jcollie/bug6082: ./ apps/ build_tool...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Jun 23 06:57:14 MST 2006


Author: jcollie
Date: Fri Jun 23 08:57:14 2006
New Revision: 35698

URL: http://svn.digium.com/view/asterisk?rev=35698&view=rev
Log:
Merged revisions 35584,35605,35607-35608,35628-35630,35649-35650,35670 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r35584 | russell | 2006-06-22 19:24:12 -0500 (Thu, 22 Jun 2006) | 3 lines

delete the local copy of mxml and use svn:externals to get it from its own
repo since it is going to be used it more than one place now

................
r35605 | russell | 2006-06-22 20:29:41 -0500 (Thu, 22 Jun 2006) | 5 lines

remove various commands that remove old modules since they have been there a
sufficient amount of time.  Even if they happen to be still present, the main
Makefile will spit out a huge warning telling the user that modules not
installed by that run of "make install" are present in the modules directory.

................
r35607 | russell | 2006-06-22 20:50:55 -0500 (Thu, 22 Jun 2006) | 2 lines

add basic autoconf support for res_snmp

................
r35608 | russell | 2006-06-22 20:54:07 -0500 (Thu, 22 Jun 2006) | 2 lines

delete snmp/agent.o on make clean

................
r35628 | russell | 2006-06-22 21:03:21 -0500 (Thu, 22 Jun 2006) | 2 lines

reduce indentation

................
r35629 | russell | 2006-06-22 21:08:10 -0500 (Thu, 22 Jun 2006) | 2 lines

reduce indentation

................
r35630 | russell | 2006-06-22 21:15:35 -0500 (Thu, 22 Jun 2006) | 3 lines

remove the autom4te.cache dir on a "make distclean" and add distclean to the
.PHONY list

................
r35649 | kpfleming | 2006-06-23 03:15:48 -0500 (Fri, 23 Jun 2006) | 2 lines

very minor improvement

................
r35650 | kpfleming | 2006-06-23 03:32:19 -0500 (Fri, 23 Jun 2006) | 2 lines

remove any generated doxygen docs during distclean

................
r35670 | bweschke | 2006-06-23 06:33:02 -0500 (Fri, 23 Jun 2006) | 11 lines

Merged revisions 35669 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r35669 | bweschke | 2006-06-23 06:30:17 -0500 (Fri, 23 Jun 2006) | 3 lines

 We should lock the queue before we go making changes to member interface statuses.


........

................

Removed:
    team/jcollie/bug6082/mxml/
Modified:
    team/jcollie/bug6082/   (props changed)
    team/jcollie/bug6082/Makefile
    team/jcollie/bug6082/apps/Makefile
    team/jcollie/bug6082/apps/app_queue.c
    team/jcollie/bug6082/build_tools/menuselect-deps.in
    team/jcollie/bug6082/channels/chan_iax2.c
    team/jcollie/bug6082/channels/chan_zap.c
    team/jcollie/bug6082/configure
    team/jcollie/bug6082/configure.ac
    team/jcollie/bug6082/funcs/Makefile
    team/jcollie/bug6082/makeopts.in
    team/jcollie/bug6082/res/Makefile
    team/jcollie/bug6082/res/res_snmp.c

Propchange: team/jcollie/bug6082/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/jcollie/bug6082/
------------------------------------------------------------------------------
--- svn:externals (added)
+++ svn:externals Fri Jun 23 08:57:14 2006
@@ -1,0 +1,1 @@
+mxml	http://svn.digium.com/svn/mxml/trunk

Propchange: team/jcollie/bug6082/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Jun 23 08:57:14 2006
@@ -1,1 +1,1 @@
-/trunk:1-35575
+/trunk:1-35697

Modified: team/jcollie/bug6082/Makefile
URL: http://svn.digium.com/view/asterisk/team/jcollie/bug6082/Makefile?rev=35698&r1=35697&r2=35698&view=diff
==============================================================================
--- team/jcollie/bug6082/Makefile (original)
+++ team/jcollie/bug6082/Makefile Fri Jun 23 08:57:14 2006
@@ -513,8 +513,10 @@
 	@$(MAKE) -C sounds dist-clean
 	rm -f menuselect.makeopts makeopts makeopts.xml
 	rm -f config.log config.status
+	rm -rf autom4te.cache
 	rm -f include/autoconfig.h
 	rm -f include/asterisk/buildopts.h
+	rm -rf doc/api
 
 datafiles: all
 	if [ x`$(ID) -un` = xroot ]; then sh build_tools/mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; fi
@@ -883,4 +885,4 @@
 	@echo "Generating list of available modules ..."
 	@build_tools/prep_moduledeps > $@
 
-.PHONY: sounds clean clean-depend dist-clean all _all depend cleantest uninstall _uninstall uninstall-all dont-optimize valgrind $(SUBDIRS_INSTALL) $(SUBDIRS_CLEAN) $(SUBDIRS_CLEAN_DEPEND) $(SUBDIRS_DEPEND) $(SUBDIRS_UNINSTALL) $(SUBDIRS)
+.PHONY: sounds clean clean-depend dist-clean distclean all _all depend cleantest uninstall _uninstall uninstall-all dont-optimize valgrind $(SUBDIRS_INSTALL) $(SUBDIRS_CLEAN) $(SUBDIRS_CLEAN_DEPEND) $(SUBDIRS_DEPEND) $(SUBDIRS_UNINSTALL) $(SUBDIRS)

Modified: team/jcollie/bug6082/apps/Makefile
URL: http://svn.digium.com/view/asterisk/team/jcollie/bug6082/apps/Makefile?rev=35698&r1=35697&r2=35698&view=diff
==============================================================================
--- team/jcollie/bug6082/apps/Makefile (original)
+++ team/jcollie/bug6082/apps/Makefile Fri Jun 23 08:57:14 2006
@@ -42,9 +42,6 @@
 
 install: all
 	for x in $(MODS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
-	rm -f $(DESTDIR)$(MODULES_DIR)/app_cut.so
-	rm -f $(DESTDIR)$(MODULES_DIR)/app_datetime.so
-	rm -f $(DESTDIR)$(MODULES_DIR)/app_qcall.so
 
 uninstall:
 

Modified: team/jcollie/bug6082/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/jcollie/bug6082/apps/app_queue.c?rev=35698&r1=35697&r2=35698&view=diff
==============================================================================
--- team/jcollie/bug6082/apps/app_queue.c (original)
+++ team/jcollie/bug6082/apps/app_queue.c Fri Jun 23 08:57:14 2006
@@ -3746,8 +3746,10 @@
 			else
 				ast_log(LOG_DEBUG, "XXX Leaking a little memory :( XXX\n");
 		} else {
+			ast_mutex_lock(&q->lock);
 			for (cur = q->members; cur; cur = cur->next)
 				cur->status = ast_device_state(cur->interface);
+			ast_mutex_unlock(&q->lock);
 		}
 	}
 	AST_LIST_TRAVERSE_SAFE_END;

Modified: team/jcollie/bug6082/build_tools/menuselect-deps.in
URL: http://svn.digium.com/view/asterisk/team/jcollie/bug6082/build_tools/menuselect-deps.in?rev=35698&r1=35697&r2=35698&view=diff
==============================================================================
--- team/jcollie/bug6082/build_tools/menuselect-deps.in (original)
+++ team/jcollie/bug6082/build_tools/menuselect-deps.in Fri Jun 23 08:57:14 2006
@@ -26,3 +26,4 @@
 LIBGSM=@PBX_LIBgsm@
 IKSEMEL=@PBX_LIBIKSEMEL@
 IXJUSER=@PBX_IXJUSER@
+NETSNMP=@PBX_NETSNMP@

Modified: team/jcollie/bug6082/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/jcollie/bug6082/channels/chan_iax2.c?rev=35698&r1=35697&r2=35698&view=diff
==============================================================================
--- team/jcollie/bug6082/channels/chan_iax2.c (original)
+++ team/jcollie/bug6082/channels/chan_iax2.c Fri Jun 23 08:57:14 2006
@@ -3268,60 +3268,67 @@
 	struct chan_iax2_pvt *i;
 	struct ast_variable *v = NULL;
 
+	if (!(i = iaxs[callno])) {
+		ast_log(LOG_WARNING, "No IAX2 pvt found for callno '%d' !\n", callno);
+		return NULL;
+	}
+
 	/* Don't hold call lock */
 	ast_mutex_unlock(&iaxsl[callno]);
 	tmp = ast_channel_alloc(1);
 	ast_mutex_lock(&iaxsl[callno]);
-	i = iaxs[callno];
-	if (i && tmp) {
-		tmp->tech = &iax2_tech;
-		ast_string_field_build(tmp, name, "IAX2/%s-%d", i->host, i->callno);
-		/* We can support any format by default, until we get restricted */
-		tmp->nativeformats = capability;
-		tmp->readformat = ast_best_codec(capability);
-		tmp->writeformat = ast_best_codec(capability);
-		tmp->tech_pvt = CALLNO_TO_PTR(i->callno);
-
-		if (!ast_strlen_zero(i->cid_num))
-			tmp->cid.cid_num = ast_strdup(i->cid_num);
-		if (!ast_strlen_zero(i->cid_name))
-			tmp->cid.cid_name = ast_strdup(i->cid_name);
-		if (!ast_strlen_zero(i->ani))
-			tmp->cid.cid_ani = ast_strdup(i->ani);
-		if (!ast_strlen_zero(i->language))
-			ast_string_field_set(tmp, language, i->language);
-		if (!ast_strlen_zero(i->dnid))
-			tmp->cid.cid_dnid = ast_strdup(i->dnid);
-		if (!ast_strlen_zero(i->rdnis))
-			tmp->cid.cid_rdnis = ast_strdup(i->rdnis);
-		tmp->cid.cid_pres = i->calling_pres;
-		tmp->cid.cid_ton = i->calling_ton;
-		tmp->cid.cid_tns = i->calling_tns;
-		if (!ast_strlen_zero(i->accountcode))
-			ast_string_field_set(tmp, accountcode, i->accountcode);
-		if (i->amaflags)
-			tmp->amaflags = i->amaflags;
-		ast_copy_string(tmp->context, i->context, sizeof(tmp->context));
-		ast_copy_string(tmp->exten, i->exten, sizeof(tmp->exten));
-		tmp->adsicpe = i->peeradsicpe;
-		i->owner = tmp;
-		i->capability = capability;
-		ast_setstate(tmp, state);
-		if (state != AST_STATE_DOWN) {
-			if (ast_pbx_start(tmp)) {
-				ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
-				ast_hangup(tmp);
-				i->owner = NULL;
-				return NULL;
-			}
-		}
-		for (v = i->vars ; v ; v = v->next)
-			pbx_builtin_setvar_helper(tmp,v->name,v->value);
-		ast_mutex_lock(&usecnt_lock);
-		usecnt++;
-		ast_mutex_unlock(&usecnt_lock);
-		ast_update_use_count();
-	}
+	if (!tmp)
+		return NULL;
+	tmp->tech = &iax2_tech;
+	ast_string_field_build(tmp, name, "IAX2/%s-%d", i->host, i->callno);
+	/* We can support any format by default, until we get restricted */
+	tmp->nativeformats = capability;
+	tmp->readformat = ast_best_codec(capability);
+	tmp->writeformat = ast_best_codec(capability);
+	tmp->tech_pvt = CALLNO_TO_PTR(i->callno);
+
+	if (!ast_strlen_zero(i->cid_num))
+		tmp->cid.cid_num = ast_strdup(i->cid_num);
+	if (!ast_strlen_zero(i->cid_name))
+		tmp->cid.cid_name = ast_strdup(i->cid_name);
+	if (!ast_strlen_zero(i->ani))
+		tmp->cid.cid_ani = ast_strdup(i->ani);
+	if (!ast_strlen_zero(i->language))
+		ast_string_field_set(tmp, language, i->language);
+	if (!ast_strlen_zero(i->dnid))
+		tmp->cid.cid_dnid = ast_strdup(i->dnid);
+	if (!ast_strlen_zero(i->rdnis))
+		tmp->cid.cid_rdnis = ast_strdup(i->rdnis);
+	tmp->cid.cid_pres = i->calling_pres;
+	tmp->cid.cid_ton = i->calling_ton;
+	tmp->cid.cid_tns = i->calling_tns;
+	if (!ast_strlen_zero(i->accountcode))
+		ast_string_field_set(tmp, accountcode, i->accountcode);
+	if (i->amaflags)
+		tmp->amaflags = i->amaflags;
+	ast_copy_string(tmp->context, i->context, sizeof(tmp->context));
+	ast_copy_string(tmp->exten, i->exten, sizeof(tmp->exten));
+	tmp->adsicpe = i->peeradsicpe;
+	i->owner = tmp;
+	i->capability = capability;
+	ast_setstate(tmp, state);
+	if (state != AST_STATE_DOWN) {
+		if (ast_pbx_start(tmp)) {
+			ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
+			ast_hangup(tmp);
+			i->owner = NULL;
+			return NULL;
+		}
+	}
+
+	for (v = i->vars ; v ; v = v->next)
+		pbx_builtin_setvar_helper(tmp, v->name, v->value);
+
+	ast_mutex_lock(&usecnt_lock);
+	usecnt++;
+	ast_mutex_unlock(&usecnt_lock);
+	ast_update_use_count();
+	
 	return tmp;
 }
 

Modified: team/jcollie/bug6082/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/jcollie/bug6082/channels/chan_zap.c?rev=35698&r1=35697&r2=35698&view=diff
==============================================================================
--- team/jcollie/bug6082/channels/chan_zap.c (original)
+++ team/jcollie/bug6082/channels/chan_zap.c Fri Jun 23 08:57:14 2006
@@ -5039,173 +5039,168 @@
 		ast_log(LOG_WARNING, "Channel %d already has a %s call\n", i->channel,subnames[index]);
 		return NULL;
 	}
-	tmp = ast_channel_alloc(0);
-	if (tmp) {
-		tmp->tech = &zap_tech;
-		ps.channo = i->channel;
-		res = ioctl(i->subs[SUB_REAL].zfd, ZT_GET_PARAMS, &ps);
-		if (res) {
-			ast_log(LOG_WARNING, "Unable to get parameters, assuming MULAW\n");
-			ps.curlaw = ZT_LAW_MULAW;
-		}
-		if (ps.curlaw == ZT_LAW_ALAW)
+	if (!(tmp = ast_channel_alloc(0)))
+		return NULL;
+	tmp->tech = &zap_tech;
+	ps.channo = i->channel;
+	res = ioctl(i->subs[SUB_REAL].zfd, ZT_GET_PARAMS, &ps);
+	if (res) {
+		ast_log(LOG_WARNING, "Unable to get parameters, assuming MULAW\n");
+		ps.curlaw = ZT_LAW_MULAW;
+	}
+	if (ps.curlaw == ZT_LAW_ALAW)
+		deflaw = AST_FORMAT_ALAW;
+	else
+		deflaw = AST_FORMAT_ULAW;
+	if (law) {
+		if (law == ZT_LAW_ALAW)
 			deflaw = AST_FORMAT_ALAW;
 		else
 			deflaw = AST_FORMAT_ULAW;
-		if (law) {
-			if (law == ZT_LAW_ALAW)
-				deflaw = AST_FORMAT_ALAW;
+	}
+	y = 1;
+	do {
+#ifdef HAVE_LIBPRI
+		if (i->bearer || (i->pri && (i->sig == SIG_FXSKS)))
+			ast_string_field_build(tmp, name, "Zap/%d:%d-%d", i->pri->trunkgroup, i->channel, y);
+		else
+#endif
+		if (i->channel == CHAN_PSEUDO)
+			ast_string_field_build(tmp, name, "Zap/pseudo-%d", ast_random());
+		else	
+			ast_string_field_build(tmp, name, "Zap/%d-%d", i->channel, y);
+		for (x = 0; x < 3; x++) {
+			if ((index != x) && i->subs[x].owner && !strcasecmp(tmp->name, i->subs[x].owner->name))
+				break;
+		}
+		y++;
+	} while (x < 3);
+	tmp->fds[0] = i->subs[index].zfd;
+	tmp->nativeformats = AST_FORMAT_SLINEAR | deflaw;
+	/* Start out assuming ulaw since it's smaller :) */
+	tmp->rawreadformat = deflaw;
+	tmp->readformat = deflaw;
+	tmp->rawwriteformat = deflaw;
+	tmp->writeformat = deflaw;
+	i->subs[index].linear = 0;
+	zt_setlinear(i->subs[index].zfd, i->subs[index].linear);
+	features = 0;
+	if (i->busydetect && CANBUSYDETECT(i))
+		features |= DSP_FEATURE_BUSY_DETECT;
+	if ((i->callprogress & 1) && CANPROGRESSDETECT(i))
+		features |= DSP_FEATURE_CALL_PROGRESS;
+	if ((!i->outgoing && (i->callprogress & 4)) || 
+	    (i->outgoing && (i->callprogress & 2))) {
+		features |= DSP_FEATURE_FAX_DETECT;
+	}
+#ifdef ZT_TONEDETECT
+	x = ZT_TONEDETECT_ON | ZT_TONEDETECT_MUTE;
+	if (ioctl(i->subs[index].zfd, ZT_TONEDETECT, &x)) {
+#endif		
+		i->hardwaredtmf = 0;
+		features |= DSP_FEATURE_DTMF_DETECT;
+#ifdef ZT_TONEDETECT
+	} else if (NEED_MFDETECT(i)) {
+		i->hardwaredtmf = 1;
+		features |= DSP_FEATURE_DTMF_DETECT;
+	}
+#endif
+	if (features) {
+		if (i->dsp) {
+			ast_log(LOG_DEBUG, "Already have a dsp on %s?\n", tmp->name);
+		} else {
+			if (i->channel != CHAN_PSEUDO)
+				i->dsp = ast_dsp_new();
 			else
-				deflaw = AST_FORMAT_ULAW;
-		}
-		y = 1;
-		do {
+				i->dsp = NULL;
+			if (i->dsp) {
+				i->dsp_features = features & ~DSP_PROGRESS_TALK;
 #ifdef HAVE_LIBPRI
-			if (i->bearer || (i->pri && (i->sig == SIG_FXSKS)))
-				ast_string_field_build(tmp, name, "Zap/%d:%d-%d", i->pri->trunkgroup, i->channel, y);
-			else
+				/* We cannot do progress detection until receives PROGRESS message */
+				if (i->outgoing && (i->sig == SIG_PRI)) {
+					/* Remember requested DSP features, don't treat
+					   talking as ANSWER */
+					features = 0;
+				}
 #endif
-			if (i->channel == CHAN_PSEUDO)
-				ast_string_field_build(tmp, name, "Zap/pseudo-%d", ast_random());
-			else	
-				ast_string_field_build(tmp, name, "Zap/%d-%d", i->channel, y);
-			for (x = 0; x < 3; x++) {
-				if ((index != x) && i->subs[x].owner && !strcasecmp(tmp->name, i->subs[x].owner->name))
-					break;
-			}
-			y++;
-		} while (x < 3);
-		tmp->fds[0] = i->subs[index].zfd;
-		tmp->nativeformats = AST_FORMAT_SLINEAR | deflaw;
-		/* Start out assuming ulaw since it's smaller :) */
-		tmp->rawreadformat = deflaw;
-		tmp->readformat = deflaw;
-		tmp->rawwriteformat = deflaw;
-		tmp->writeformat = deflaw;
-		i->subs[index].linear = 0;
-		zt_setlinear(i->subs[index].zfd, i->subs[index].linear);
-		features = 0;
-		if (i->busydetect && CANBUSYDETECT(i)) {
-			features |= DSP_FEATURE_BUSY_DETECT;
-		}
-		if ((i->callprogress & 1) && CANPROGRESSDETECT(i)) {
-			features |= DSP_FEATURE_CALL_PROGRESS;
-		}
-		if ((!i->outgoing && (i->callprogress & 4)) || 
-		    (i->outgoing && (i->callprogress & 2))) {
-			features |= DSP_FEATURE_FAX_DETECT;
-		}
-#ifdef ZT_TONEDETECT
-		x = ZT_TONEDETECT_ON | ZT_TONEDETECT_MUTE;
-		if (ioctl(i->subs[index].zfd, ZT_TONEDETECT, &x)) {
-#endif		
-			i->hardwaredtmf = 0;
-			features |= DSP_FEATURE_DTMF_DETECT;
-#ifdef ZT_TONEDETECT
-		} else if (NEED_MFDETECT(i)) {
-			i->hardwaredtmf = 1;
-			features |= DSP_FEATURE_DTMF_DETECT;
-		}
+				ast_dsp_set_features(i->dsp, features);
+				ast_dsp_digitmode(i->dsp, DSP_DIGITMODE_DTMF | i->dtmfrelax);
+				if (!ast_strlen_zero(progzone))
+					ast_dsp_set_call_progress_zone(i->dsp, progzone);
+				if (i->busydetect && CANBUSYDETECT(i)) {
+					ast_dsp_set_busy_count(i->dsp, i->busycount);
+					ast_dsp_set_busy_pattern(i->dsp, i->busy_tonelength, i->busy_quietlength);
+				}
+			}
+		}
+	}
+		
+	if (state == AST_STATE_RING)
+		tmp->rings = 1;
+	tmp->tech_pvt = i;
+	if ((i->sig == SIG_FXOKS) || (i->sig == SIG_FXOGS) || (i->sig == SIG_FXOLS)) {
+		/* Only FXO signalled stuff can be picked up */
+		tmp->callgroup = i->callgroup;
+		tmp->pickupgroup = i->pickupgroup;
+	}
+	if (!ast_strlen_zero(i->language))
+		ast_string_field_set(tmp, language, i->language);
+	if (!ast_strlen_zero(i->musicclass))
+		ast_string_field_set(tmp, musicclass, i->musicclass);
+	if (!i->owner)
+		i->owner = tmp;
+	if (!ast_strlen_zero(i->accountcode))
+		ast_string_field_set(tmp, accountcode, i->accountcode);
+	if (i->amaflags)
+		tmp->amaflags = i->amaflags;
+	i->subs[index].owner = tmp;
+	ast_copy_string(tmp->context, i->context, sizeof(tmp->context));
+	ast_string_field_set(tmp, call_forward, i->call_forward);
+	/* If we've been told "no ADSI" then enforce it */
+	if (!i->adsi)
+		tmp->adsicpe = AST_ADSI_UNAVAILABLE;
+	if (!ast_strlen_zero(i->exten))
+		ast_copy_string(tmp->exten, i->exten, sizeof(tmp->exten));
+	if (!ast_strlen_zero(i->rdnis))
+		tmp->cid.cid_rdnis = ast_strdup(i->rdnis);
+	if (!ast_strlen_zero(i->dnid))
+		tmp->cid.cid_dnid = ast_strdup(i->dnid);
+
+#ifdef PRI_ANI
+	ast_set_callerid(tmp, i->cid_num, i->cid_name, S_OR(i->cid_ani, i->cid_num));
+#else
+	ast_set_callerid(tmp, i->cid_num, i->cid_name, i->cid_num);
 #endif
-		if (features) {
-			if (i->dsp) {
-				ast_log(LOG_DEBUG, "Already have a dsp on %s?\n", tmp->name);
-			} else {
-				if (i->channel != CHAN_PSEUDO)
-					i->dsp = ast_dsp_new();
-				else
-					i->dsp = NULL;
-				if (i->dsp) {
-					i->dsp_features = features & ~DSP_PROGRESS_TALK;
+	tmp->cid.cid_pres = i->callingpres;
+	tmp->cid.cid_ton = i->cid_ton;
 #ifdef HAVE_LIBPRI
-					/* We cannot do progress detection until receives PROGRESS message */
-					if (i->outgoing && (i->sig == SIG_PRI)) {
-						/* Remember requested DSP features, don't treat
-						   talking as ANSWER */
-						features = 0;
-					}
+	tmp->transfercapability = transfercapability;
+	pbx_builtin_setvar_helper(tmp, "TRANSFERCAPABILITY", ast_transfercapability2str(transfercapability));
+	if (transfercapability & PRI_TRANS_CAP_DIGITAL)
+		i->digital = 1;
+	/* Assume calls are not idle calls unless we're told differently */
+	i->isidlecall = 0;
+	i->alreadyhungup = 0;
 #endif
-					ast_dsp_set_features(i->dsp, features);
-					ast_dsp_digitmode(i->dsp, DSP_DIGITMODE_DTMF | i->dtmfrelax);
-					if (!ast_strlen_zero(progzone))
-						ast_dsp_set_call_progress_zone(i->dsp, progzone);
-					if (i->busydetect && CANBUSYDETECT(i)) {
-						ast_dsp_set_busy_count(i->dsp, i->busycount);
-						ast_dsp_set_busy_pattern(i->dsp, i->busy_tonelength, i->busy_quietlength);
-					}
-				}
-			}
-		}
-		
-		if (state == AST_STATE_RING)
-			tmp->rings = 1;
-		tmp->tech_pvt = i;
-		if ((i->sig == SIG_FXOKS) || (i->sig == SIG_FXOGS) || (i->sig == SIG_FXOLS)) {
-			/* Only FXO signalled stuff can be picked up */
-			tmp->callgroup = i->callgroup;
-			tmp->pickupgroup = i->pickupgroup;
-		}
-		if (!ast_strlen_zero(i->language))
-			ast_string_field_set(tmp, language, i->language);
-		if (!ast_strlen_zero(i->musicclass))
-			ast_string_field_set(tmp, musicclass, i->musicclass);
-		if (!i->owner)
-			i->owner = tmp;
-		if (!ast_strlen_zero(i->accountcode))
-			ast_string_field_set(tmp, accountcode, i->accountcode);
-		if (i->amaflags)
-			tmp->amaflags = i->amaflags;
-		i->subs[index].owner = tmp;
-		ast_copy_string(tmp->context, i->context, sizeof(tmp->context));
-		ast_string_field_set(tmp, call_forward, i->call_forward);
-		/* If we've been told "no ADSI" then enforce it */
-		if (!i->adsi)
-			tmp->adsicpe = AST_ADSI_UNAVAILABLE;
-		if (!ast_strlen_zero(i->exten))
-			ast_copy_string(tmp->exten, i->exten, sizeof(tmp->exten));
-		if (!ast_strlen_zero(i->rdnis))
-			tmp->cid.cid_rdnis = ast_strdup(i->rdnis);
-		if (!ast_strlen_zero(i->dnid))
-			tmp->cid.cid_dnid = ast_strdup(i->dnid);
-
-#ifdef PRI_ANI
-		ast_set_callerid(tmp, i->cid_num, i->cid_name, S_OR(i->cid_ani, i->cid_num));
-#else
-		ast_set_callerid(tmp, i->cid_num, i->cid_name, i->cid_num);
-#endif
-		tmp->cid.cid_pres = i->callingpres;
-		tmp->cid.cid_ton = i->cid_ton;
-#ifdef HAVE_LIBPRI
-		tmp->transfercapability = transfercapability;
-		pbx_builtin_setvar_helper(tmp, "TRANSFERCAPABILITY", ast_transfercapability2str(transfercapability));
-		if (transfercapability & PRI_TRANS_CAP_DIGITAL) {
-			i->digital = 1;
-		}
-		/* Assume calls are not idle calls unless we're told differently */
-		i->isidlecall = 0;
-		i->alreadyhungup = 0;
-#endif
-		/* clear the fake event in case we posted one before we had ast_channel */
-		i->fake_event = 0;
-		/* Assure there is no confmute on this channel */
-		zt_confmute(i, 0);
-		ast_setstate(tmp, state);
-		/* Configure the new channel jb */
-		if (ast_jb_configure(tmp, &global_jbconf)) {
+	/* clear the fake event in case we posted one before we had ast_channel */
+	i->fake_event = 0;
+	/* Assure there is no confmute on this channel */
+	zt_confmute(i, 0);
+	ast_setstate(tmp, state);
+	/* Configure the new channel jb */
+	if (ast_jb_configure(tmp, &global_jbconf)) {
+		ast_hangup(tmp);
+		i->owner = NULL;
+		return NULL;
+	}
+	if (startpbx) {
+		if (ast_pbx_start(tmp)) {
+			ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
 			ast_hangup(tmp);
 			i->owner = NULL;
 			return NULL;
 		}
-		if (startpbx) {
-			if (ast_pbx_start(tmp)) {
-				ast_log(LOG_WARNING, "Unable to start PBX on %s\n", tmp->name);
-				ast_hangup(tmp);
-				i->owner = NULL;
-				return NULL;
-			}
-		}
-	} else
-		ast_log(LOG_WARNING, "Unable to allocate channel structure\n");
+	}
 
 	ast_mutex_lock(&usecnt_lock);
 	usecnt++;

Modified: team/jcollie/bug6082/configure
URL: http://svn.digium.com/view/asterisk/team/jcollie/bug6082/configure?rev=35698&r1=35697&r2=35698&view=diff
==============================================================================
--- team/jcollie/bug6082/configure (original)
+++ team/jcollie/bug6082/configure Fri Jun 23 08:57:14 2006
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 35391 .
+# From configure.ac Revision: 35439 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.59e.
 #
@@ -765,6 +765,9 @@
 pq_INCLUDE
 pq_LIB
 PBX_LIBpq
+NET_SNMP_CONFIG
+NETSNMP_LIBS
+PBX_NETSNMP
 PBX_H323
 PBX_IXJUSER
 VPB_INCLUDE
@@ -17674,6 +17677,117 @@
    fi
 fi
 
+
+
+
+NETSNMP_LIBS=
+PBX_NETSNMP=0
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}net-snmp-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}net-snmp-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_NET_SNMP_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $NET_SNMP_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_NET_SNMP_CONFIG="$NET_SNMP_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_NET_SNMP_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+NET_SNMP_CONFIG=$ac_cv_path_NET_SNMP_CONFIG
+if test -n "$NET_SNMP_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $NET_SNMP_CONFIG" >&5
+echo "${ECHO_T}$NET_SNMP_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_NET_SNMP_CONFIG"; then
+  ac_pt_NET_SNMP_CONFIG=$NET_SNMP_CONFIG
+  # Extract the first word of "net-snmp-config", so it can be a program name with args.
+set dummy net-snmp-config; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_ac_pt_NET_SNMP_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $ac_pt_NET_SNMP_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_NET_SNMP_CONFIG="$ac_pt_NET_SNMP_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_ac_pt_NET_SNMP_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_NET_SNMP_CONFIG=$ac_cv_path_ac_pt_NET_SNMP_CONFIG
+if test -n "$ac_pt_NET_SNMP_CONFIG"; then
+  { echo "$as_me:$LINENO: result: $ac_pt_NET_SNMP_CONFIG" >&5
+echo "${ECHO_T}$ac_pt_NET_SNMP_CONFIG" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_pt_NET_SNMP_CONFIG" = x; then
+    NET_SNMP_CONFIG="No"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    NET_SNMP_CONFIG=$ac_pt_NET_SNMP_CONFIG
+  fi
+else
+  NET_SNMP_CONFIG="$ac_cv_path_NET_SNMP_CONFIG"
+fi
+
+if test "x${NET_SNMP_CONFIG}" != "xNo" ; then
+   NETSNMP_LIBS=`${NET_SNMP_CONFIG} --agent-libs`
+   PBX_NETSNMP=1
+fi
 
 
 
@@ -27193,6 +27307,9 @@
 pq_INCLUDE!$pq_INCLUDE$ac_delim
 pq_LIB!$pq_LIB$ac_delim
 PBX_LIBpq!$PBX_LIBpq$ac_delim
+NET_SNMP_CONFIG!$NET_SNMP_CONFIG$ac_delim
+NETSNMP_LIBS!$NETSNMP_LIBS$ac_delim
+PBX_NETSNMP!$PBX_NETSNMP$ac_delim
 PBX_H323!$PBX_H323$ac_delim
 PBX_IXJUSER!$PBX_IXJUSER$ac_delim
 VPB_INCLUDE!$VPB_INCLUDE$ac_delim
@@ -27223,7 +27340,7 @@
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 94; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
@@ -27242,7 +27359,7 @@
 
 cat >>$CONFIG_STATUS <<_ACEOF
 cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
 _ACEOF
 sed '
 s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
@@ -27255,8 +27372,6 @@
 ' >>$CONFIG_STATUS <conf$$subs.sed
 rm -f conf$$subs.sed
 cat >>$CONFIG_STATUS <<_ACEOF
-:end
-s/|#_!!_#|//g
 CEOF$ac_eof
 _ACEOF
 
@@ -27504,7 +27619,7 @@
 s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
 s&@INSTALL@&$ac_INSTALL&;t t
 $ac_datarootdir_hack
-" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" | sed 's/|#_!!_#|//g' >$tmp/out
 
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
   { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&

Modified: team/jcollie/bug6082/configure.ac
URL: http://svn.digium.com/view/asterisk/team/jcollie/bug6082/configure.ac?rev=35698&r1=35697&r2=35698&view=diff
==============================================================================
--- team/jcollie/bug6082/configure.ac (original)
+++ team/jcollie/bug6082/configure.ac Fri Jun 23 08:57:14 2006
@@ -367,6 +367,16 @@
 AC_SUBST([pq_LIB])
 AC_SUBST([PBX_LIBpq])
 
+NETSNMP_LIBS=
+PBX_NETSNMP=0
+AC_PATH_TOOL([NET_SNMP_CONFIG], [net-snmp-config], No)
+if test "x${NET_SNMP_CONFIG}" != "xNo" ; then
+   NETSNMP_LIBS=`${NET_SNMP_CONFIG} --agent-libs`
+   PBX_NETSNMP=1
+fi
+AC_SUBST([NETSNMP_LIBS])
+AC_SUBST([PBX_NETSNMP])
+
 AC_CHECK_HEADER([h323.h], [PBX_H323=1], [PBX_H323=0])
 AC_SUBST(PBX_H323)
 

Modified: team/jcollie/bug6082/funcs/Makefile
URL: http://svn.digium.com/view/asterisk/team/jcollie/bug6082/funcs/Makefile?rev=35698&r1=35697&r2=35698&view=diff
==============================================================================
--- team/jcollie/bug6082/funcs/Makefile (original)
+++ team/jcollie/bug6082/funcs/Makefile Fri Jun 23 08:57:14 2006
@@ -57,7 +57,6 @@
 
 install: all
 	for x in $(MODS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
-	rm -f $(DESTDIR)$(MODULES_DIR)/pbx_functions.so
 
 uninstall:
 

Modified: team/jcollie/bug6082/makeopts.in
URL: http://svn.digium.com/view/asterisk/team/jcollie/bug6082/makeopts.in?rev=35698&r1=35697&r2=35698&view=diff
==============================================================================
--- team/jcollie/bug6082/makeopts.in (original)
+++ team/jcollie/bug6082/makeopts.in Fri Jun 23 08:57:14 2006
@@ -123,3 +123,5 @@
 
 RADIUSCLIENT_LIB=@RADIUSCLIENT_LIB@
 RADIUSCLIENT_INCLUDE=@RADIUSCLIENT_INCLUDE@
+
+NETSNMP_LIBS=@NETSNMP_LIBS@

Modified: team/jcollie/bug6082/res/Makefile
URL: http://svn.digium.com/view/asterisk/team/jcollie/bug6082/res/Makefile?rev=35698&r1=35697&r2=35698&view=diff
==============================================================================
--- team/jcollie/bug6082/res/Makefile (original)
+++ team/jcollie/bug6082/res/Makefile Fri Jun 23 08:57:14 2006
@@ -23,31 +23,11 @@
   SELECTED_MODS:=$(filter-out $(shell if test ${BSDVERSION} -lt 500000 ; then echo "res_config_odbc"; fi),$(SELECTED_MODS))
 endif
 
-# NETsnmp has some difficulties on some platforms (conflict with unload_module)
-# Until we figure out if the collission is version-specific or what to do
-# we have disabled res_snmp on OS/X and *BSD
-ifeq ($(OSARCH),Darwin)
-  SELECTED_MODS:=$(filter-out res_snmp,$(SELECTED_MODS))
-else
-  ifeq ($(findstring BSD,$(OSARCH)),BSD)
-    SELECTED_MODS:=$(filter-out res_snmp,$(SELECTED_MODS))
-  endif
-endif
-
-ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/net-snmp/net-snmp-config.h),)
-  SELECTED_MODS:=$(filter-out res_snmp,$(SELECTED_MODS))
-else
-  SNMP_LDLIBS+=$(shell net-snmp-config --agent-libs)
-endif
-
 MODS:=$(patsubst %,%.so,$(SELECTED_MODS))
 
 all: $(MODS)
 
 install: all
-	rm -f $(DESTDIR)$(ASTHEADERDIR)/parking.h
-	rm -f $(DESTDIR)$(MODULES_DIR)/app_agi.so 
-	rm -f $(DESTDIR)$(MODULES_DIR)/res_parking.so
 	for x in $(MODS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
 	@if [ x`which mpg123 2>/dev/null | grep -v '^no'` != x ] ; then \
 	  if mpg123 --longhelp 2>&1 | grep -q .59r 2>&1 >/dev/null ; then echo ; else \
@@ -74,6 +54,7 @@
 
 clean: clean-depend
 	rm -f *.so *.o
+	rm -f snmp/*.o
 
 res_odbc.so: res_odbc.o
 	$(CC) $(SOLINK) -o $@ $< $(ODBC_LIB) 
@@ -100,7 +81,7 @@
 	$(CC) -c -o $@ $(CFLAGS) $(ODBC_INCLUDE) $<
 
 res_snmp.so: res_snmp.o snmp/agent.o
-	$(CC) $(SOLINK) $(SNMP_LDFLAGS) -o $@ $< snmp/agent.o $(SNMP_LDLIBS)
+	$(CC) $(SOLINK) -o $@ $^ $(NETSNMP_LIBS)
 
 res_config_pgsql.so: res_config_pgsql.o
 	$(CC) $(SOLINK) -o $@ $< $(PGSQL_LIB)

Modified: team/jcollie/bug6082/res/res_snmp.c
URL: http://svn.digium.com/view/asterisk/team/jcollie/bug6082/res/res_snmp.c?rev=35698&r1=35697&r2=35698&view=diff
==============================================================================
--- team/jcollie/bug6082/res/res_snmp.c (original)
+++ team/jcollie/bug6082/res/res_snmp.c Fri Jun 23 08:57:14 2006
@@ -15,6 +15,7 @@
  */
 
 /*** MODULEINFO
+	<depend>netsnmp</depend>
 	<defaultenabled>no</defaultenabled>
  ***/
 



More information about the asterisk-commits mailing list