[asterisk-commits] snuffy: branch snuffy/ao2_jabber_take2 r203906 - in /team/snuffy/ao2_jabber_t...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jun 26 19:36:07 CDT 2009


Author: snuffy
Date: Fri Jun 26 19:35:59 2009
New Revision: 203906

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=203906
Log:
more updates

Added:
    team/snuffy/ao2_jabber_take2/apps/app_celgenuserevent.c
      - copied unchanged from r203853, trunk/apps/app_celgenuserevent.c
    team/snuffy/ao2_jabber_take2/cdr/cdr_syslog.c
      - copied unchanged from r203853, trunk/cdr/cdr_syslog.c
    team/snuffy/ao2_jabber_take2/cel/   (props changed)
      - copied from r203853, trunk/cel/
    team/snuffy/ao2_jabber_take2/cel/Makefile
      - copied unchanged from r203853, trunk/cel/Makefile
    team/snuffy/ao2_jabber_take2/cel/cel_adaptive_odbc.c
      - copied unchanged from r203853, trunk/cel/cel_adaptive_odbc.c
    team/snuffy/ao2_jabber_take2/cel/cel_custom.c
      - copied unchanged from r203853, trunk/cel/cel_custom.c
    team/snuffy/ao2_jabber_take2/cel/cel_manager.c
      - copied unchanged from r203853, trunk/cel/cel_manager.c
    team/snuffy/ao2_jabber_take2/cel/cel_pgsql.c
      - copied unchanged from r203853, trunk/cel/cel_pgsql.c
    team/snuffy/ao2_jabber_take2/cel/cel_radius.c
      - copied unchanged from r203853, trunk/cel/cel_radius.c
    team/snuffy/ao2_jabber_take2/cel/cel_sqlite3_custom.c
      - copied unchanged from r203853, trunk/cel/cel_sqlite3_custom.c
    team/snuffy/ao2_jabber_take2/cel/cel_tds.c
      - copied unchanged from r203853, trunk/cel/cel_tds.c
    team/snuffy/ao2_jabber_take2/configs/cdr_syslog.conf.sample
      - copied unchanged from r203853, trunk/configs/cdr_syslog.conf.sample
    team/snuffy/ao2_jabber_take2/configs/cel.conf.sample
      - copied unchanged from r203853, trunk/configs/cel.conf.sample
    team/snuffy/ao2_jabber_take2/configs/cel_adaptive_odbc.conf.sample
      - copied unchanged from r203853, trunk/configs/cel_adaptive_odbc.conf.sample
    team/snuffy/ao2_jabber_take2/configs/cel_custom.conf.sample
      - copied unchanged from r203853, trunk/configs/cel_custom.conf.sample
    team/snuffy/ao2_jabber_take2/configs/cel_pgsql.conf.sample
      - copied unchanged from r203853, trunk/configs/cel_pgsql.conf.sample
    team/snuffy/ao2_jabber_take2/configs/cel_sqlite3_custom.conf.sample
      - copied unchanged from r203853, trunk/configs/cel_sqlite3_custom.conf.sample
    team/snuffy/ao2_jabber_take2/configs/cel_tds.conf.sample
      - copied unchanged from r203853, trunk/configs/cel_tds.conf.sample
    team/snuffy/ao2_jabber_take2/doc/tex/cel-doc.tex
      - copied unchanged from r203853, trunk/doc/tex/cel-doc.tex
    team/snuffy/ao2_jabber_take2/doc/tex/celdriver.tex
      - copied unchanged from r203853, trunk/doc/tex/celdriver.tex
    team/snuffy/ao2_jabber_take2/include/asterisk/cel.h
      - copied unchanged from r203853, trunk/include/asterisk/cel.h
    team/snuffy/ao2_jabber_take2/main/cel.c
      - copied unchanged from r203853, trunk/main/cel.c
Modified:
    team/snuffy/ao2_jabber_take2/   (props changed)
    team/snuffy/ao2_jabber_take2/Makefile
    team/snuffy/ao2_jabber_take2/apps/app_chanisavail.c
    team/snuffy/ao2_jabber_take2/apps/app_chanspy.c
    team/snuffy/ao2_jabber_take2/apps/app_confbridge.c
    team/snuffy/ao2_jabber_take2/apps/app_dial.c
    team/snuffy/ao2_jabber_take2/apps/app_directed_pickup.c
    team/snuffy/ao2_jabber_take2/apps/app_fax.c
    team/snuffy/ao2_jabber_take2/apps/app_followme.c
    team/snuffy/ao2_jabber_take2/apps/app_meetme.c
    team/snuffy/ao2_jabber_take2/apps/app_minivm.c
    team/snuffy/ao2_jabber_take2/apps/app_parkandannounce.c
    team/snuffy/ao2_jabber_take2/apps/app_queue.c
    team/snuffy/ao2_jabber_take2/apps/app_stack.c
    team/snuffy/ao2_jabber_take2/apps/app_voicemail.c
    team/snuffy/ao2_jabber_take2/bridges/bridge_builtin_features.c
    team/snuffy/ao2_jabber_take2/build_tools/menuselect-deps.in
    team/snuffy/ao2_jabber_take2/cdr/cdr_custom.c
    team/snuffy/ao2_jabber_take2/cdr/cdr_sqlite.c
    team/snuffy/ao2_jabber_take2/cdr/cdr_sqlite3_custom.c
    team/snuffy/ao2_jabber_take2/channels/chan_agent.c
    team/snuffy/ao2_jabber_take2/channels/chan_alsa.c
    team/snuffy/ao2_jabber_take2/channels/chan_bridge.c
    team/snuffy/ao2_jabber_take2/channels/chan_console.c
    team/snuffy/ao2_jabber_take2/channels/chan_dahdi.c
    team/snuffy/ao2_jabber_take2/channels/chan_gtalk.c
    team/snuffy/ao2_jabber_take2/channels/chan_h323.c
    team/snuffy/ao2_jabber_take2/channels/chan_jingle.c
    team/snuffy/ao2_jabber_take2/channels/chan_local.c
    team/snuffy/ao2_jabber_take2/channels/chan_mgcp.c
    team/snuffy/ao2_jabber_take2/channels/chan_misdn.c
    team/snuffy/ao2_jabber_take2/channels/chan_nbs.c
    team/snuffy/ao2_jabber_take2/channels/chan_oss.c
    team/snuffy/ao2_jabber_take2/channels/chan_phone.c
    team/snuffy/ao2_jabber_take2/channels/chan_sip.c
    team/snuffy/ao2_jabber_take2/channels/chan_skinny.c
    team/snuffy/ao2_jabber_take2/channels/chan_unistim.c
    team/snuffy/ao2_jabber_take2/channels/chan_usbradio.c
    team/snuffy/ao2_jabber_take2/channels/chan_vpb.cc
    team/snuffy/ao2_jabber_take2/channels/sig_analog.c
    team/snuffy/ao2_jabber_take2/channels/sig_analog.h
    team/snuffy/ao2_jabber_take2/configs/chan_dahdi.conf.sample
    team/snuffy/ao2_jabber_take2/configs/sip.conf.sample
    team/snuffy/ao2_jabber_take2/configure
    team/snuffy/ao2_jabber_take2/configure.ac
    team/snuffy/ao2_jabber_take2/doc/manager_1_1.txt
    team/snuffy/ao2_jabber_take2/doc/tex/asterisk.tex
    team/snuffy/ao2_jabber_take2/funcs/func_cdr.c
    team/snuffy/ao2_jabber_take2/funcs/func_channel.c
    team/snuffy/ao2_jabber_take2/funcs/func_odbc.c
    team/snuffy/ao2_jabber_take2/include/asterisk/_private.h
    team/snuffy/ao2_jabber_take2/include/asterisk/autoconfig.h.in
    team/snuffy/ao2_jabber_take2/include/asterisk/cdr.h
    team/snuffy/ao2_jabber_take2/include/asterisk/channel.h
    team/snuffy/ao2_jabber_take2/include/asterisk/devicestate.h
    team/snuffy/ao2_jabber_take2/include/asterisk/doxyref.h
    team/snuffy/ao2_jabber_take2/include/asterisk/event.h   (contents, props changed)
    team/snuffy/ao2_jabber_take2/include/asterisk/event_defs.h   (contents, props changed)
    team/snuffy/ao2_jabber_take2/include/asterisk/frame.h
    team/snuffy/ao2_jabber_take2/include/asterisk/utils.h
    team/snuffy/ao2_jabber_take2/main/asterisk.c
    team/snuffy/ao2_jabber_take2/main/cdr.c
    team/snuffy/ao2_jabber_take2/main/cli.c
    team/snuffy/ao2_jabber_take2/main/devicestate.c
    team/snuffy/ao2_jabber_take2/main/dial.c
    team/snuffy/ao2_jabber_take2/main/event.c   (contents, props changed)
    team/snuffy/ao2_jabber_take2/main/features.c
    team/snuffy/ao2_jabber_take2/main/file.c
    team/snuffy/ao2_jabber_take2/main/frame.c
    team/snuffy/ao2_jabber_take2/main/loader.c
    team/snuffy/ao2_jabber_take2/main/logger.c
    team/snuffy/ao2_jabber_take2/main/manager.c
    team/snuffy/ao2_jabber_take2/main/pbx.c
    team/snuffy/ao2_jabber_take2/main/rtp_engine.c
    team/snuffy/ao2_jabber_take2/res/ais/evt.c
    team/snuffy/ao2_jabber_take2/res/res_agi.c
    team/snuffy/ao2_jabber_take2/res/res_calendar.c
    team/snuffy/ao2_jabber_take2/tests/test_substitution.c

Propchange: team/snuffy/ao2_jabber_take2/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.

Propchange: team/snuffy/ao2_jabber_take2/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/snuffy/ao2_jabber_take2/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Jun 26 19:35:59 2009
@@ -1,1 +1,1 @@
-/trunk:1-200614
+/trunk:1-203905

Modified: team/snuffy/ao2_jabber_take2/Makefile
URL: http://svn.asterisk.org/svn-view/asterisk/team/snuffy/ao2_jabber_take2/Makefile?view=diff&rev=203906&r1=203905&r2=203906
==============================================================================
--- team/snuffy/ao2_jabber_take2/Makefile (original)
+++ team/snuffy/ao2_jabber_take2/Makefile Fri Jun 26 19:35:59 2009
@@ -293,7 +293,7 @@
 #	value directly to ASTCFLAGS
 ASTCFLAGS+=$(MALLOC_DEBUG)$(OPTIONS)
 
-MOD_SUBDIRS:=channels pbx apps codecs formats cdr bridges funcs tests main res $(LOCAL_MOD_SUBDIRS)
+MOD_SUBDIRS:=channels pbx apps codecs formats cdr cel bridges funcs tests main res $(LOCAL_MOD_SUBDIRS)
 OTHER_SUBDIRS:=utils agi
 SUBDIRS:=$(OTHER_SUBDIRS) $(MOD_SUBDIRS)
 SUBDIRS_INSTALL:=$(SUBDIRS:%=%-install)
@@ -574,6 +574,8 @@
 	mkdir -p $(DESTDIR)$(ASTDATADIR)/documentation/thirdparty
 	mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
 	mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-custom
+	mkdir -p $(DESTDIR)$(ASTLOGDIR)/cel-csv
+	mkdir -p $(DESTDIR)$(ASTLOGDIR)/cel-custom
 	mkdir -p $(DESTDIR)$(ASTDATADIR)/keys
 	mkdir -p $(DESTDIR)$(ASTDATADIR)/firmware
 	mkdir -p $(DESTDIR)$(ASTDATADIR)/firmware/iax

Modified: team/snuffy/ao2_jabber_take2/apps/app_chanisavail.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/snuffy/ao2_jabber_take2/apps/app_chanisavail.c?view=diff&rev=203906&r1=203905&r2=203906
==============================================================================
--- team/snuffy/ao2_jabber_take2/apps/app_chanisavail.c (original)
+++ team/snuffy/ao2_jabber_take2/apps/app_chanisavail.c Fri Jun 26 19:35:59 2009
@@ -159,7 +159,7 @@
 				snprintf(trychan, sizeof(trychan), "%s/%s",cur,number);
 				status = inuse = ast_device_state(trychan);
 			}
-			if ((inuse <= 1) && (tempchan = ast_request(tech, chan->nativeformats, number, &status))) {
+			if ((inuse <= 1) && (tempchan = ast_request(tech, chan->nativeformats, chan, number, &status))) {
 					ast_str_append(&tmp_availchan, 0, "%s%s", ast_str_strlen(tmp_availchan) ? "&" : "", tempchan->name);
 					
 					snprintf(tmp, sizeof(tmp), "%s/%s", tech, number);

Modified: team/snuffy/ao2_jabber_take2/apps/app_chanspy.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/snuffy/ao2_jabber_take2/apps/app_chanspy.c?view=diff&rev=203906&r1=203905&r2=203906
==============================================================================
--- team/snuffy/ao2_jabber_take2/apps/app_chanspy.c (original)
+++ team/snuffy/ao2_jabber_take2/apps/app_chanspy.c Fri Jun 26 19:35:59 2009
@@ -134,6 +134,9 @@
 					</option>
 					<option name="o">
 						<para>Only listen to audio coming from this channel.</para>
+					</option>
+					<option name="s">
+						<para>Stop when no more channels are left to spy on.</para>
 					</option>
 					<option name="X">
 						<para>Allow the user to exit ChanSpy to a valid single digit
@@ -266,6 +269,9 @@
 					<option name="o">
 						<para>Only listen to audio coming from this channel.</para>
 					</option>
+					<option name="s">
+						<para>Stop when there are no more extensions left to spy on.</para>
+					</option>
 					<option name="X">
 						<para>Allow the user to exit ChanSpy to a valid single digit
 						numeric extension in the current context or the context
@@ -349,6 +355,7 @@
 	OPTION_DTMF_EXIT         = (1 << 14),	/* Set DTMF to exit, added for DAHDIScan integration */
 	OPTION_DTMF_CYCLE        = (1 << 15),	/* Custom DTMF for cycling next avaliable channel, (default is '*') */
 	OPTION_DAHDI_SCAN        = (1 << 16),	/* Scan groups in DAHDIScan mode */
+	OPTION_STOP              = (1 << 17),
 };
 
 enum {
@@ -373,6 +380,7 @@
 	AST_APP_OPTION_ARG('r', OPTION_RECORD, OPT_ARG_RECORD),
 	AST_APP_OPTION_ARG('e', OPTION_ENFORCED, OPT_ARG_ENFORCED),
 	AST_APP_OPTION('o', OPTION_READONLY),
+	AST_APP_OPTION('s', OPTION_STOP),
 	AST_APP_OPTION('X', OPTION_EXIT),
 	AST_APP_OPTION('s', OPTION_NOTECH),
 	AST_APP_OPTION_ARG('n', OPTION_NAME, OPT_ARG_NAME),
@@ -956,6 +964,9 @@
 
 		if (res == -1 || ast_check_hangup(chan))
 			break;
+		if (ast_test_flag(flags, OPTION_STOP) && !next_autochan) {
+			break;
+		}
 	}
 exit:
 

Modified: team/snuffy/ao2_jabber_take2/apps/app_confbridge.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/snuffy/ao2_jabber_take2/apps/app_confbridge.c?view=diff&rev=203906&r1=203905&r2=203906
==============================================================================
--- team/snuffy/ao2_jabber_take2/apps/app_confbridge.c (original)
+++ team/snuffy/ao2_jabber_take2/apps/app_confbridge.c Fri Jun 26 19:35:59 2009
@@ -559,7 +559,7 @@
 	if (!(conference_bridge->playback_chan)) {
 		int cause;
 
-		if (!(conference_bridge->playback_chan = ast_request("Bridge", AST_FORMAT_SLINEAR, "", &cause))) {
+		if (!(conference_bridge->playback_chan = ast_request("Bridge", AST_FORMAT_SLINEAR, NULL, "", &cause))) {
 			ast_mutex_unlock(&conference_bridge->playback_lock);
 			return -1;
 		}

Modified: team/snuffy/ao2_jabber_take2/apps/app_dial.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/snuffy/ao2_jabber_take2/apps/app_dial.c?view=diff&rev=203906&r1=203905&r2=203906
==============================================================================
--- team/snuffy/ao2_jabber_take2/apps/app_dial.c (original)
+++ team/snuffy/ao2_jabber_take2/apps/app_dial.c Fri Jun 26 19:35:59 2009
@@ -61,6 +61,7 @@
 #include "asterisk/stringfields.h"
 #include "asterisk/global_datastores.h"
 #include "asterisk/dsp.h"
+#include "asterisk/cel.h"
 
 /*** DOCUMENTATION
 	<application name="Dial" language="en_US">
@@ -756,6 +757,9 @@
 		stuff = tmpchan;
 		tech = "Local";
 	}
+
+	ast_cel_report_event(in, AST_CEL_FORWARD, NULL, c->call_forward, NULL);
+
 	/* Before processing channel, go ahead and check for forwarding */
 	ast_verb(3, "Now forwarding %s to '%s/%s' (thanks to %s)\n", in->name, tech, stuff, c->name);
 	/* If we have been told to ignore forwards, just set this channel to null and continue processing extensions normally */
@@ -765,7 +769,7 @@
 		cause = AST_CAUSE_BUSY;
 	} else {
 		/* Setup parameters */
-		c = o->chan = ast_request(tech, in->nativeformats, stuff, &cause);
+		c = o->chan = ast_request(tech, in->nativeformats, in, stuff, &cause);
 		if (c) {
 			if (single)
 				ast_channel_make_compatible(o->chan, in);
@@ -1872,7 +1876,7 @@
 			AST_LIST_UNLOCK(dialed_interfaces);
 		}
 
-		tc = ast_request(tech, chan->nativeformats, numsubst, &cause);
+		tc = ast_request(tech, chan->nativeformats, chan, numsubst, &cause);
 		if (!tc) {
 			/* If we can't, just go on to the next call */
 			ast_log(LOG_WARNING, "Unable to create channel of type '%s' (cause %d - %s)\n",
@@ -1921,7 +1925,9 @@
 
 		tc->cid.cid_tns = chan->cid.cid_tns;
 
-		ast_string_field_set(tc, accountcode, chan->accountcode);
+		if (!ast_strlen_zero(chan->accountcode)) {
+			ast_string_field_set(tc, peeraccount, chan->accountcode);
+		}
 		tc->cdrflags = chan->cdrflags;
 		if (ast_strlen_zero(tc->musicclass))
 			ast_string_field_set(tc, musicclass, chan->musicclass);

Modified: team/snuffy/ao2_jabber_take2/apps/app_directed_pickup.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/snuffy/ao2_jabber_take2/apps/app_directed_pickup.c?view=diff&rev=203906&r1=203905&r2=203906
==============================================================================
--- team/snuffy/ao2_jabber_take2/apps/app_directed_pickup.c (original)
+++ team/snuffy/ao2_jabber_take2/apps/app_directed_pickup.c Fri Jun 26 19:35:59 2009
@@ -41,6 +41,7 @@
 #include "asterisk/app.h"
 #include "asterisk/features.h"
 #include "asterisk/callerid.h"
+#include "asterisk/cel.h"
 
 #define PICKUPMARK "PICKUPMARK"
 
@@ -95,6 +96,7 @@
 	struct ast_party_connected_line connected_caller;
 
 	ast_debug(1, "Call pickup on '%s' by '%s'\n", target->name, chan->name);
+	ast_cel_report_event(target, AST_CEL_PICKUP, NULL, NULL, chan);
 
 	connected_caller = target->connected;
 	connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;

Modified: team/snuffy/ao2_jabber_take2/apps/app_fax.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/snuffy/ao2_jabber_take2/apps/app_fax.c?view=diff&rev=203906&r1=203905&r2=203906
==============================================================================
--- team/snuffy/ao2_jabber_take2/apps/app_fax.c (original)
+++ team/snuffy/ao2_jabber_take2/apps/app_fax.c Fri Jun 26 19:35:59 2009
@@ -161,7 +161,7 @@
 	int direction;			/* Fax direction: 0 - receiving, 1 - sending */
 	int caller_mode;
 	char *file_name;
-	
+	struct ast_control_t38_parameters t38parameters;
 	volatile int finished;
 } fax_session;
 
@@ -372,7 +372,6 @@
 	struct ast_frame *fr;
 	int last_state = 0;
 	struct timeval now, start, state_change;
-	enum ast_control_t38 t38control;
 
 #if SPANDSP_RELEASE_DATE >= 20080725
         /* for spandsp shaphots 0.0.6 and higher */
@@ -456,9 +455,16 @@
 			/* Do not pass channel to ast_dsp_process otherwise it may queue modified audio frame back */
 			fr = ast_dsp_process(NULL, dsp, fr);
 			if (fr && fr->frametype == AST_FRAME_DTMF && fr->subclass == 'f') {
+				struct ast_control_t38_parameters parameters = { .request_response = AST_T38_REQUEST_NEGOTIATE,
+										 .version = 0,
+										 .max_datagram = 400,
+										 .rate = AST_T38_RATE_9600,
+										 .rate_management = AST_T38_RATE_MANAGEMENT_TRANSFERED_TCF,
+										 .fill_bit_removal = 1,
+										 .transcoding_mmr = 1,
+				};
 				ast_debug(1, "Fax tone detected. Requesting T38\n");
-				t38control = AST_T38_REQUEST_NEGOTIATE;
-				ast_indicate_data(s->chan, AST_CONTROL_T38, &t38control, sizeof(t38control));
+				ast_indicate_data(s->chan, AST_CONTROL_T38_PARAMETERS, &parameters, sizeof(parameters));
 				detect_tone = 0;
 			}
 
@@ -483,11 +489,11 @@
 				state_change = ast_tvnow();
 				last_state = t30state->state;
 			}
-		} else if (inf->frametype == AST_FRAME_CONTROL && inf->subclass == AST_CONTROL_T38 &&
-				inf->datalen == sizeof(enum ast_control_t38)) {
-			t38control =*((enum ast_control_t38 *) inf->data.ptr);
-			if (t38control == AST_T38_NEGOTIATED) {
+		} else if (inf->frametype == AST_FRAME_CONTROL && inf->subclass == AST_CONTROL_T38_PARAMETERS) {
+			struct ast_control_t38_parameters *parameters = inf->data.ptr;
+			if (parameters->request_response == AST_T38_NEGOTIATED) {
 				/* T38 switchover completed */
+				s->t38parameters = *parameters;
 				ast_debug(1, "T38 negotiated, finishing audio loop\n");
 				res = 1;
 				break;
@@ -548,8 +554,6 @@
 	struct ast_frame *inf = NULL;
 	int last_state = 0;
 	struct timeval now, start, state_change, last_frame;
-	enum ast_control_t38 t38control;
-
 	t30_state_t *t30state;
 	t38_core_state_t *t38state;
 
@@ -570,6 +574,17 @@
 		return -1;
 	}
 
+	t38_set_max_datagram_size(t38state, s->t38parameters.max_datagram);
+
+	if (s->t38parameters.fill_bit_removal) {
+		t38_set_fill_bit_removal(t38state, TRUE);
+	}
+	if (s->t38parameters.transcoding_mmr) {
+		t38_set_mmr_transcoding(t38state, TRUE);
+	} else if (s->t38parameters.transcoding_jbig) {
+		t38_set_jbig_transcoding(t38state, TRUE);
+	}
+
 	/* Setup logging */
 	set_logging(&t38.logging);
 	set_logging(&t30state->logging);
@@ -613,12 +628,9 @@
 				state_change = ast_tvnow();
 				last_state = t30state->state;
 			}
-		} else if (inf->frametype == AST_FRAME_CONTROL && inf->subclass == AST_CONTROL_T38 &&
-				inf->datalen == sizeof(enum ast_control_t38)) {
-
-			t38control = *((enum ast_control_t38 *) inf->data.ptr);
-
-			if (t38control == AST_T38_TERMINATED || t38control == AST_T38_REFUSED) {
+		} else if (inf->frametype == AST_FRAME_CONTROL && inf->subclass == AST_CONTROL_T38_PARAMETERS) {
+			struct ast_control_t38_parameters *parameters = inf->data.ptr;
+			if (parameters->request_response == AST_T38_TERMINATED || parameters->request_response == AST_T38_REFUSED) {
 				ast_debug(1, "T38 down, terminating\n");
 				res = -1;
 				break;
@@ -709,7 +721,8 @@
 {
 	int res = 0;
 	char *parse;
-	fax_session session;
+	fax_session session = { 0, };
+	char restore_digit_detect = 0;
 	char restore_digit_detect = 0;
 
 	AST_DECLARE_APP_ARGS(args,

Modified: team/snuffy/ao2_jabber_take2/apps/app_followme.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/snuffy/ao2_jabber_take2/apps/app_followme.c?view=diff&rev=203906&r1=203905&r2=203906
==============================================================================
--- team/snuffy/ao2_jabber_take2/apps/app_followme.c (original)
+++ team/snuffy/ao2_jabber_take2/apps/app_followme.c Fri Jun 26 19:35:59 2009
@@ -831,7 +831,7 @@
 				return;
 			}
 
-			outbound = ast_request("Local", ast_best_codec(caller->nativeformats), dialarg, &dg);
+			outbound = ast_request("Local", ast_best_codec(caller->nativeformats), caller, dialarg, &dg);
 			if (outbound) {
 				ast_set_callerid(outbound, caller->cid.cid_num, caller->cid.cid_name, caller->cid.cid_num);
 				ast_channel_inherit_variables(tpargs->chan, outbound);

Modified: team/snuffy/ao2_jabber_take2/apps/app_meetme.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/snuffy/ao2_jabber_take2/apps/app_meetme.c?view=diff&rev=203906&r1=203905&r2=203906
==============================================================================
--- team/snuffy/ao2_jabber_take2/apps/app_meetme.c (original)
+++ team/snuffy/ao2_jabber_take2/apps/app_meetme.c Fri Jun 26 19:35:59 2009
@@ -1176,7 +1176,7 @@
 	cnf->dahdiconf = dahdic.confno;
 
 	/* Setup a new channel for playback of audio files */
-	cnf->chan = ast_request("DAHDI", AST_FORMAT_SLINEAR, "pseudo", NULL);
+	cnf->chan = ast_request("DAHDI", AST_FORMAT_SLINEAR, chan, "pseudo", NULL);
 	if (cnf->chan) {
 		ast_set_read_format(cnf->chan, AST_FORMAT_SLINEAR);
 		ast_set_write_format(cnf->chan, AST_FORMAT_SLINEAR);
@@ -2202,7 +2202,7 @@
 	}
 
 	ast_mutex_lock(&conf->recordthreadlock);
-	if ((conf->recordthread == AST_PTHREADT_NULL) && (confflags & CONFFLAG_RECORDCONF) && ((conf->lchan = ast_request("DAHDI", AST_FORMAT_SLINEAR, "pseudo", NULL)))) {
+	if ((conf->recordthread == AST_PTHREADT_NULL) && (confflags & CONFFLAG_RECORDCONF) && ((conf->lchan = ast_request("DAHDI", AST_FORMAT_SLINEAR, chan, "pseudo", NULL)))) {
 		ast_set_read_format(conf->lchan, AST_FORMAT_SLINEAR);
 		ast_set_write_format(conf->lchan, AST_FORMAT_SLINEAR);
 		dahdic.chan = 0;

Modified: team/snuffy/ao2_jabber_take2/apps/app_minivm.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/snuffy/ao2_jabber_take2/apps/app_minivm.c?view=diff&rev=203906&r1=203905&r2=203906
==============================================================================
--- team/snuffy/ao2_jabber_take2/apps/app_minivm.c (original)
+++ team/snuffy/ao2_jabber_take2/apps/app_minivm.c Fri Jun 26 19:35:59 2009
@@ -1299,8 +1299,7 @@
 		return -1;
 	}
 	/* Allocate channel used for chanvar substitution */
-	ast = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, "", "", "", 0, "%s", "");
-
+	ast = ast_dummy_channel_alloc();
 
 	snprintf(dur, sizeof(dur), "%d:%02d", duration / 60, duration % 60);
 
@@ -1461,9 +1460,8 @@
 	ast_safe_system(tmp2);
 	ast_debug(1, "Sent message to %s with command '%s' - %s\n", vmu->email, global_mailcmd, template->attachment ? "(media attachment)" : "");
 	ast_debug(3, "Actual command used: %s\n", tmp2);
-	if (ast) {
+	if (ast)
 		ast = ast_channel_release(ast);
-	}
 	ast_free(str1);
 	ast_free(str2);
 	return 0;

Modified: team/snuffy/ao2_jabber_take2/apps/app_parkandannounce.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/snuffy/ao2_jabber_take2/apps/app_parkandannounce.c?view=diff&rev=203906&r1=203905&r2=203906
==============================================================================
--- team/snuffy/ao2_jabber_take2/apps/app_parkandannounce.c (original)
+++ team/snuffy/ao2_jabber_take2/apps/app_parkandannounce.c Fri Jun 26 19:35:59 2009
@@ -145,7 +145,7 @@
 	snprintf(buf, sizeof(buf), "%d", lot);
 	oh.parent_channel = chan;
 	oh.vars = ast_variable_new("_PARKEDAT", buf, "");
-	dchan = __ast_request_and_dial(dialtech, AST_FORMAT_SLINEAR, args.dial, 30000, &outstate, chan->cid.cid_num, chan->cid.cid_name, &oh);
+	dchan = __ast_request_and_dial(dialtech, AST_FORMAT_SLINEAR, chan, args.dial, 30000, &outstate, chan->cid.cid_num, chan->cid.cid_name, &oh);
 
 	if (dchan) {
 		if (dchan->_state == AST_STATE_UP) {

Modified: team/snuffy/ao2_jabber_take2/apps/app_queue.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/snuffy/ao2_jabber_take2/apps/app_queue.c?view=diff&rev=203906&r1=203905&r2=203906
==============================================================================
--- team/snuffy/ao2_jabber_take2/apps/app_queue.c (original)
+++ team/snuffy/ao2_jabber_take2/apps/app_queue.c Fri Jun 26 19:35:59 2009
@@ -95,6 +95,7 @@
 #include "asterisk/global_datastores.h"
 #include "asterisk/taskprocessor.h"
 #include "asterisk/callerid.h"
+#include "asterisk/cel.h"
 
 /*!
  * \par Please read before modifying this file.
@@ -2656,7 +2657,7 @@
 		location = "";
 
 	/* Request the peer */
-	tmp->chan = ast_request(tech, qe->chan->nativeformats, location, &status);
+	tmp->chan = ast_request(tech, qe->chan->nativeformats, qe->chan, location, &status);
 	if (!tmp->chan) {			/* If we can't, just go on to the next call */
 		if (qe->chan->cdr)
 			ast_cdr_busy(qe->chan->cdr);
@@ -3138,10 +3139,13 @@
 						stuff = tmpchan;
 						tech = "Local";
 					}
+
+					ast_cel_report_event(in, AST_CEL_FORWARD, NULL, o->chan->call_forward, NULL);
+
 					/* Before processing channel, go ahead and check for forwarding */
 					ast_verb(3, "Now forwarding %s to '%s/%s' (thanks to %s)\n", inchan_name, tech, stuff, ochan_name);
 					/* Setup parameters */
-					o->chan = ast_request(tech, in->nativeformats, stuff, &status);
+					o->chan = ast_request(tech, in->nativeformats, in, stuff, &status);
 					if (!o->chan) {
 						ast_log(LOG_NOTICE, "Unable to create local channel for call forward to '%s/%s'\n", tech, stuff);
 						o->stillgoing = 0;
@@ -7483,7 +7487,8 @@
 		ast_log(LOG_WARNING, "devicestate taskprocessor reference failed - devicestate notifications will not occur\n");
 	}
 
-	if (!(device_state_sub = ast_event_subscribe(AST_EVENT_DEVICE_STATE, device_state_cb, NULL, AST_EVENT_IE_END))) {
+	/* in the following subscribe call, do I use DEVICE_STATE, or DEVICE_STATE_CHANGE? */
+	if (!(device_state_sub = ast_event_subscribe(AST_EVENT_DEVICE_STATE, device_state_cb, "AppQueue Device state", NULL, AST_EVENT_IE_END))) {
 		res = -1;
 	}
 

Modified: team/snuffy/ao2_jabber_take2/apps/app_stack.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/snuffy/ao2_jabber_take2/apps/app_stack.c?view=diff&rev=203906&r1=203905&r2=203906
==============================================================================
--- team/snuffy/ao2_jabber_take2/apps/app_stack.c (original)
+++ team/snuffy/ao2_jabber_take2/apps/app_stack.c Fri Jun 26 19:35:59 2009
@@ -642,7 +642,7 @@
 	return RESULT_SUCCESS;
 }
 
-struct agi_command gosub_agi_command =
+static struct agi_command gosub_agi_command =
 	{ { "gosub", NULL }, handle_gosub, NULL, NULL, 0 };
 
 static int unload_module(void)

Modified: team/snuffy/ao2_jabber_take2/apps/app_voicemail.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/snuffy/ao2_jabber_take2/apps/app_voicemail.c?view=diff&rev=203906&r1=203905&r2=203906
==============================================================================
--- team/snuffy/ao2_jabber_take2/apps/app_voicemail.c (original)
+++ team/snuffy/ao2_jabber_take2/apps/app_voicemail.c Fri Jun 26 19:35:59 2009
@@ -4105,7 +4105,7 @@
 
 	if (!ast_strlen_zero(fromstring)) {
 		struct ast_channel *ast;
-		if ((ast = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, "", "", "", 0, "Substitution/voicemail"))) {
+		if ((ast = ast_dummy_channel_alloc())) {
 			char *ptr;
 			prep_email_sub_vars(ast, vmu, msgnum + 1, context, mailbox, fromfolder, enc_cidnum, enc_cidname, dur, date, category, flag);
 			ast_str_substitute_variables(&str1, 0, ast, fromstring);
@@ -4151,7 +4151,7 @@
 	if (!ast_strlen_zero(emailsubject) || !ast_strlen_zero(vmu->emailsubject)) {
 		char *e_subj = !ast_strlen_zero(vmu->emailsubject) ? vmu->emailsubject : emailsubject;
 		struct ast_channel *ast;
-		if ((ast = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, "", "", "", 0, "Substitution/voicemail"))) {
+		if ((ast = ast_dummy_channel_alloc())) {
 			prep_email_sub_vars(ast, vmu, msgnum + 1, context, mailbox, fromfolder, cidnum, cidname, dur, date, category, flag);
 			ast_str_substitute_variables(&str1, 0, ast, e_subj);
 			if (check_mime(ast_str_buffer(str1))) {
@@ -4234,7 +4234,7 @@
 	if (emailbody || vmu->emailbody) {
 		char* e_body = vmu->emailbody ? vmu->emailbody : emailbody;
 		struct ast_channel *ast;
-		if ((ast = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, "", "", "", 0, "Substitution/voicemail"))) {
+		if ((ast = ast_dummy_channel_alloc())) {
 			prep_email_sub_vars(ast, vmu, msgnum + 1, context, mailbox, fromfolder, cidnum, cidname, dur, date, category, flag);
 			ast_str_substitute_variables(&str1, 0, ast, e_body);
 			fprintf(p, "%s" ENDL, ast_str_buffer(str1));
@@ -4434,7 +4434,7 @@
 
 	if (!ast_strlen_zero(pagerfromstring)) {
 		struct ast_channel *ast;
-		if ((ast = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, "", "", "", 0, "Substitution/voicemail"))) {
+		if ((ast = ast_dummy_channel_alloc())) {
 			char *ptr;
 			prep_email_sub_vars(ast, vmu, msgnum + 1, context, mailbox, fromfolder, enc_cidnum, enc_cidname, dur, date, category, flag);
 			ast_str_substitute_variables(&str1, 0, ast, pagerfromstring);
@@ -4479,7 +4479,7 @@
 
 	if (!ast_strlen_zero(pagersubject)) {
 		struct ast_channel *ast;
-		if ((ast = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, "", "", "", 0, "Substitution/voicemail"))) {
+		if ((ast = ast_dummy_channel_alloc())) {
 			prep_email_sub_vars(ast, vmu, msgnum + 1, context, mailbox, fromfolder, cidnum, cidname, dur, date, category, flag);
 			ast_str_substitute_variables(&str1, 0, ast, pagersubject);
 			if (check_mime(ast_str_buffer(str1))) {
@@ -4512,7 +4512,7 @@
 	ast_strftime(date, sizeof(date), "%A, %B %d, %Y at %r", &tm);
 	if (pagerbody) {
 		struct ast_channel *ast;
-		if ((ast = ast_channel_alloc(0, AST_STATE_DOWN, 0, 0, "", "", "", 0, "Substitution/voicemail"))) {
+		if ((ast = ast_dummy_channel_alloc())) {
 			prep_email_sub_vars(ast, vmu, msgnum + 1, context, mailbox, fromfolder, cidnum, cidname, dur, date, category, flag);
 			ast_str_substitute_variables(&str1, 0, ast, pagerbody);
 			fprintf(p, "%s" ENDL, ast_str_buffer(str1));
@@ -10254,11 +10254,11 @@
 
 static void start_poll_thread(void)
 {
-	mwi_sub_sub = ast_event_subscribe(AST_EVENT_SUB, mwi_sub_event_cb, NULL,
+	mwi_sub_sub = ast_event_subscribe(AST_EVENT_SUB, mwi_sub_event_cb, "Voicemail MWI subscription", NULL,
 		AST_EVENT_IE_EVENTTYPE, AST_EVENT_IE_PLTYPE_UINT, AST_EVENT_MWI,
 		AST_EVENT_IE_END);
 
-	mwi_unsub_sub = ast_event_subscribe(AST_EVENT_UNSUB, mwi_unsub_event_cb, NULL,
+	mwi_unsub_sub = ast_event_subscribe(AST_EVENT_UNSUB, mwi_unsub_event_cb, "Voicemail MWI subscription", NULL,
 		AST_EVENT_IE_EVENTTYPE, AST_EVENT_IE_PLTYPE_UINT, AST_EVENT_MWI,
 		AST_EVENT_IE_END);
 
@@ -10750,8 +10750,9 @@
 		if ((val = ast_variable_retrieve(cfg, "general", "minsecs"))) {
 			if (sscanf(val, "%d", &x) == 1) {
 				vmminsecs = x;
-				if (maxsilence <= vmminsecs)
+				if (maxsilence / 1000 >= vmminsecs) {
 					ast_log(AST_LOG_WARNING, "maxsilence should be less than minmessage or you may get empty messages\n");
+				}
 			} else {
 				ast_log(AST_LOG_WARNING, "Invalid min message time length\n");
 			}
@@ -10763,8 +10764,9 @@
 			}
 			if (sscanf(val, "%d", &x) == 1) {
 				vmminsecs = x;
-				if (maxsilence <= vmminsecs)
+				if (maxsilence / 1000 >= vmminsecs) {
 					ast_log(AST_LOG_WARNING, "maxsilence should be less than minmessage or you may get empty messages\n");
+				}
 			} else {
 				ast_log(AST_LOG_WARNING, "Invalid min message time length\n");
 			}

Modified: team/snuffy/ao2_jabber_take2/bridges/bridge_builtin_features.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/snuffy/ao2_jabber_take2/bridges/bridge_builtin_features.c?view=diff&rev=203906&r1=203905&r2=203906
==============================================================================
--- team/snuffy/ao2_jabber_take2/bridges/bridge_builtin_features.c (original)
+++ team/snuffy/ao2_jabber_take2/bridges/bridge_builtin_features.c Fri Jun 26 19:35:59 2009
@@ -75,7 +75,7 @@
 	snprintf(destination, sizeof(destination), "%s@%s", exten, context);
 
 	/* Now we request that chan_local prepare to call the destination */
-	if (!(chan = ast_request("Local", caller->nativeformats, destination, &cause))) {
+	if (!(chan = ast_request("Local", caller->nativeformats, caller, destination, &cause))) {
 		return NULL;
 	}
 

Modified: team/snuffy/ao2_jabber_take2/build_tools/menuselect-deps.in
URL: http://svn.asterisk.org/svn-view/asterisk/team/snuffy/ao2_jabber_take2/build_tools/menuselect-deps.in?view=diff&rev=203906&r1=203905&r2=203906
==============================================================================
--- team/snuffy/ao2_jabber_take2/build_tools/menuselect-deps.in (original)
+++ team/snuffy/ao2_jabber_take2/build_tools/menuselect-deps.in Fri Jun 26 19:35:59 2009
@@ -49,6 +49,7 @@
 SS7=@PBX_SS7@
 OPENSSL=@PBX_OPENSSL@
 SUPPSERV=@PBX_SUPPSERV@
+SYSLOG=@PBX_SYSLOG@
 TONEZONE=@PBX_TONEZONE@
 UNIXODBC=@PBX_UNIXODBC@
 USB=@PBX_USB@

Modified: team/snuffy/ao2_jabber_take2/cdr/cdr_custom.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/snuffy/ao2_jabber_take2/cdr/cdr_custom.c?view=diff&rev=203906&r1=203905&r2=203906
==============================================================================
--- team/snuffy/ao2_jabber_take2/cdr/cdr_custom.c (original)
+++ team/snuffy/ao2_jabber_take2/cdr/cdr_custom.c Fri Jun 26 19:35:59 2009
@@ -124,7 +124,7 @@
 		return -1;
 	}
 
-	dummy = ast_channel_alloc(0, 0, "", "", "", "", "", 0, "Substitution/%p", cdr);
+	dummy = ast_dummy_channel_alloc();
 
 	if (!dummy) {
 		ast_log(LOG_ERROR, "Unable to allocate channel for variable subsitution.\n");

Modified: team/snuffy/ao2_jabber_take2/cdr/cdr_sqlite.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/snuffy/ao2_jabber_take2/cdr/cdr_sqlite.c?view=diff&rev=203906&r1=203905&r2=203906
==============================================================================
--- team/snuffy/ao2_jabber_take2/cdr/cdr_sqlite.c (original)
+++ team/snuffy/ao2_jabber_take2/cdr/cdr_sqlite.c Fri Jun 26 19:35:59 2009
@@ -184,7 +184,7 @@
 	if (!db) {
 		ast_log(LOG_ERROR, "cdr_sqlite: %s\n", zErr);
 		ast_free(zErr);
-		return -1;
+		return AST_MODULE_LOAD_DECLINE;
 	}
 
 	/* is the table there? */
@@ -203,14 +203,14 @@
 	res = ast_cdr_register(name, ast_module_info->description, sqlite_log);
 	if (res) {
 		ast_log(LOG_ERROR, "Unable to register SQLite CDR handling\n");
-		return -1;
-	}
-	return 0;
+		return AST_MODULE_LOAD_DECLINE;
+	}
+	return AST_MODULE_LOAD_SUCCESS;
 
 err:
 	if (db)
 		sqlite_close(db);
-	return -1;
+	return AST_MODULE_LOAD_DECLINE;
 }
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "SQLite CDR Backend");

Modified: team/snuffy/ao2_jabber_take2/cdr/cdr_sqlite3_custom.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/snuffy/ao2_jabber_take2/cdr/cdr_sqlite3_custom.c?view=diff&rev=203906&r1=203905&r2=203906
==============================================================================
--- team/snuffy/ao2_jabber_take2/cdr/cdr_sqlite3_custom.c (original)
+++ team/snuffy/ao2_jabber_take2/cdr/cdr_sqlite3_custom.c Fri Jun 26 19:35:59 2009
@@ -241,7 +241,7 @@
 		struct ast_channel *dummy;
 		struct ast_str *value_string = ast_str_create(1024);
 
-		dummy = ast_channel_alloc(0, 0, "", "", "", "", "", 0, "Substitution/%p", cdr);
+		dummy = ast_dummy_channel_alloc();
 		if (!dummy) {
 			ast_log(LOG_ERROR, "Unable to allocate channel for variable subsitution.\n");
 			ast_free(value_string);

Propchange: team/snuffy/ao2_jabber_take2/cel/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Jun 26 19:35:59 2009
@@ -1,0 +1,10 @@
+*.a
+*.d
+*.eo
+*.eoo
+*.i
+*.makeopts
+*.moduleinfo
+*.s
+*.so
+modules.link

Modified: team/snuffy/ao2_jabber_take2/channels/chan_agent.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/snuffy/ao2_jabber_take2/channels/chan_agent.c?view=diff&rev=203906&r1=203905&r2=203906
==============================================================================
--- team/snuffy/ao2_jabber_take2/channels/chan_agent.c (original)
+++ team/snuffy/ao2_jabber_take2/channels/chan_agent.c Fri Jun 26 19:35:59 2009
@@ -310,7 +310,7 @@
 } while(0)
 
 /*--- Forward declarations */
-static struct ast_channel *agent_request(const char *type, int format, void *data, int *cause);
+static struct ast_channel *agent_request(const char *type, int format, const struct ast_channel *requestor, void *data, int *cause);
 static int agent_devicestate(void *data);
 static int agent_digit_begin(struct ast_channel *ast, char digit);
 static int agent_digit_end(struct ast_channel *ast, char digit, unsigned int duration);
@@ -986,7 +986,7 @@
 }
 
 /*! \brief Create new agent channel */
-static struct ast_channel *agent_new(struct agent_pvt *p, int state)
+static struct ast_channel *agent_new(struct agent_pvt *p, int state, const char *linkedid)
 {
 	struct ast_channel *tmp;
 	int alreadylocked;
@@ -997,9 +997,9 @@
 	}
 #endif	
 	if (p->pending)
-		tmp = ast_channel_alloc(0, state, 0, 0, "", p->chan ? p->chan->exten:"", p->chan ? p->chan->context:"", 0, "Agent/P%s-%d", p->agent, (int) ast_random() & 0xffff);
+		tmp = ast_channel_alloc(0, state, 0, 0, "", p->chan ? p->chan->exten:"", p->chan ? p->chan->context:"", linkedid, 0, "Agent/P%s-%d", p->agent, (int) ast_random() & 0xffff);
 	else
-		tmp = ast_channel_alloc(0, state, 0, 0, "", p->chan ? p->chan->exten:"", p->chan ? p->chan->context:"", 0, "Agent/%s", p->agent);
+		tmp = ast_channel_alloc(0, state, 0, 0, "", p->chan ? p->chan->exten:"", p->chan ? p->chan->context:"", linkedid, 0, "Agent/%s", p->agent);
 	if (!tmp) {
 		ast_log(LOG_WARNING, "Unable to allocate agent channel structure\n");
 		return NULL;
@@ -1249,7 +1249,7 @@
 		if (!p->abouttograb && p->pending && ((p->group && (newlyavailable->group & p->group)) || !strcmp(p->agent, newlyavailable->agent))) {
 			ast_debug(1, "Call '%s' looks like a winner for agent '%s'\n", p->owner->name, newlyavailable->agent);
 			/* We found a pending call, time to merge */
-			chan = agent_new(newlyavailable, AST_STATE_DOWN);
+			chan = agent_new(newlyavailable, AST_STATE_DOWN, p->owner ? p->owner->linkedid : NULL);
 			parent = p->owner;
 			p->abouttograb = 1;
 			ast_mutex_unlock(&p->lock);
@@ -1334,7 +1334,7 @@
 }
 
 /*! \brief Part of the Asterisk PBX interface */
-static struct ast_channel *agent_request(const char *type, int format, void *data, int *cause)
+static struct ast_channel *agent_request(const char *type, int format, const struct ast_channel* requestor, void *data, int *cause)
 {
 	struct agent_pvt *p;
 	struct ast_channel *chan = NULL;
@@ -1367,7 +1367,7 @@
 				/* Agent must be registered, but not have any active call, and not be in a waiting state */
 				if (!p->owner && p->chan) {
 					/* Fixed agent */
-					chan = agent_new(p, AST_STATE_DOWN);
+					chan = agent_new(p, AST_STATE_DOWN, requestor ? requestor->linkedid : NULL);
 				}
 				if (chan) {
 					ast_mutex_unlock(&p->lock);
@@ -1390,7 +1390,7 @@
 					/* Agent must be registered, but not have any active call, and not be in a waiting state */
 					if (!p->owner && p->chan) {
 						/* Could still get a fixed agent */
-						chan = agent_new(p, AST_STATE_DOWN);
+						chan = agent_new(p, AST_STATE_DOWN, requestor ? requestor->linkedid : NULL);
 					}
 					if (chan) {
 						ast_mutex_unlock(&p->lock);
@@ -1409,7 +1409,7 @@
 			ast_debug(1, "Creating place holder for '%s'\n", s);
 			p = add_agent(data, 1);
 			p->group = groupmatch;
-			chan = agent_new(p, AST_STATE_DOWN);
+			chan = agent_new(p, AST_STATE_DOWN, requestor ? requestor->linkedid : NULL);
 			if (!chan) 
 				ast_log(LOG_WARNING, "Weird...  Fix this to drop the unused pending agent\n");
 		} else {

Modified: team/snuffy/ao2_jabber_take2/channels/chan_alsa.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/snuffy/ao2_jabber_take2/channels/chan_alsa.c?view=diff&rev=203906&r1=203905&r2=203906

[... 11420 lines stripped ...]



More information about the asterisk-commits mailing list