[asterisk-commits] kharwell: branch kharwell/pimp_sip_media_neg r385164 - in /team/kharwell/pimp...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Apr 9 17:23:37 CDT 2013


Author: kharwell
Date: Tue Apr  9 17:23:33 2013
New Revision: 385164

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=385164
Log:
Multiple revisions 384918,384920,384967,384975,384992,385052,385090,385107,385110,385125,385144

........
  r384918 | root | 2013-04-08 10:17:46 -0500 (Mon, 08 Apr 2013) | 19 lines
  
  Add multi-channel Stasis messages; refactor Dial AMI events to Stasis
  
  This patch does the following:
   * A new Stasis payload has been defined for multi-channel messages. This
     payload can store multiple ast_channel_snapshot objects along with a single
     JSON blob. The payload object itself is opaque; the snapshots are stored
     in a container keyed by roles. APIs have been provided to query for and
     retrieve the snapshots from the payload object.
   * The Dial AMI events have been refactored onto Stasis. This includes dial
     messages in app_dial, as well as the core dialing framework. The AMI events
     have been modified to send out a DialBegin/DialEnd events, as opposed to
     the subevent type that was previously used.
   * Stasis messages, types, and other objects related to channels have been
     placed in their own file, stasis_channels. Unit tests for some of these
     objects/messages have also been written.
  ........
  
  Merged revisions 384910 from file:///srv/subversion/repos/asterisk/trunk
........
  r384920 | mmichelson | 2013-04-08 10:18:18 -0500 (Mon, 08 Apr 2013) | 6 lines
  
  Add outbound authentication support.
  
  This adds module outbound authentication and a digest module that uses
  PJSIP's auth_client API.
........
  r384967 | mmichelson | 2013-04-08 11:25:10 -0500 (Mon, 08 Apr 2013) | 3 lines
  
  Remove automerge props that were merged during outbound_auth merge.
........
  r384975 | root | 2013-04-08 12:17:22 -0500 (Mon, 08 Apr 2013) | 11 lines
  
  Don't attempt a websocket protocol removal if res_http_websocket isn't there
  
  This patch sets the protocols container provided by res_http_websocket to NULL
  when the module gets unloaded and adds the necessary checks when adding/
  removing a websocket protocol. This prevents some FRACKing on an invalid
  pointer to the disposed container if a module that uses res_http_websocket is
  unloaded after it.
  ........
  
  Merged revisions 384942 from file:///srv/subversion/repos/asterisk/trunk
........
  r384992 | root | 2013-04-08 14:17:44 -0500 (Mon, 08 Apr 2013) | 7 lines
  
  Clean up Makefile "warning" clutter when makeopts doesn't exist.
  
  Review: https://reviewboard.asterisk.org/r/2304
  ........
  
  Merged revisions 384989 from file:///srv/subversion/repos/asterisk/trunk
........
  r385052 | root | 2013-04-08 19:17:38 -0500 (Mon, 08 Apr 2013) | 13 lines
  
  Modified the list of keys for the driver backends for sake of sample clarity
  
  Added a line showing the mapping of "mysql" to res_config_mysql available in add-ons. We used "mysql" as an example driver key in the sample, but didn't show what module it mapped too. Also added a subtitle above the list of keys for driver backends.
  ........
  
  Merged revisions 385047 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 385048 from http://svn.asterisk.org/svn/asterisk/branches/11
  ........
  
  Merged revisions 385049 from file:///srv/subversion/repos/asterisk/trunk
........
  r385090 | root | 2013-04-09 01:17:38 -0500 (Tue, 09 Apr 2013) | 11 lines
  
  Add inheritance support to FEATURE()/FEATUREMAP().
  
  The settings saved on the channel for FEATURE()/FEATUREMAP() were only
  for that channel.  This patch adds the ability to have these settings
  inherited to child channels if you set FEATURE(inherit)=yes.
  
  Review: https://reviewboard.asterisk.org/r/2415/
  ........
  
  Merged revisions 385088 from file:///srv/subversion/repos/asterisk/trunk
........
  r385107 | file | 2013-04-09 09:53:54 -0500 (Tue, 09 Apr 2013) | 2 lines
  
  Now that res_sorcery_astdb is in trunk make the default for contacts to be astdb so they are persisted across restarts.
........
  r385110 | file | 2013-04-09 10:24:03 -0500 (Tue, 09 Apr 2013) | 2 lines
  
  Be more tolerate within res_sip_session of res_sip failing to load properly, plus I want Bamboo to run for kicks.
........
  r385125 | root | 2013-04-09 14:17:40 -0500 (Tue, 09 Apr 2013) | 9 lines
  
  Backported app_stasis fix from stasis-http branch.
  
  The hash and compare functions for the control container was reusing
  the wrong ones, causing some problems. I fixed it, but in the wrong
  branch. Oh well, it happens.
  ........
  
  Merged revisions 385116 from file:///srv/subversion/repos/asterisk/trunk
........
  r385144 | root | 2013-04-09 15:17:38 -0500 (Tue, 09 Apr 2013) | 7 lines
  
  Rename struct feature_ds to struct feature_datastore.
  
  Because "struct feature_ds *feature_ds" is not a good thing.
  ........
  
  Merged revisions 385142 from file:///srv/subversion/repos/asterisk/trunk
........

Merged revisions 384918,384920,384967,384975,384992,385052,385090,385107,385110,385125,385144 from http://svn.asterisk.org/svn/asterisk/team/group/pimp_my_sip

Added:
    team/kharwell/pimp_sip_media_neg/include/asterisk/stasis_channels.h
      - copied unchanged from r385144, team/group/pimp_my_sip/include/asterisk/stasis_channels.h
    team/kharwell/pimp_sip_media_neg/main/stasis_channels.c
      - copied unchanged from r385144, team/group/pimp_my_sip/main/stasis_channels.c
    team/kharwell/pimp_sip_media_neg/res/res_sip/sip_outbound_auth.c
      - copied unchanged from r385144, team/group/pimp_my_sip/res/res_sip/sip_outbound_auth.c
    team/kharwell/pimp_sip_media_neg/res/res_sip_outbound_authenticator_digest.c
      - copied unchanged from r385144, team/group/pimp_my_sip/res/res_sip_outbound_authenticator_digest.c
    team/kharwell/pimp_sip_media_neg/tests/test_stasis_channels.c
      - copied unchanged from r385144, team/group/pimp_my_sip/tests/test_stasis_channels.c
Modified:
    team/kharwell/pimp_sip_media_neg/   (props changed)
    team/kharwell/pimp_sip_media_neg/CHANGES
    team/kharwell/pimp_sip_media_neg/Makefile
    team/kharwell/pimp_sip_media_neg/apps/app_dial.c
    team/kharwell/pimp_sip_media_neg/apps/app_stasis.c
    team/kharwell/pimp_sip_media_neg/apps/app_userevent.c
    team/kharwell/pimp_sip_media_neg/apps/stasis_json.c
    team/kharwell/pimp_sip_media_neg/build_tools/make_buildopts_h
    team/kharwell/pimp_sip_media_neg/build_tools/make_linker_version_script
    team/kharwell/pimp_sip_media_neg/build_tools/make_version
    team/kharwell/pimp_sip_media_neg/build_tools/mkpkgconfig
    team/kharwell/pimp_sip_media_neg/channels/chan_gulp.c
    team/kharwell/pimp_sip_media_neg/configs/extconfig.conf.sample
    team/kharwell/pimp_sip_media_neg/include/asterisk/app_stasis.h
    team/kharwell/pimp_sip_media_neg/include/asterisk/channel.h
    team/kharwell/pimp_sip_media_neg/include/asterisk/res_sip.h
    team/kharwell/pimp_sip_media_neg/main/channel.c
    team/kharwell/pimp_sip_media_neg/main/channel_internal_api.c
    team/kharwell/pimp_sip_media_neg/main/dial.c
    team/kharwell/pimp_sip_media_neg/main/features.c
    team/kharwell/pimp_sip_media_neg/main/manager_channels.c
    team/kharwell/pimp_sip_media_neg/main/pbx.c
    team/kharwell/pimp_sip_media_neg/pbx/pbx_realtime.c
    team/kharwell/pimp_sip_media_neg/res/res_http_websocket.c
    team/kharwell/pimp_sip_media_neg/res/res_sip.c
    team/kharwell/pimp_sip_media_neg/res/res_sip.exports.in
    team/kharwell/pimp_sip_media_neg/res/res_sip/include/res_sip_private.h
    team/kharwell/pimp_sip_media_neg/res/res_sip/location.c
    team/kharwell/pimp_sip_media_neg/res/res_sip/sip_configuration.c
    team/kharwell/pimp_sip_media_neg/res/res_sip/sip_distributor.c
    team/kharwell/pimp_sip_media_neg/res/res_sip/sip_options.c
    team/kharwell/pimp_sip_media_neg/res/res_sip_authenticator_digest.c
    team/kharwell/pimp_sip_media_neg/res/res_sip_session.c
    team/kharwell/pimp_sip_media_neg/res/res_stasis_websocket.c

Propchange: team/kharwell/pimp_sip_media_neg/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/kharwell/pimp_sip_media_neg/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Propchange: team/kharwell/pimp_sip_media_neg/
------------------------------------------------------------------------------
--- pimp_sip_media_neg-integrated (original)
+++ pimp_sip_media_neg-integrated Tue Apr  9 17:23:33 2013
@@ -1,1 +1,1 @@
-/team/group/pimp_my_sip:1-384893
+/team/group/pimp_my_sip:1-385163

Propchange: team/kharwell/pimp_sip_media_neg/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Apr  9 17:23:33 2013
@@ -1,1 +1,1 @@
-/trunk:1-384890
+/trunk:1-385143

Modified: team/kharwell/pimp_sip_media_neg/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/kharwell/pimp_sip_media_neg/CHANGES?view=diff&rev=385164&r1=385163&r2=385164
==============================================================================
--- team/kharwell/pimp_sip_media_neg/CHANGES (original)
+++ team/kharwell/pimp_sip_media_neg/CHANGES Tue Apr  9 17:23:33 2013
@@ -53,6 +53,12 @@
  * The deprecated use of | (pipe) as a separator in the channelvars setting in
    manager.conf has been removed.
 
+ * Channel Variables conveyed with a channel no longer contain the name of the
+   channel as part of the key field, i.e., ChanVariable(SIP/foo): bar=baz is now
+   ChanVariable: bar=baz. When multiple channels are present in a single AMI
+   event, the various ChanVariable fields will contain a suffix that specifies
+   which channel they correspond to.
+
 Channel Drivers
 ------------------
 
@@ -82,6 +88,10 @@
 
  * PARKINGSLOT and PARKEDLOT channel variables will now be set for a parked
    channel even when comebactoorigin=yes
+
+ * You can now have the settings for a channel updated using the FEATURE()
+   and FEATUREMAP() functions inherited to child channels by setting
+   FEATURE(inherit)=yes.
 
 Logging
 -------------------

Modified: team/kharwell/pimp_sip_media_neg/Makefile
URL: http://svnview.digium.com/svn/asterisk/team/kharwell/pimp_sip_media_neg/Makefile?view=diff&rev=385164&r1=385163&r2=385164
==============================================================================
--- team/kharwell/pimp_sip_media_neg/Makefile (original)
+++ team/kharwell/pimp_sip_media_neg/Makefile Tue Apr  9 17:23:33 2013
@@ -81,6 +81,8 @@
                           # should go directly to ASTLDFLAGS
 
 #--- paths to various commands
+# The makeopts include below tries to set these if they're found during
+# configure.
 export CC
 export CXX
 export AR
@@ -221,10 +223,13 @@
   _ASTCFLAGS+=-Wcast-align -DSOLARIS -I../include/solaris-compat -I/opt/ssl/include -I/usr/local/ssl/include -D_XPG4_2 -D__EXTENSIONS__
 endif
 
-ASTERISKVERSION:=$(shell GREP=$(GREP) AWK=$(AWK) GIT=$(GIT) build_tools/make_version .)
-
-ifneq ($(wildcard .version),)
-  ASTERISKVERSIONNUM:=$(shell $(AWK) -F. '{printf "%01d%02d%02d", $$1, $$2, $$3}' .version)
+ifneq ($(GREP),)
+  ASTERISKVERSION:=$(shell GREP=$(GREP) AWK=$(AWK) GIT=$(GIT) build_tools/make_version .)
+endif
+ifneq ($(AWK),)
+  ifneq ($(wildcard .version),)
+    ASTERISKVERSIONNUM:=$(shell $(AWK) -F. '{printf "%01d%02d%02d", $$1, $$2, $$3}' .version)
+  endif
 endif
 
 ifneq ($(wildcard .svn),)
@@ -450,7 +455,11 @@
 	done
 	$(MAKE) -C sounds install
 
-doc/core-en_US.xml: makeopts cleantest $(foreach dir,$(MOD_SUBDIRS),$(shell $(GREP) -l "language=\"en_US\"" $(dir)/*.c $(dir)/*.cc 2>/dev/null))
+ifneq ($(GREP),)
+  XML_core_en_US = $(foreach dir,$(MOD_SUBDIRS),$(shell $(GREP) -l "language=\"en_US\"" $(dir)/*.c $(dir)/*.cc 2>/dev/null))
+endif
+
+doc/core-en_US.xml: makeopts cleantest $(XML_core_en_US)
 	@printf "Building Documentation For: "
 	@echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > $@
 	@echo "<!DOCTYPE docs SYSTEM \"appdocsxml.dtd\">" >> $@
@@ -464,7 +473,11 @@
 	@echo
 	@echo "</docs>" >> $@
 
-doc/full-en_US.xml: makeopts cleantest $(foreach dir,$(MOD_SUBDIRS),$(shell $(GREP) -l "language=\"en_US\"" $(dir)/*.c $(dir)/*.cc 2>/dev/null))
+ifneq ($(GREP),)
+  XMX_full_en_US = $(foreach dir,$(MOD_SUBDIRS),$(shell $(GREP) -l "language=\"en_US\"" $(dir)/*.c $(dir)/*.cc 2>/dev/null))
+endif
+
+doc/full-en_US.xml: makeopts cleantest $(XML_full_en_US)
 ifeq ($(PYTHON),:)
 	@echo "--------------------------------------------------------------------------"
 	@echo "---        Please install python to build full documentation           ---"

Modified: team/kharwell/pimp_sip_media_neg/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/kharwell/pimp_sip_media_neg/apps/app_dial.c?view=diff&rev=385164&r1=385163&r2=385164
==============================================================================
--- team/kharwell/pimp_sip_media_neg/apps/app_dial.c (original)
+++ team/kharwell/pimp_sip_media_neg/apps/app_dial.c Tue Apr  9 17:23:33 2013
@@ -67,6 +67,7 @@
 #include "asterisk/ccss.h"
 #include "asterisk/indications.h"
 #include "asterisk/framehook.h"
+#include "asterisk/stasis_channels.h"
 
 /*** DOCUMENTATION
 	<application name="Dial" language="en_US">
@@ -818,63 +819,6 @@
 	return ast_get_hint(NULL, 0, name, namelen, chan, context, exten) ? name : "";
 }
 
-static void senddialevent(struct ast_channel *src, struct ast_channel *dst, const char *dialstring)
-{
-	struct ast_channel *chans[] = { src, dst };
-	/*** DOCUMENTATION
-		<managerEventInstance>
-			<synopsis>Raised when a dial action has started.</synopsis>
-			<syntax>
-				<parameter name="SubEvent">
-					<para>A sub event type, specifying whether the dial action has begun or ended.</para>
-					<enumlist>
-						<enum name="Begin"/>
-						<enum name="End"/>
-					</enumlist>
-				</parameter>
-			</syntax>
-		</managerEventInstance>
-	***/
-	ast_manager_event_multichan(EVENT_FLAG_CALL, "Dial", 2, chans,
-		"SubEvent: Begin\r\n"
-		"Channel: %s\r\n"
-		"Destination: %s\r\n"
-		"CallerIDNum: %s\r\n"
-		"CallerIDName: %s\r\n"
-		"ConnectedLineNum: %s\r\n"
-		"ConnectedLineName: %s\r\n"
-		"UniqueID: %s\r\n"
-		"DestUniqueID: %s\r\n"
-		"Dialstring: %s\r\n",
-		ast_channel_name(src), ast_channel_name(dst),
-		S_COR(ast_channel_caller(src)->id.number.valid, ast_channel_caller(src)->id.number.str, "<unknown>"),
-		S_COR(ast_channel_caller(src)->id.name.valid, ast_channel_caller(src)->id.name.str, "<unknown>"),
-		S_COR(ast_channel_connected(src)->id.number.valid, ast_channel_connected(src)->id.number.str, "<unknown>"),
-		S_COR(ast_channel_connected(src)->id.name.valid, ast_channel_connected(src)->id.name.str, "<unknown>"),
-		ast_channel_uniqueid(src), ast_channel_uniqueid(dst),
-		dialstring ? dialstring : "");
-}
-
-static void senddialendevent(struct ast_channel *src, const char *dialstatus)
-{
-	/*** DOCUMENTATION
-		<managerEventInstance>
-			<synopsis>Raised when a dial action has ended.</synopsis>
-			<syntax>
-				<parameter name="DialStatus">
-					<para>The value of the <variable>DIALSTATUS</variable> channel variable.</para>
-				</parameter>
-			</syntax>
-		</managerEventInstance>
-	***/
-	ast_manager_event(src, EVENT_FLAG_CALL, "Dial",
-		"SubEvent: End\r\n"
-		"Channel: %s\r\n"
-		"UniqueID: %s\r\n"
-		"DialStatus: %s\r\n",
-		ast_channel_name(src), ast_channel_uniqueid(src), dialstatus);
-}
-
 /*!
  * helper function for wait_for_answer()
  *
@@ -1069,7 +1013,7 @@
 			num->nochan++;
 		} else {
 			ast_channel_lock_both(c, in);
-			senddialevent(in, c, stuff);
+			ast_channel_publish_dial(c, in, stuff, NULL);
 			ast_channel_unlock(in);
 			ast_channel_unlock(c);
 			/* Hangup the original channel now, in case we needed it */
@@ -1089,6 +1033,33 @@
 	char privintro[1024];
 	char status[256];
 };
+
+static const char *hangup_cause_to_dial_status(int hangup_cause)
+{
+	switch(hangup_cause) {
+	case AST_CAUSE_BUSY:
+		return "BUSY";
+	case AST_CAUSE_CONGESTION:
+		return "CONGESTION";
+	case AST_CAUSE_NO_ROUTE_DESTINATION:
+	case AST_CAUSE_UNREGISTERED:
+		return "CHANUNAVAIL";
+	case AST_CAUSE_NO_ANSWER:
+	default:
+		return "NOANSWER";
+	}
+}
+
+static void publish_dial_end_event(struct ast_channel *in, struct dial_head *out_chans, struct ast_channel *exception, const char *status)
+{
+	struct chanlist *outgoing;
+	AST_LIST_TRAVERSE(out_chans, outgoing, node) {
+		if (!outgoing->chan || outgoing->chan == exception) {
+			continue;
+		}
+		ast_channel_publish_dial(in, outgoing->chan, NULL, status);
+	}
+}
 
 static struct ast_channel *wait_for_answer(struct ast_channel *in,
 	struct dial_head *out_chans, int *to, struct ast_flags64 *peerflags,
@@ -1133,6 +1104,7 @@
 				*to = -1;
 				strcpy(pa->status, "CONGESTION");
 				ast_cdr_failed(ast_channel_cdr(in));
+				ast_channel_publish_dial(in, outgoing->chan, NULL, pa->status);
 				return NULL;
 			}
 		}
@@ -1293,6 +1265,7 @@
 #ifdef HAVE_EPOLL
 				ast_poll_channel_del(in, c);
 #endif
+				ast_channel_publish_dial(in, c, NULL, hangup_cause_to_dial_status(ast_channel_hangupcause(c)));
 				ast_hangup(c);
 				c = o->chan = NULL;
 				ast_clear_flag64(o, DIAL_STILLGOING);
@@ -1333,6 +1306,8 @@
 							}
 						}
 						peer = c;
+						ast_channel_publish_dial(in, peer, NULL, "ANSWER");
+						publish_dial_end_event(in, out_chans, peer, "CANCEL");
 						if (ast_channel_cdr(peer)) {
 							ast_channel_cdr(peer)->answer = ast_tvnow();
 							ast_channel_cdr(peer)->disposition = AST_CDR_ANSWERED;
@@ -1346,9 +1321,10 @@
 							DIAL_NOFORWARDHTML);
 						ast_channel_dialcontext_set(c, "");
 						ast_channel_exten_set(c, "");
-						if (CAN_EARLY_BRIDGE(peerflags, in, peer))
+						if (CAN_EARLY_BRIDGE(peerflags, in, peer)) {
 							/* Setup early bridge if appropriate */
 							ast_channel_early_bridge(in, peer);
+						}
 					}
 					/* If call has been answered, then the eventual hangup is likely to be normal hangup */
 					ast_channel_hangupcause_set(in, AST_CAUSE_NORMAL_CLEARING);
@@ -1357,6 +1333,7 @@
 				case AST_CONTROL_BUSY:
 					ast_verb(3, "%s is busy\n", ast_channel_name(c));
 					ast_channel_hangupcause_set(in, ast_channel_hangupcause(c));
+					ast_channel_publish_dial(in, c, NULL, hangup_cause_to_dial_status(ast_channel_hangupcause(c)));
 					ast_hangup(c);
 					c = o->chan = NULL;
 					ast_clear_flag64(o, DIAL_STILLGOING);
@@ -1365,6 +1342,7 @@
 				case AST_CONTROL_CONGESTION:
 					ast_verb(3, "%s is circuit-busy\n", ast_channel_name(c));
 					ast_channel_hangupcause_set(in, ast_channel_hangupcause(c));
+					ast_channel_publish_dial(in, c, NULL, hangup_cause_to_dial_status(ast_channel_hangupcause(c)));
 					ast_hangup(c);
 					c = o->chan = NULL;
 					ast_clear_flag64(o, DIAL_STILLGOING);
@@ -1572,6 +1550,7 @@
 				*to = -1;
 				strcpy(pa->status, "CANCEL");
 				ast_cdr_noanswer(ast_channel_cdr(in));
+				publish_dial_end_event(in, out_chans, NULL, pa->status);
 				if (f) {
 					if (f->data.uint32) {
 						ast_channel_hangupcause_set(in, f->data.uint32);
@@ -1596,6 +1575,7 @@
 						ast_cdr_noanswer(ast_channel_cdr(in));
 						*result = f->subclass.integer;
 						strcpy(pa->status, "CANCEL");
+						publish_dial_end_event(in, out_chans, NULL, pa->status);
 						ast_frfree(f);
 						ast_channel_unlock(in);
 						if (is_cc_recall) {
@@ -1612,6 +1592,7 @@
 					*to = 0;
 					strcpy(pa->status, "CANCEL");
 					ast_cdr_noanswer(ast_channel_cdr(in));
+					publish_dial_end_event(in, out_chans, NULL, pa->status);
 					ast_frfree(f);
 					if (is_cc_recall) {
 						ast_cc_completed(in, "CC completed, but the caller hung up with DTMF");
@@ -1707,6 +1688,7 @@
 
 	if (!*to) {
 		ast_verb(3, "Nobody picked up in %d ms\n", orig);
+		publish_dial_end_event(in, out_chans, NULL, "NOANSWER");
 	}
 	if (!*to || ast_check_hangup(in)) {
 		ast_cdr_noanswer(ast_channel_cdr(in));
@@ -2621,7 +2603,7 @@
 			continue;
 		}
 
-		senddialevent(chan, tmp->chan, tmp->number);
+		ast_channel_publish_dial(chan, tmp->chan, tmp->number, NULL);
 		ast_channel_unlock(chan);
 
 		ast_verb(3, "Called %s\n", tmp->interface);
@@ -3098,7 +3080,6 @@
 	ast_channel_early_bridge(chan, NULL);
 	hanguptree(&out_chans, NULL, ast_channel_hangupcause(chan)==AST_CAUSE_ANSWERED_ELSEWHERE || ast_test_flag64(&opts, OPT_CANCEL_ELSEWHERE) ? 1 : 0 ); /* forward 'answered elsewhere' if we received it */
 	pbx_builtin_setvar_helper(chan, "DIALSTATUS", pa.status);
-	senddialendevent(chan, pa.status);
 	ast_debug(1, "Exiting with DIALSTATUS=%s.\n", pa.status);
 
 	if ((ast_test_flag64(peerflags, OPT_GO_ON)) && !ast_check_hangup(chan) && (res != AST_PBX_INCOMPLETE)) {

Modified: team/kharwell/pimp_sip_media_neg/apps/app_stasis.c
URL: http://svnview.digium.com/svn/asterisk/team/kharwell/pimp_sip_media_neg/apps/app_stasis.c?view=diff&rev=385164&r1=385163&r2=385164
==============================================================================
--- team/kharwell/pimp_sip_media_neg/apps/app_stasis.c (original)
+++ team/kharwell/pimp_sip_media_neg/apps/app_stasis.c Tue Apr  9 17:23:33 2013
@@ -35,9 +35,11 @@
 #include "asterisk/app_stasis.h"
 #include "asterisk/astobj2.h"
 #include "asterisk/channel.h"
+#include "asterisk/lock.h"
 #include "asterisk/module.h"
 #include "asterisk/stasis.h"
 #include "asterisk/strings.h"
+#include "asterisk/stasis_channels.h"
 
 /*** DOCUMENTATION
 	<application name="Stasis" language="en_US">
@@ -47,7 +49,8 @@
 				<para>Name of the application to invoke.</para>
 			</parameter>
 			<parameter name="args">
-				<para>Optional comma-delimited arguments for the application invocation.</para>
+				<para>Optional comma-delimited arguments for the
+				application invocation.</para>
 			</parameter>
 		</syntax>
 		<description>
@@ -177,7 +180,7 @@
 	 */
 	int continue_to_dialplan:1;
 	/*! Uniqueid of the associated channel */
-	char channel_uniqueid[];
+	char channel_id[];
 };
 
 static struct stasis_app_control *control_create(const char *uniqueid)
@@ -191,9 +194,33 @@
 		return NULL;
 	}
 
-	strncpy(control->channel_uniqueid, uniqueid, size - sizeof(*control));
+	strncpy(control->channel_id, uniqueid, size - sizeof(*control));
 
 	return control;
+}
+
+/*! AO2 hash function for \ref stasis_app_control */
+static int control_hash(const void *obj, const int flags)
+{
+	const struct stasis_app_control *control = obj;
+	const char *id = flags & OBJ_KEY ? obj : control->channel_id;
+
+	return ast_str_hash(id);
+}
+
+/*! AO2 comparison function for \ref stasis_app_control */
+static int control_compare(void *lhs, void *rhs, int flags)
+{
+	const struct stasis_app_control *lhs_control = lhs;
+	const struct stasis_app_control *rhs_control = rhs;
+	const char *rhs_name =
+		flags & OBJ_KEY ? rhs : rhs_control->channel_id;
+
+	if (strcmp(lhs_control->channel_id, rhs_name) == 0) {
+		return CMP_MATCH | CMP_STOP;
+	} else {
+		return 0;
+	}
 }
 
 struct stasis_app_control *stasis_app_control_find_by_channel(
@@ -365,7 +392,8 @@
 	}
 
 	controls = app_controls();
-	ao2_unlink_flags(controls, control, OBJ_POINTER | OBJ_UNLINK | OBJ_NODATA);
+	ao2_unlink_flags(controls, control,
+			 OBJ_POINTER | OBJ_UNLINK | OBJ_NODATA);
 	ao2_cleanup(control);
 }
 
@@ -375,7 +403,8 @@
 	RAII_VAR(struct ao2_container *, apps, apps_registry(), ao2_cleanup);
 	RAII_VAR(struct app *, app, NULL, ao2_cleanup);
 	RAII_VAR(struct stasis_app_control *, control, NULL, control_unlink);
-	RAII_VAR(struct stasis_subscription *, subscription, NULL, stasis_unsubscribe);
+	RAII_VAR(struct stasis_subscription *, subscription, NULL,
+		 stasis_unsubscribe);
 	int res = 0;
 	char *parse = NULL;
 	int hungup = 0;
@@ -399,7 +428,8 @@
 
 	app = ao2_find(apps, args.app_name, OBJ_KEY);
 	if (!app) {
-		ast_log(LOG_ERROR, "Stasis app '%s' not registered\n", args.app_name);
+		ast_log(LOG_ERROR,
+			"Stasis app '%s' not registered\n", args.app_name);
 		return -1;
 	}
 
@@ -415,30 +445,35 @@
 		ao2_link(controls, control);
 	}
 
-	subscription = stasis_subscribe(ast_channel_topic(chan), sub_handler, app);
+	subscription =
+		stasis_subscribe(ast_channel_topic(chan), sub_handler, app);
 	if (subscription == NULL) {
-		ast_log(LOG_ERROR, "Error subscribing app %s to channel %s\n", args.app_name, ast_channel_name(chan));
+		ast_log(LOG_ERROR, "Error subscribing app %s to channel %s\n",
+			args.app_name, ast_channel_name(chan));
 		return -1;
 	}
 	ao2_ref(app, +1); /* subscription now has a reference */
 
 	res = send_start_msg(app, chan, args.argc - 1, args.app_argv);
 	if (res != 0) {
-		ast_log(LOG_ERROR, "Error sending start message to %s\n", args.app_name);
+		ast_log(LOG_ERROR,
+			"Error sending start message to %s\n", args.app_name);
 		return res;
 	}
 
 	while (!hungup && !control_continue_test_and_reset(control) && ast_waitfor(chan, -1) > -1) {
 		RAII_VAR(struct ast_frame *, f, ast_read(chan), ast_frame_dtor);
 		if (!f) {
-			ast_debug(3, "%s: No more frames. Must be done, I guess.\n", ast_channel_uniqueid(chan));
+			ast_debug(3, "%s: No more frames. Must be done, I guess.\n",
+				  ast_channel_uniqueid(chan));
 			break;
 		}
 
 		switch (f->frametype) {
 		case AST_FRAME_CONTROL:
 			if (f->subclass.integer == AST_CONTROL_HANGUP) {
-				ast_debug(3, "%s: Received hangup\n", ast_channel_uniqueid(chan));
+				ast_debug(3, "%s: Received hangup\n",
+					  ast_channel_uniqueid(chan));
 				hungup = 1;
 			}
 			break;
@@ -450,7 +485,8 @@
 
 	res = send_end_msg(app, chan);
 	if (res != 0) {
-		ast_log(LOG_ERROR, "Error sending end message to %s\n", args.app_name);
+		ast_log(LOG_ERROR,
+			"Error sending end message to %s\n", args.app_name);
 		return res;
 	}
 
@@ -465,10 +501,11 @@
 	app = ao2_find(apps, app_name, OBJ_KEY);
 
 	if (!app) {
-		/* XXX We can do a better job handling late binding, queueing up the call for a few seconds
-		 * to wait for the app to register.
+		/* XXX We can do a better job handling late binding, queueing up
+		 * the call for a few seconds to wait for the app to register.
 		 */
-		ast_log(LOG_WARNING, "Stasis app '%s' not registered\n", app_name);
+		ast_log(LOG_WARNING,
+			"Stasis app '%s' not registered\n", app_name);
 		return -1;
 	}
 
@@ -522,12 +559,14 @@
 {
 	int r = 0;
 
-	__apps_registry = ao2_container_alloc(APPS_NUM_BUCKETS, app_hash, app_compare);
+	__apps_registry =
+		ao2_container_alloc(APPS_NUM_BUCKETS, app_hash, app_compare);
 	if (__apps_registry == NULL) {
 		return AST_MODULE_LOAD_FAILURE;
 	}
 
-	__app_controls = ao2_container_alloc(CONTROLS_NUM_BUCKETS, app_hash, app_compare);
+	__app_controls = ao2_container_alloc(CONTROLS_NUM_BUCKETS,
+					     control_hash, control_compare);
 	if (__app_controls == NULL) {
 		return AST_MODULE_LOAD_FAILURE;
 	}
@@ -550,6 +589,7 @@
 	return r;
 }
 
-AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "Stasis dialplan application",
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS,
+		"Stasis dialplan application",
 		.load = load_module,
 		.unload = unload_module);

Modified: team/kharwell/pimp_sip_media_neg/apps/app_userevent.c
URL: http://svnview.digium.com/svn/asterisk/team/kharwell/pimp_sip_media_neg/apps/app_userevent.c?view=diff&rev=385164&r1=385163&r2=385164
==============================================================================
--- team/kharwell/pimp_sip_media_neg/apps/app_userevent.c (original)
+++ team/kharwell/pimp_sip_media_neg/apps/app_userevent.c Tue Apr  9 17:23:33 2013
@@ -34,6 +34,7 @@
 #include "asterisk/manager.h"
 #include "asterisk/app.h"
 #include "asterisk/json.h"
+#include "asterisk/stasis_channels.h"
 
 /*** DOCUMENTATION
 	<application name="UserEvent" language="en_US">

Modified: team/kharwell/pimp_sip_media_neg/apps/stasis_json.c
URL: http://svnview.digium.com/svn/asterisk/team/kharwell/pimp_sip_media_neg/apps/stasis_json.c?view=diff&rev=385164&r1=385163&r2=385164
==============================================================================
--- team/kharwell/pimp_sip_media_neg/apps/stasis_json.c (original)
+++ team/kharwell/pimp_sip_media_neg/apps/stasis_json.c Tue Apr  9 17:23:33 2013
@@ -28,6 +28,7 @@
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
 #include "asterisk/app_stasis.h"
+#include "asterisk/stasis_channels.h"
 
 struct ast_json *ast_channel_snapshot_to_json(const struct ast_channel_snapshot *snapshot)
 {

Modified: team/kharwell/pimp_sip_media_neg/build_tools/make_buildopts_h
URL: http://svnview.digium.com/svn/asterisk/team/kharwell/pimp_sip_media_neg/build_tools/make_buildopts_h?view=diff&rev=385164&r1=385163&r2=385164
==============================================================================
--- team/kharwell/pimp_sip_media_neg/build_tools/make_buildopts_h (original)
+++ team/kharwell/pimp_sip_media_neg/build_tools/make_buildopts_h Tue Apr  9 17:23:33 2013
@@ -1,4 +1,7 @@
 #!/bin/sh
+
+GREP=${GREP:-grep}
+MD5=${MD5:-md5sum}
 
 cat << END
 /*

Modified: team/kharwell/pimp_sip_media_neg/build_tools/make_linker_version_script
URL: http://svnview.digium.com/svn/asterisk/team/kharwell/pimp_sip_media_neg/build_tools/make_linker_version_script?view=diff&rev=385164&r1=385163&r2=385164
==============================================================================
--- team/kharwell/pimp_sip_media_neg/build_tools/make_linker_version_script (original)
+++ team/kharwell/pimp_sip_media_neg/build_tools/make_linker_version_script Tue Apr  9 17:23:33 2013
@@ -1,5 +1,6 @@
 #!/bin/sh
+
+AWK=${AWK:-awk}
 
 test -f ${1}.exports.in && ${AWK} "{sub(\"LINKER_SYMBOL_PREFIX\", \"${2}\"); print;}" ${1}.exports.in > ${1}.exports && exit 0
 test -f ${1}.exports.in || rm -f ${1}.exports && cp ${3}/default.exports ${1}.exports && exit 0
-

Modified: team/kharwell/pimp_sip_media_neg/build_tools/make_version
URL: http://svnview.digium.com/svn/asterisk/team/kharwell/pimp_sip_media_neg/build_tools/make_version?view=diff&rev=385164&r1=385163&r2=385164
==============================================================================
--- team/kharwell/pimp_sip_media_neg/build_tools/make_version (original)
+++ team/kharwell/pimp_sip_media_neg/build_tools/make_version Tue Apr  9 17:23:33 2013
@@ -1,4 +1,8 @@
 #!/bin/sh
+
+AWK=${AWK:-awk}
+GIT=${GIT:-git}
+GREP=${GREP:-grep}
 
 if [ -f ${1}/.version ]; then
     cat ${1}/.version
@@ -92,7 +96,7 @@
     # If the first log commit messages indicates that this is checked into
     # subversion, we'll just use the SVN- form of the revision.
     MODIFIED=""
-    SVN_REV=`${GIT} log --pretty=full -1 | grep -F "git-svn-id:" | sed -e "s/.*\@\([^\s]*\)\s.*/\1/g"`
+    SVN_REV=`${GIT} log --pretty=full -1 | ${GREP} -F "git-svn-id:" | sed -e "s/.*\@\([^\s]*\)\s.*/\1/g"`
     if [ -z "$SVN_REV" ]; then
         VERSION=GIT-`${GIT} describe --long --always --tags --dirty=M 2> /dev/null`
         if [ $? -ne 0 ]; then
@@ -105,7 +109,7 @@
         fi
         echo ${VERSION}
     else
-        PARTS=`LANG=C ${GIT} log --pretty=full | grep -F "git-svn-id:" | head -1 | awk '{print $2;}' | sed -e s:^.*/svn/$2/:: | sed -e 's:/: :g' | sed -e 's/@.*$//g'`
+        PARTS=`LANG=C ${GIT} log --pretty=full | ${GREP} -F "git-svn-id:" | head -1 | ${AWK} '{print $2;}' | sed -e s:^.*/svn/$2/:: | sed -e 's:/: :g' | sed -e 's/@.*$//g'`
         BRANCH=0
         TEAM=0
         TAG=0

Modified: team/kharwell/pimp_sip_media_neg/build_tools/mkpkgconfig
URL: http://svnview.digium.com/svn/asterisk/team/kharwell/pimp_sip_media_neg/build_tools/mkpkgconfig?view=diff&rev=385164&r1=385163&r2=385164
==============================================================================
--- team/kharwell/pimp_sip_media_neg/build_tools/mkpkgconfig (original)
+++ team/kharwell/pimp_sip_media_neg/build_tools/mkpkgconfig Tue Apr  9 17:23:33 2013
@@ -1,5 +1,6 @@
 #!/bin/sh
 PPATH="$1"
+GREP=${GREP:-grep}
 ## Make sure we were called from Makefile
 
 if [ "x$ASTERISKVERSIONNUM" = "x" ]; then

Modified: team/kharwell/pimp_sip_media_neg/channels/chan_gulp.c
URL: http://svnview.digium.com/svn/asterisk/team/kharwell/pimp_sip_media_neg/channels/chan_gulp.c?view=diff&rev=385164&r1=385163&r2=385164
==============================================================================
--- team/kharwell/pimp_sip_media_neg/channels/chan_gulp.c (original)
+++ team/kharwell/pimp_sip_media_neg/channels/chan_gulp.c Tue Apr  9 17:23:33 2013
@@ -848,8 +848,19 @@
 	};
 
 	struct ast_sip_session *session = data;
-	if (ast_sip_send_request("INFO", &body, session->inv_session->dlg, NULL) != PJ_SUCCESS) {
+	struct pjsip_tx_data *tdata;
+
+	if (ast_sip_create_request("INFO", session->inv_session->dlg, session->endpoint, NULL, &tdata)) {
+		ast_log(LOG_ERROR, "Could not create text video update INFO request\n");
+		return -1;
+	}
+	if (ast_sip_add_body(tdata, &body)) {
+		ast_log(LOG_ERROR, "Could not add body to text video update INFO request\n");
+		return -1;
+	}
+	if (ast_sip_send_request(tdata, session->inv_session->dlg, session->endpoint)) {
 		ast_log(LOG_ERROR, "Could not send text video update INFO request\n");
+		return -1;
 	}
 
 	return 0;

Modified: team/kharwell/pimp_sip_media_neg/configs/extconfig.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/kharwell/pimp_sip_media_neg/configs/extconfig.conf.sample?view=diff&rev=385164&r1=385163&r2=385164
==============================================================================
--- team/kharwell/pimp_sip_media_neg/configs/extconfig.conf.sample (original)
+++ team/kharwell/pimp_sip_media_neg/configs/extconfig.conf.sample Tue Apr  9 17:23:33 2013
@@ -58,13 +58,17 @@
 ; start at 1 and be sequential (i.e. if you have only priorities 1, 2,
 ; and 4, then 4 will be ignored, because there is no 3).
 ;
+;
+; Possible driver backends:
+;
 ; "odbc" is shown in the examples below, but is not the only valid realtime
-; engine.  There is:
+; engine.  Here are several of the possible options:
 ;    odbc ... res_config_odbc
 ;    sqlite ... res_config_sqlite
 ;    pgsql ... res_config_pgsql
 ;    curl ... res_config_curl
 ;    ldap ... res_config_ldap
+;    mysql ... res_config_mysql (available via add-ons in menuselect)
 ;
 ; Note: The res_config_pgsql and res_config_sqlite backends configure the
 ; database used in their respective configuration files and ignore the

Modified: team/kharwell/pimp_sip_media_neg/include/asterisk/app_stasis.h
URL: http://svnview.digium.com/svn/asterisk/team/kharwell/pimp_sip_media_neg/include/asterisk/app_stasis.h?view=diff&rev=385164&r1=385163&r2=385164
==============================================================================
--- team/kharwell/pimp_sip_media_neg/include/asterisk/app_stasis.h (original)
+++ team/kharwell/pimp_sip_media_neg/include/asterisk/app_stasis.h Tue Apr  9 17:23:33 2013
@@ -48,6 +48,8 @@
 
 #include "asterisk/channel.h"
 #include "asterisk/json.h"
+
+struct ast_channel_snapshot;
 
 /*! @{ */
 

Modified: team/kharwell/pimp_sip_media_neg/include/asterisk/channel.h
URL: http://svnview.digium.com/svn/asterisk/team/kharwell/pimp_sip_media_neg/include/asterisk/channel.h?view=diff&rev=385164&r1=385163&r2=385164
==============================================================================
--- team/kharwell/pimp_sip_media_neg/include/asterisk/channel.h (original)
+++ team/kharwell/pimp_sip_media_neg/include/asterisk/channel.h Tue Apr  9 17:23:33 2013
@@ -365,7 +365,7 @@
  * PSTN gateway).
  *
  * \todo Implement settings for transliteration between UTF8 Caller ID names in
- *       to ASCII Caller ID's (DAHDI). Östen Åsklund might be transliterated into
+ *       to ASCII Caller ID's (DAHDI). Östen Ã
sklund might be transliterated into
  *       Osten Asklund or Oesten Aasklund depending upon language and person...
  *       We need automatic routines for incoming calls and static settings for
  *       our own accounts.
@@ -3015,7 +3015,7 @@
  *
  * \details
  * This function will generate an effective party id.
- * 
+ *
  * Each party id component of the party id 'base' is overwritten
  * by components of the party id 'overlay' if the overlay
  * component is marked as valid.  However the component 'tag' of
@@ -3788,7 +3788,7 @@
 void ast_channel_unlink(struct ast_channel *chan);
 
 /*!
- * \brief Sets the HANGUPCAUSE hash and optionally the SIP_CAUSE hash 
+ * \brief Sets the HANGUPCAUSE hash and optionally the SIP_CAUSE hash
  * on the given channel
  *
  * \param chan channel on which to set the cause information
@@ -4125,69 +4125,6 @@
  */
 struct varshead *ast_channel_get_manager_vars(struct ast_channel *chan);
 
-/*! \addtogroup StasisTopicsAndMessages
- * @{
- */
-
-/*!
- * \since 12
- * \brief Structure representing a snapshot of channel state.
- *
- * While not enforced programmatically, this object is shared across multiple
- * threads, and should be threated as an immutable object.
- */
-struct ast_channel_snapshot {
-	AST_DECLARE_STRING_FIELDS(
-		AST_STRING_FIELD(name);			/*!< ASCII unique channel name */
-		AST_STRING_FIELD(accountcode);		/*!< Account code for billing */
-		AST_STRING_FIELD(peeraccount);		/*!< Peer account code for billing */
-		AST_STRING_FIELD(userfield);		/*!< Userfield for CEL billing */
-		AST_STRING_FIELD(uniqueid);		/*!< Unique Channel Identifier */
-		AST_STRING_FIELD(linkedid);		/*!< Linked Channel Identifier -- gets propagated by linkage */
-		AST_STRING_FIELD(parkinglot);		/*!< Default parking lot, if empty, default parking lot */
-		AST_STRING_FIELD(hangupsource);		/*!< Who is responsible for hanging up this channel */
-		AST_STRING_FIELD(appl);			/*!< Current application */
-		AST_STRING_FIELD(data);			/*!< Data passed to current application */
-		AST_STRING_FIELD(context);		/*!< Dialplan: Current extension context */
-		AST_STRING_FIELD(exten);		/*!< Dialplan: Current extension number */
-		AST_STRING_FIELD(caller_name);		/*!< Caller ID Name */
-		AST_STRING_FIELD(caller_number);	/*!< Caller ID Number */
-		AST_STRING_FIELD(connected_name);	/*!< Connected Line Name */
-		AST_STRING_FIELD(connected_number);	/*!< Connected Line Number */
-	);
-
-	struct timeval creationtime;	/*!< The time of channel creation */
-	enum ast_channel_state state;	/*!< State of line */
-	int priority;			/*!< Dialplan: Current extension priority */
-	int amaflags;			/*!< AMA flags for billing */
-	int hangupcause;		/*!< Why is the channel hanged up. See causes.h */
-	int caller_pres;		/*!< Caller ID presentation. */
-
-	struct ast_flags flags;		/*!< channel flags of AST_FLAG_ type */
-
-	struct varshead *manager_vars;	/*!< Variables to be appended to manager events */
-};
-
-/*!
- * \since 12
- * \brief Generate a snapshot of the channel state. This is an ao2 object, so
- * ao2_cleanup() to deallocate.
- *
- * \param chan The channel from which to generate a snapshot
- *
- * \retval pointer on success (must be ast_freed)
- * \retval NULL on error
- */
-struct ast_channel_snapshot *ast_channel_snapshot_create(struct ast_channel *chan);
-
-/*!
- * \since 12
- * \brief Message type for \ref ast_channel_snapshot.
- *
- * \retval Message type for \ref ast_channel_snapshot.
- */
-struct stasis_message_type *ast_channel_snapshot_type(void);
-
 /*!
  * \since 12
  * \brief A topic which publishes the events for a particular channel.
@@ -4201,81 +4138,4 @@
  */
 struct stasis_topic *ast_channel_topic(struct ast_channel *chan);
 
-/*!
- * \since 12
- * \brief A topic which publishes the events for all channels.
- * \retval Topic for all channel events.
- */
-struct stasis_topic *ast_channel_topic_all(void);
-
-/*!
- * \since 12
- * \brief A caching topic which caches \ref ast_channel_snapshot messages from
- * ast_channel_events_all(void).
- *
- * \retval Topic for all channel events.
- */
-struct stasis_caching_topic *ast_channel_topic_all_cached(void);
-
-/*!
- * \since 12
- * \brief Blob of data associated with a channel.
- *
- * The \c blob is actually a JSON object of structured data. It has a "type" field
- * which contains the type string describing this blob.
- */
-struct ast_channel_blob {
-	/*! Channel blob is associated with (or NULL for global/all channels) */
-	struct ast_channel_snapshot *snapshot;
-	/*! JSON blob of data */

[... 2473 lines stripped ...]



More information about the asterisk-commits mailing list