[asterisk-commits] branch group/rtpjitterbuffer r29486 - in /team/group/rtpjitterbuffer: ./ apps...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon May 22 10:03:26 MST 2006


Author: russell
Date: Mon May 22 12:03:25 2006
New Revision: 29486

URL: http://svn.digium.com/view/asterisk?rev=29486&view=rev
Log:
Merged revisions 29463,29465-29467 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r29463 | file | 2006-05-22 12:08:23 -0400 (Mon, 22 May 2006) | 2 lines

Add PICKUPMARK support to app_directed_pickup (issue #7104 reported by thaeger)

................
r29465 | russell | 2006-05-22 12:34:45 -0400 (Mon, 22 May 2006) | 2 lines

add DEBUG_CHANNEL_LOCKS to menuselect

................
r29466 | file | 2006-05-22 12:36:13 -0400 (Mon, 22 May 2006) | 10 lines

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

........
r29464 | file | 2006-05-22 13:33:03 -0300 (Mon, 22 May 2006) | 2 lines

Preserve presentation bit when going through chan_local (issue #7002 reported by acunningham)

........

................
r29467 | bweschke | 2006-05-22 12:43:43 -0400 (Mon, 22 May 2006) | 3 lines

 This is part 2/2 of the patches for #7090. Adds one-step call parking to /trunk via builtin functions and 'k' 'K' application options added to app_dial. This also resolves #6340.


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

Modified:
    team/group/rtpjitterbuffer/   (props changed)
    team/group/rtpjitterbuffer/apps/app_dial.c
    team/group/rtpjitterbuffer/apps/app_directed_pickup.c
    team/group/rtpjitterbuffer/build_tools/cflags.xml
    team/group/rtpjitterbuffer/channels/chan_local.c
    team/group/rtpjitterbuffer/configs/features.conf.sample
    team/group/rtpjitterbuffer/include/asterisk/channel.h
    team/group/rtpjitterbuffer/res/res_features.c

Propchange: team/group/rtpjitterbuffer/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/group/rtpjitterbuffer/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon May 22 12:03:25 2006
@@ -1,1 +1,1 @@
-/trunk:1-29436
+/trunk:1-29478

Modified: team/group/rtpjitterbuffer/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/group/rtpjitterbuffer/apps/app_dial.c?rev=29486&r1=29485&r2=29486&view=diff
==============================================================================
--- team/group/rtpjitterbuffer/apps/app_dial.c (original)
+++ team/group/rtpjitterbuffer/apps/app_dial.c Mon May 22 12:03:25 2006
@@ -183,7 +183,11 @@
 "    w    - Allow the called party to enable recording of the call by sending\n"
 "           the DTMF sequence defined for one-touch recording in features.conf.\n"
 "    W    - Allow the calling party to enable recording of the call by sending\n"
-"           the DTMF sequence defined for one-touch recording in features.conf.\n";
+"           the DTMF sequence defined for one-touch recording in features.conf.\n"
+"    k    - Allow the called party to enable parking of the call by sending\n"
+"           the DTMF sequence defined for call parking in features.conf.\n"
+"    K    - Allow the calling party to enable parking of the call by sending\n"
+"           the DTMF sequence defined for call parking in features.conf.\n";
 
 /* RetryDial App by Anthony Minessale II <anthmct at yahoo.com> Jan/2005 */
 static char *rapp = "RetryDial";
@@ -227,6 +231,8 @@
 	OPT_CALLER_MONITOR =	(1 << 22),
 	OPT_GOTO =		(1 << 23),
 	OPT_OPERMODE = 		(1 << 24),
+	OPT_CALLEE_PARK =	(1 << 25),
+	OPT_CALLER_PARK =	(1 << 26),
 } dial_exec_option_flags;
 
 #define DIAL_STILLGOING			(1 << 30)
@@ -272,6 +278,8 @@
 	AST_APP_OPTION('T', OPT_CALLER_TRANSFER),
 	AST_APP_OPTION('w', OPT_CALLEE_MONITOR),
 	AST_APP_OPTION('W', OPT_CALLER_MONITOR),
+	AST_APP_OPTION('k', OPT_CALLEE_PARK),
+	AST_APP_OPTION('K', OPT_CALLER_PARK),
 });
 
 /* We define a custom "local user" structure because we
@@ -441,6 +449,7 @@
 						       OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
 						       OPT_CALLEE_HANGUP | OPT_CALLER_HANGUP |
 						       OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR |
+						       OPT_CALLEE_PARK | OPT_CALLER_PARK |
 						       DIAL_NOFORWARDHTML);
 				}
 				continue;
@@ -551,6 +560,7 @@
 							       OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
 							       OPT_CALLEE_HANGUP | OPT_CALLER_HANGUP |
 							       OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR |
+							       OPT_CALLEE_PARK | OPT_CALLER_PARK |
 							       DIAL_NOFORWARDHTML);
 						/* Setup early media if appropriate */
 						ast_rtp_early_media(in, peer);
@@ -1016,6 +1026,7 @@
 				       OPT_CALLEE_TRANSFER | OPT_CALLER_TRANSFER |
 				       OPT_CALLEE_HANGUP | OPT_CALLER_HANGUP |
 				       OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR |
+				       OPT_CALLEE_PARK | OPT_CALLER_PARK |
 				       OPT_RINGBACK | OPT_MUSICBACK | OPT_FORCECLID);
 			ast_set2_flag(tmp, args.url, DIAL_NOFORWARDHTML);	
 		}
@@ -1497,6 +1508,10 @@
 				ast_set_flag(&(config.features_callee), AST_FEATURE_AUTOMON);
 			if (ast_test_flag(peerflags, OPT_CALLER_MONITOR)) 
 				ast_set_flag(&(config.features_caller), AST_FEATURE_AUTOMON);
+			if (ast_test_flag(peerflags, OPT_CALLEE_PARK))
+				ast_set_flag(&(config.features_callee), AST_FEATURE_PARKCALL);
+			if (ast_test_flag(peerflags, OPT_CALLER_PARK))
+				ast_set_flag(&(config.features_caller), AST_FEATURE_PARKCALL);
 
 			config.timelimit = timelimit;
 			config.play_warning = play_warning;

Modified: team/group/rtpjitterbuffer/apps/app_directed_pickup.c
URL: http://svn.digium.com/view/asterisk/team/group/rtpjitterbuffer/apps/app_directed_pickup.c?rev=29486&r1=29485&r2=29486&view=diff
==============================================================================
--- team/group/rtpjitterbuffer/apps/app_directed_pickup.c (original)
+++ team/group/rtpjitterbuffer/apps/app_directed_pickup.c Mon May 22 12:03:25 2006
@@ -20,7 +20,7 @@
  *
  * \brief Directed Call Pickup Support
  *
- * \author Joshua Colp <jcolp at asterlink.com>
+ * \author Joshua Colp <jcolp at digium.com>
  *
  * \ingroup applications
  */
@@ -42,12 +42,16 @@
 #include "asterisk/lock.h"
 #include "asterisk/app.h"
 
+#define PICKUPMARK "PICKUPMARK"
+
 static const char *app = "Pickup";
 static const char *synopsis = "Directed Call Pickup";
 static const char *descrip =
 "  Pickup(extension[@context][&extension2 at context...]): This application can pickup any ringing channel\n"
 "that is calling the specified extension. If no context is specified, the current\n"
-"context will be used.\n";
+"context will be used. If you use the special string \"PICKUPMARK\" for the context parameter, for example\n"
+"10 at PICKUPMARK, this application tries to find a channel which has defined a channel variable with the same context\n"
+"as \"extension\".";
 
 LOCAL_USER_DECL;
 
@@ -58,6 +62,7 @@
 	struct ast_channel *origin = NULL, *target = NULL;
 	char *tmp = NULL, *exten = NULL, *context = NULL, *rest=data;
 	char workspace[256] = "";
+	const char *tmp2 = NULL;
 
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "Pickup requires an argument (extension) !\n");
@@ -77,8 +82,21 @@
 		if (context)
 			*context++ = '\0';
 
-		/* Find a channel to pickup */
-		origin = ast_get_channel_by_exten_locked(exten, context);
+		/* If the context is the pickup mark, iterate through all channels finding the right origin one */
+		if (!strcmp(context, PICKUPMARK)) {
+			while ((origin = ast_channel_walk_locked(origin))) {
+				if (origin) {
+					tmp2 = pbx_builtin_getvar_helper(origin, PICKUPMARK);
+					if (tmp2 && !strcmp(tmp2, exten))
+						break;
+					ast_mutex_unlock(&origin->lock);
+				}
+			}
+		} else {
+			/* Use the classic mode of searching */
+			origin = ast_get_channel_by_exten_locked(exten, context);
+		}
+
 		if (origin) {
 			ast_cdr_getvar(origin->cdr, "dstchannel", &tmp, workspace,
 					sizeof(workspace), 0, 0);

Modified: team/group/rtpjitterbuffer/build_tools/cflags.xml
URL: http://svn.digium.com/view/asterisk/team/group/rtpjitterbuffer/build_tools/cflags.xml?rev=29486&r1=29485&r2=29486&view=diff
==============================================================================
--- team/group/rtpjitterbuffer/build_tools/cflags.xml (original)
+++ team/group/rtpjitterbuffer/build_tools/cflags.xml Mon May 22 12:03:25 2006
@@ -1,6 +1,8 @@
 	<category name="MENUSELECT_CFLAGS" displayname="Compiler Flags" positive_output="yes" force_clean_on_change="yes">
 		<member name="AST_JB" displayname="Generic Jitterbuffer">
 			<defaultenabled>yes</defaultenabled>
+		</member>
+		<member name="DEBUG_CHANNEL_LOCKS" displayname="Debug Channel Locking">
 		</member>
 		<member name="DEBUG_SCHEDULER" displayname="Enable Scheduler Debugging Output">
 		</member>

Modified: team/group/rtpjitterbuffer/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/team/group/rtpjitterbuffer/channels/chan_local.c?rev=29486&r1=29485&r2=29486&view=diff
==============================================================================
--- team/group/rtpjitterbuffer/channels/chan_local.c (original)
+++ team/group/rtpjitterbuffer/channels/chan_local.c Mon May 22 12:03:25 2006
@@ -369,7 +369,7 @@
 	p->chan->cid.cid_name = ast_strdup(p->owner->cid.cid_name);
 	p->chan->cid.cid_rdnis = ast_strdup(p->owner->cid.cid_rdnis);
 	p->chan->cid.cid_ani = ast_strdup(p->owner->cid.cid_ani);
-
+	p->chan->cid.cid_pres = p->owner->cid.cid_pres;
 	ast_string_field_set(p->chan, language, p->owner->language);
 	ast_string_field_set(p->chan, accountcode, p->owner->accountcode);
 	p->chan->cdrflags = p->owner->cdrflags;

Modified: team/group/rtpjitterbuffer/configs/features.conf.sample
URL: http://svn.digium.com/view/asterisk/team/group/rtpjitterbuffer/configs/features.conf.sample?rev=29486&r1=29485&r2=29486&view=diff
==============================================================================
--- team/group/rtpjitterbuffer/configs/features.conf.sample (original)
+++ team/group/rtpjitterbuffer/configs/features.conf.sample Mon May 22 12:03:25 2006
@@ -32,6 +32,7 @@
 ;disconnect => *0		; Disconnect  (default is *)
 ;automon => *1			; One Touch Record a.k.a. Touch Monitor
 ;atxfer => *2			; Attended transfer
+;parkcall => #72                ; Park call (one step parking)
 
 [applicationmap]
 ; Note that the DYNAMIC_FEATURES channel variable must be set to use the features

Modified: team/group/rtpjitterbuffer/include/asterisk/channel.h
URL: http://svn.digium.com/view/asterisk/team/group/rtpjitterbuffer/include/asterisk/channel.h?rev=29486&r1=29485&r2=29486&view=diff
==============================================================================
--- team/group/rtpjitterbuffer/include/asterisk/channel.h (original)
+++ team/group/rtpjitterbuffer/include/asterisk/channel.h Mon May 22 12:03:25 2006
@@ -490,6 +490,7 @@
 #define AST_FEATURE_DISCONNECT		(1 << 2)
 #define AST_FEATURE_ATXFER		(1 << 3)
 #define AST_FEATURE_AUTOMON		(1 << 4)
+#define AST_FEATURE_PARKCALL		(1 << 5)
 
 #define AST_FEATURE_FLAG_NEEDSDTMF	(1 << 0)
 #define AST_FEATURE_FLAG_CALLEE		(1 << 1)

Modified: team/group/rtpjitterbuffer/res/res_features.c
URL: http://svn.digium.com/view/asterisk/team/group/rtpjitterbuffer/res/res_features.c?rev=29486&r1=29485&r2=29486&view=diff
==============================================================================
--- team/group/rtpjitterbuffer/res/res_features.c (original)
+++ team/group/rtpjitterbuffer/res/res_features.c Mon May 22 12:03:25 2006
@@ -426,6 +426,37 @@
 	}
 }
 
+static int builtin_parkcall(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, char *code, int sense)
+{
+	struct ast_channel *parker;
+        struct ast_channel *parkee;
+
+	int res=0;
+	struct localuser *u;
+	LOCAL_USER_ADD(u);
+
+	set_peers(&parker, &parkee, peer, chan, sense);
+	/* Setup the exten/priority to be s/1 since we don't know
+	   where this call should return */
+	strcpy(chan->exten, "s");
+	chan->priority = 1;
+	if (chan->_state != AST_STATE_UP)
+		res = ast_answer(chan);
+	if (!res)
+		res = ast_safe_sleep(chan, 1000);
+	if (!res)
+		res = ast_park_call(parkee, parker, 0, NULL);
+	LOCAL_USER_REMOVE(u);
+	if (!res) {
+		if (sense == FEATURE_SENSE_CHAN)
+			res = AST_PBX_NO_HANGUP_PEER;
+		else
+			res = AST_PBX_KEEPALIVE;
+	}
+	return res;
+
+}
+
 static int builtin_automonitor(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, char *code, int sense)
 {
 	char *caller_chan_id = NULL, *callee_chan_id = NULL, *args = NULL, *touch_filename = NULL;
@@ -779,6 +810,7 @@
 	{ AST_FEATURE_REDIRECT, "Attended Transfer", "atxfer", "", "", builtin_atxfer, AST_FEATURE_FLAG_NEEDSDTMF },
 	{ AST_FEATURE_AUTOMON, "One Touch Monitor", "automon", "", "", builtin_automonitor, AST_FEATURE_FLAG_NEEDSDTMF },
 	{ AST_FEATURE_DISCONNECT, "Disconnect Call", "disconnect", "*", "*", builtin_disconnect, AST_FEATURE_FLAG_NEEDSDTMF },
+	{ AST_FEATURE_PARKCALL, "Park Call", "parkcall", "", "", builtin_parkcall, AST_FEATURE_FLAG_NEEDSDTMF },
 };
 
 



More information about the asterisk-commits mailing list