[asterisk-commits] irroot: branch irroot/patches r338895 - /team/irroot/patches/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Oct 1 04:02:41 CDT 2011


Author: irroot
Date: Sat Oct  1 04:02:37 2011
New Revision: 338895

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=338895
Log:
Update patches to 338894
Reworked chan_local codec fix patch moved it to local_indicate (distrotech)
Reworked and documented pickup bridge macro options (distrotech)

Modified:
    team/irroot/patches/distrotech-1.8.patch
    team/irroot/patches/distrotech-10.patch
    team/irroot/patches/distrotech-trunk.patch
    team/irroot/patches/t38gateway-1.8.patch

Modified: team/irroot/patches/distrotech-1.8.patch
URL: http://svnview.digium.com/svn/asterisk/team/irroot/patches/distrotech-1.8.patch?view=diff&rev=338895&r1=338894&r2=338895
==============================================================================
--- team/irroot/patches/distrotech-1.8.patch (original)
+++ team/irroot/patches/distrotech-1.8.patch Sat Oct  1 04:02:37 2011
@@ -1,7 +1,7 @@
 Index: channels/chan_sip.c
 ===================================================================
---- channels/chan_sip.c	(.../branches/1.8)	(revision 337855)
-+++ channels/chan_sip.c	(.../team/irroot/distrotech-customers-1.8)	(revision 337855)
+--- channels/chan_sip.c	(.../branches/1.8)	(revision 338894)
++++ channels/chan_sip.c	(.../team/irroot/distrotech-customers-1.8)	(revision 338894)
 @@ -4317,6 +4317,9 @@
  			case T38_ENABLED:
  				state = T38_STATE_NEGOTIATED;
@@ -20,7 +20,7 @@
  	case T38_DISABLED:
  		if (old == T38_ENABLED) {
  			parameters.request_response = AST_T38_TERMINATED;
-@@ -5450,17 +5454,23 @@
+@@ -5441,17 +5445,23 @@
  
  		if (p->rtp && !p->srtp && setup_srtp(&p->srtp) < 0) {
  			ast_log(LOG_WARNING, "SRTP audio setup failed\n");
@@ -47,7 +47,7 @@
  		}
  	}
  
-@@ -6559,11 +6569,11 @@
+@@ -6550,11 +6560,11 @@
  	case AST_T38_REQUEST_NEGOTIATE:         /* Request T38 */
  		/* Negotiation can not take place without a valid max_ifp value. */
  		if (!parameters->max_ifp) {
@@ -60,7 +60,7 @@
  			break;
  		} else if (p->t38.state == T38_PEER_REINVITE) {
  			AST_SCHED_DEL_UNREF(sched, p->t38id, dialog_unref(p, "when you delete the t38id sched, you should dec the refcount for the stored dialog ptr"));
-@@ -6601,7 +6611,7 @@
+@@ -6592,7 +6602,7 @@
  	case AST_T38_REQUEST_TERMINATE:         /* Shutdown T38 */
  		if (p->t38.state == T38_PEER_REINVITE) {
  			AST_SCHED_DEL_UNREF(sched, p->t38id, dialog_unref(p, "when you delete the t38id sched, you should dec the refcount for the stored dialog ptr"));
@@ -69,7 +69,7 @@
  			transmit_response_reliable(p, "488 Not acceptable here", &p->initreq);
  		} else if (p->t38.state == T38_ENABLED)
  			transmit_reinvite_with_sdp(p, FALSE, FALSE);
-@@ -8851,27 +8861,43 @@
+@@ -8842,27 +8852,43 @@
  
  	if (secure_audio && !(p->srtp && (ast_test_flag(p->srtp, SRTP_CRYPTO_OFFER_OK)))) {
  		ast_log(LOG_WARNING, "Can't provide secure audio requested in SDP offer\n");
@@ -118,7 +118,7 @@
  	}
  
  	if (udptlportno == -1) {
-@@ -9052,7 +9078,7 @@
+@@ -9043,7 +9069,7 @@
  		}
  	}
  
@@ -127,7 +127,7 @@
  		ast_debug(3, "Have T.38 but no audio, accepting offer anyway\n");
  		return 0;
          }
-@@ -10876,14 +10902,25 @@
+@@ -10867,14 +10893,25 @@
  	}
  }
  
@@ -155,7 +155,7 @@
  			*a_crypto = sdp_crypto_attrib(srtp->crypto);
  		}
  
-@@ -11043,7 +11080,7 @@
+@@ -11034,7 +11071,7 @@
  		/* Ok, we need video. Let's add what we need for video and set codecs.
  		   Video is handled differently than audio since we can not transcode. */
  		if (needvideo) {
@@ -164,7 +164,7 @@
  			ast_str_append(&m_video, 0, "m=video %d RTP/%s", ast_sockaddr_port(&vdest),
  				v_a_crypto ? "SAVP" : "AVP");
  
-@@ -11060,7 +11097,7 @@
+@@ -11051,7 +11088,7 @@
  		if (needtext) {
  			if (sipdebug_text)
  				ast_verbose("Lets set up the text sdp\n");
@@ -173,7 +173,7 @@
  			ast_str_append(&m_text, 0, "m=text %d RTP/%s", ast_sockaddr_port(&tdest),
  				t_a_crypto ? "SAVP" : "AVP");
  			if (debug) {  /* XXX should I use tdest below ? */
-@@ -11073,7 +11110,7 @@
+@@ -11064,7 +11101,7 @@
  		/* We break with the "recommendation" and send our IP, in order that our
  		   peer doesn't have to ast_gethostbyname() us */
  
@@ -182,7 +182,7 @@
  		ast_str_append(&m_audio, 0, "m=audio %d RTP/%s", ast_sockaddr_port(&dest),
  			a_crypto ? "SAVP" : "AVP");
  
-@@ -14318,24 +14355,21 @@
+@@ -14309,24 +14346,21 @@
  				} else {
  
  					/* We have a successful registration attempt with proper authentication,
@@ -208,7 +208,7 @@
  						res = 0;
  						break;
  					case PARSE_REGISTER_UPDATE:
-@@ -14343,8 +14377,6 @@
+@@ -14334,8 +14368,6 @@
  						update_peer(peer, p->expiry);
  						/* Say OK and ask subsystem to retransmit msg counter */
  						transmit_response_with_date(p, "200 OK", req);
@@ -217,7 +217,7 @@
  						res = 0;
  						break;
  					}
-@@ -14369,19 +14401,16 @@
+@@ -14360,19 +14392,16 @@
  			case PARSE_REGISTER_DENIED:
  				ast_log(LOG_WARNING, "Registration denied because of contact ACL\n");
  				transmit_response_with_date(p, "403 Forbidden (ACL)", req);
@@ -237,7 +237,7 @@
  				res = 0;
  				break;
  			case PARSE_REGISTER_UPDATE:
-@@ -14389,7 +14418,6 @@
+@@ -14380,7 +14409,6 @@
  				/* Say OK and ask subsystem to retransmit msg counter */
  				transmit_response_with_date(p, "200 OK", req);
  				manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "ChannelType: SIP\r\nPeer: SIP/%s\r\nPeerStatus: Registered\r\nAddress: %s\r\n", peer->name, ast_sockaddr_stringify(addr));
@@ -245,7 +245,7 @@
  				res = 0;
  				break;
  			}
-@@ -14405,6 +14433,7 @@
+@@ -14396,6 +14424,7 @@
  		sched_yield();
  	}
  	if (!res) {
@@ -253,7 +253,7 @@
  		ast_devstate_changed(AST_DEVICE_UNKNOWN, "SIP/%s", peer->name);
  	}
  	if (res < 0) {
-@@ -16903,7 +16932,6 @@
+@@ -16900,7 +16929,6 @@
  		ast_cli(fd, "  MOH Suggest  : %s\n", peer->mohsuggest);
  		ast_cli(fd, "  Mailbox      : %s\n", mailbox_str->str);
  		ast_cli(fd, "  VM Extension : %s\n", peer->vmexten);
@@ -261,7 +261,7 @@
  		ast_cli(fd, "  Call limit   : %d\n", peer->call_limit);
  		ast_cli(fd, "  Max forwards : %d\n", peer->maxforwards);
  		if (peer->busy_level)
-@@ -17018,7 +17046,6 @@
+@@ -17015,7 +17043,6 @@
  		astman_append(s, "VoiceMailbox: %s\r\n", mailbox_str->str);
  		astman_append(s, "TransferMode: %s\r\n", transfermode2str(peer->allowtransfer));
  		astman_append(s, "Maxforwards: %d\r\n", peer->maxforwards);
@@ -269,7 +269,7 @@
  		astman_append(s, "Maxforwards: %d\r\n", peer->maxforwards);
  		astman_append(s, "Call-limit: %d\r\n", peer->call_limit);
  		astman_append(s, "Busy-level: %d\r\n", peer->busy_level);
-@@ -18986,7 +19013,7 @@
+@@ -18983,7 +19010,7 @@
  	} else  if (!strcasecmp(data, "peername")) {
  		ast_copy_string(buf, p->peername, len);
  	} else if (!strcasecmp(data, "t38passthrough")) {
@@ -278,7 +278,7 @@
  			ast_copy_string(buf, "0", len);
  		} else { /* T38 is offered or enabled in this call */
  			ast_copy_string(buf, "1", len);
-@@ -19756,7 +19783,7 @@
+@@ -19753,7 +19780,7 @@
  	case 606: /* Not Acceptable */
  		xmitres = transmit_request(p, SIP_ACK, seqno, XMIT_UNRELIABLE, FALSE);
  		if (p->udptl && p->t38.state == T38_LOCAL_REINVITE) {
@@ -287,7 +287,7 @@
  			/* Try to reset RTP timers */
  			//ast_rtp_set_rtptimers_onhold(p->rtp);
  
-@@ -21564,7 +21591,7 @@
+@@ -21561,7 +21588,7 @@
  	 * want to abort the negotiation process
  	 */
  	if (p->t38id != -1) {
@@ -296,7 +296,7 @@
  		transmit_response_reliable(p, "488 Not acceptable here", &p->initreq);
  		p->t38id = -1;
  		dialog_unref(p, "unref the dialog ptr from sip_t38_abort, because it held a dialog ptr");
-@@ -22439,9 +22466,10 @@
+@@ -22436,9 +22463,10 @@
  			} else if (p->t38.state == T38_ENABLED) {
  				ast_set_flag(&p->flags[1], SIP_PAGE2_DIALOG_ESTABLISHED);
  				transmit_response_with_t38_sdp(p, "200 OK", req, (reinvite ? XMIT_RELIABLE : (req->ignore ?  XMIT_UNRELIABLE : XMIT_CRITICAL)));
@@ -309,7 +309,7 @@
  					ast_log(LOG_WARNING, "Target does not support required crypto\n");
  					transmit_response_reliable(p, "488 Not Acceptable Here (crypto)", req);
  				} else {
-@@ -24997,25 +25025,33 @@
+@@ -24994,25 +25022,33 @@
  	return in_cache;
  }
  
@@ -348,7 +348,7 @@
  		ast_app_inboxcount(mailbox_str->str, &newmsgs, &oldmsgs);
  	}
  	ao2_lock(peer);
-@@ -25041,7 +25077,7 @@
+@@ -25038,7 +25074,7 @@
  			dialog_unref(p, "unref dialog p just created via sip_alloc");
  			/* sip_destroy(p); */
  			ao2_unlock(peer);
@@ -357,7 +357,7 @@
  		}
  		/* Recalculate our side, and recalculate Call ID */
  		ast_sip_ouraddrfor(&p->sa, &p->ourip, p);
-@@ -26515,6 +26551,11 @@
+@@ -26512,6 +26548,11 @@
  		int duplicate = 0;
  		/* remove leading/trailing whitespace from mailbox string */
  		mbox = ast_strip(mbox);
@@ -369,7 +369,7 @@
  		strsep(&context, "@");
  
  		if (ast_strlen_zero(mbox)) {
-@@ -26608,7 +26649,6 @@
+@@ -26605,7 +26646,6 @@
  
  	/* Note that our peer HAS had its reference count increased */
  	if (firstpass) {
@@ -377,7 +377,7 @@
  		oldha = peer->ha;
  		peer->ha = NULL;
  		olddirectmediaha = peer->directmediaha;
-@@ -26983,7 +27023,15 @@
+@@ -26980,7 +27020,15 @@
  			} else if (!strcasecmp(v->name, "use_q850_reason")) {
  				ast_set2_flag(&peer->flags[1], ast_true(v->value), SIP_PAGE2_Q850_REASON);
  			} else if (!strcasecmp(v->name, "encryption")) {
@@ -394,7 +394,7 @@
  			} else if (!strcasecmp(v->name, "snom_aoc_enabled")) {
  				ast_set2_flag(&peer->flags[2], ast_true(v->value), SIP_PAGE3_SNOM_AOC);
  			}
-@@ -28891,7 +28939,7 @@
+@@ -28888,7 +28936,7 @@
  		return FALSE;
  	}
  
@@ -405,8 +405,8 @@
  
 Index: channels/sip/include/sip.h
 ===================================================================
---- channels/sip/include/sip.h	(.../branches/1.8)	(revision 337855)
-+++ channels/sip/include/sip.h	(.../team/irroot/distrotech-customers-1.8)	(revision 337855)
+--- channels/sip/include/sip.h	(.../branches/1.8)	(revision 338894)
++++ channels/sip/include/sip.h	(.../team/irroot/distrotech-customers-1.8)	(revision 338894)
 @@ -352,9 +352,11 @@
  
  
@@ -430,7 +430,7 @@
  };
  
  /*! \brief Parameters to know status of transfer */
-@@ -1218,7 +1221,6 @@
+@@ -1220,7 +1223,6 @@
  	int maxforwards;                /*!< SIP Loop prevention */
  	enum transfermodes allowtransfer;   /*! SIP Refer restriction scheme */
  	struct ast_codec_pref prefs;    /*!<  codec prefs */
@@ -440,8 +440,8 @@
  
 Index: channels/sip/include/sdp_crypto.h
 ===================================================================
---- channels/sip/include/sdp_crypto.h	(.../branches/1.8)	(revision 337855)
-+++ channels/sip/include/sdp_crypto.h	(.../team/irroot/distrotech-customers-1.8)	(revision 337855)
+--- channels/sip/include/sdp_crypto.h	(.../branches/1.8)	(revision 338894)
++++ channels/sip/include/sdp_crypto.h	(.../team/irroot/distrotech-customers-1.8)	(revision 338894)
 @@ -31,6 +31,7 @@
  #include <asterisk/rtp_engine.h>
  
@@ -475,8 +475,8 @@
  /*! \brief Return the a_crypto value of the sdp_crypto struct
 Index: channels/sip/include/srtp.h
 ===================================================================
---- channels/sip/include/srtp.h	(.../branches/1.8)	(revision 337855)
-+++ channels/sip/include/srtp.h	(.../team/irroot/distrotech-customers-1.8)	(revision 337855)
+--- channels/sip/include/srtp.h	(.../branches/1.8)	(revision 338894)
++++ channels/sip/include/srtp.h	(.../team/irroot/distrotech-customers-1.8)	(revision 338894)
 @@ -34,6 +34,8 @@
  #define SRTP_ENCR_OPTIONAL	(1 << 1)	/* SRTP encryption optional */
  #define SRTP_CRYPTO_ENABLE	(1 << 2)
@@ -488,8 +488,8 @@
  struct sip_srtp {
 Index: channels/sip/sdp_crypto.c
 ===================================================================
---- channels/sip/sdp_crypto.c	(.../branches/1.8)	(revision 337855)
-+++ channels/sip/sdp_crypto.c	(.../team/irroot/distrotech-customers-1.8)	(revision 337855)
+--- channels/sip/sdp_crypto.c	(.../branches/1.8)	(revision 338894)
++++ channels/sip/sdp_crypto.c	(.../team/irroot/distrotech-customers-1.8)	(revision 338894)
 @@ -32,6 +32,7 @@
  #include "asterisk/options.h"
  #include "asterisk/utils.h"
@@ -540,41 +540,66 @@
  
 Index: channels/chan_local.c
 ===================================================================
---- channels/chan_local.c	(.../branches/1.8)	(revision 337855)
-+++ channels/chan_local.c	(.../team/irroot/distrotech-customers-1.8)	(revision 337855)
-@@ -588,6 +588,7 @@
- static int local_write(struct ast_channel *ast, struct ast_frame *f)
+--- channels/chan_local.c	(.../branches/1.8)	(revision 338894)
++++ channels/chan_local.c	(.../team/irroot/distrotech-customers-1.8)	(revision 338894)
+@@ -650,9 +650,10 @@
+ static int local_indicate(struct ast_channel *ast, int condition, const void *data, size_t datalen)
  {
  	struct local_pvt *p = ast->tech_pvt;
 +	struct ast_channel *bridge;
- 	int res = -1;
- 	int isoutbound;
- 
-@@ -602,6 +603,20 @@
- 
- 	if (isoutbound && f && (f->frametype == AST_FRAME_VOICE || f->frametype == AST_FRAME_VIDEO)) {
- 		check_bridge(p);
-+	} else if (!isoutbound) {
-+		/* fixup formats nativeformat has changed we must adjust
+ 	int res = 0;
+ 	struct ast_frame f = { AST_FRAME_CONTROL, };
+-	int isoutbound;
++	int isoutbound = IS_OUTBOUND(ast, p);
+ 
+ 	if (!p)
+ 		return -1;
+@@ -675,7 +676,6 @@
+ 		 * happens to be in this control frame. The same applies for redirecting information, which
+ 		 * is why it is handled here as well.*/
+ 		ao2_lock(p);
+-		isoutbound = IS_OUTBOUND(ast, p);
+ 		if (isoutbound) {
+ 			this_channel = p->chan;
+ 			the_other_channel = p->owner;
+@@ -698,10 +698,32 @@
+ 			res = local_queue_frame(p, isoutbound, &f, ast, 1);
+ 		}
+ 		ao2_unlock(p);
++	} else if (!isoutbound && (condition == AST_CONTROL_SRCUPDATE)) {
++		bridge = ast_bridged_channel(ast);
++		ao2_lock(p);
++		/* fixup audio formats nativeformat might have changed we must adjust.
 +		 * ast is p->owner and is locked here*/
-+		bridge = ast_bridged_channel(ast);
-+		if (bridge && !(bridge->nativeformats & ast->nativeformats)) {
-+			ast->nativeformats = bridge->nativeformats;
-+			ast_set_read_format(ast, ast->readformat);
-+			ast_set_write_format(ast, ast->writeformat);
-+			ast_channel_lock(p->chan);
-+			p->chan->nativeformats = bridge->nativeformats;
-+			ast_set_read_format(p->chan, p->chan->readformat);
-+			ast_set_write_format(p->chan, p->chan->writeformat);
-+			ast_channel_unlock(p->chan);
-+		}
- 	}
- 
- 	if (!ast_test_flag(p, LOCAL_ALREADY_MASQED)) {
++		if (p->chan && bridge && (bridge != p->chan) && !(bridge->nativeformats & ast->nativeformats)) {
++			if (!ast_channel_trylock(p->chan)) {
++				ast->nativeformats = bridge->nativeformats;
++				ast_set_read_format(ast, ast->readformat);
++				ast_set_write_format(ast, ast->writeformat);
++				p->chan->nativeformats = bridge->nativeformats;
++				ast_set_read_format(p->chan, p->chan->readformat);
++				ast_set_write_format(p->chan, p->chan->writeformat);
++				ast_channel_unlock(p->chan);
++			} else {
++				ast_verb(3, "Tried to get lock on %s to set audio format but failed\n", p->chan->name);
++			}
++		}
++		f.subclass.integer = condition;
++		f.data.ptr = (void*)data;
++		f.datalen = datalen;
++		res = local_queue_frame(p, isoutbound, &f, ast, 1);
++		ao2_unlock(p);
+ 	} else {
+ 		/* Queue up a frame representing the indication as a control frame */
+ 		ao2_lock(p);
+-		isoutbound = IS_OUTBOUND(ast, p);
+ 		f.subclass.integer = condition;
+ 		f.data.ptr = (void*)data;
+ 		f.datalen = datalen;
 Index: configure.ac
 ===================================================================
---- configure.ac	(.../branches/1.8)	(revision 337855)
-+++ configure.ac	(.../team/irroot/distrotech-customers-1.8)	(revision 337855)
+--- configure.ac	(.../branches/1.8)	(revision 338894)
++++ configure.ac	(.../team/irroot/distrotech-customers-1.8)	(revision 338894)
 @@ -1699,7 +1699,7 @@
     AST_EXT_LIB_CHECK([SUPPSERV], [suppserv], [encodeFac], [mISDNuser/suppserv.h])
     AST_C_DEFINE_CHECK([MISDN_FAC_RESULT], [Fac_RESULT], [mISDNuser/suppserv.h])
@@ -584,10 +609,38 @@
     AC_CHECK_MEMBER([Q931_info_t.redirect_dn], [], [PBX_MISDN=0], [#include <mISDNuser/mISDNlib.h>])
  fi
  
+Index: apps/app_directed_pickup.c
+===================================================================
+--- apps/app_directed_pickup.c	(.../branches/1.8)	(revision 338894)
++++ apps/app_directed_pickup.c	(.../team/irroot/distrotech-customers-1.8)	(revision 338894)
+@@ -73,7 +73,10 @@
+ 			tries to find a channel which has defined a <variable>PICKUPMARK</variable>
+ 			channel variable with the same value as <replaceable>extension</replaceable>
+ 			(in this example, <literal>10</literal>). When no parameter is specified, the application
+-			will pickup a channel matching the pickup group of the active channel.</para>
++			will pickup a channel matching the pickup group of the active channel.
++			If the channel variable <variable>PICKUP_BRIDGE_MACRO</variable> is set this macro will run
++			on the picked up channel using the channel variable <variable>PICKUP_BRIDGE_MACRO_ARGS</variable>
++			as arguments.</para>
+ 		</description>
+ 	</application>
+ 	<application name="PickupChan" language="en_US">
+@@ -94,7 +97,10 @@
+ 			</parameter>
+ 		</syntax>
+ 		<description>
+-			<para>This will pickup a specified <replaceable>channel</replaceable> if ringing.</para>
++			<para>This will pickup a specified <replaceable>channel</replaceable> if ringing.
++			If the channel variable <variable>PICKUP_BRIDGE_MACRO</variable> is set this macro will run
++			on the picked up channel using the channel variable <variable>PICKUP_BRIDGE_MACRO_ARGS</variable>
++			as arguments.</para>
+ 		</description>
+ 	</application>
+  ***/
 Index: apps/app_queue.c
 ===================================================================
---- apps/app_queue.c	(.../branches/1.8)	(revision 337855)
-+++ apps/app_queue.c	(.../team/irroot/distrotech-customers-1.8)	(revision 337855)
+--- apps/app_queue.c	(.../branches/1.8)	(revision 338894)
++++ apps/app_queue.c	(.../team/irroot/distrotech-customers-1.8)	(revision 338894)
 @@ -524,11 +524,25 @@
  					<enum name="count">
  						<para>Returns the total number of members for the specified queue.</para>
@@ -682,15 +735,6 @@
  		m->penalty, m->calls, (int)m->lastcall, m->status, m->paused
  	);
  
-@@ -1554,7 +1581,7 @@
- 	return state;
- }
- 
--static int extension_state_cb(char *context, char *exten, enum ast_extension_states state, void *data)
-+static int extension_state_cb(const char *context, const char *exten, enum ast_extension_states state, void *data)
- {
- 	struct ao2_iterator miter, qiter;
- 	struct member *m;
 @@ -1700,6 +1727,7 @@
  	q->numperiodicannounce = 0;
  	q->autopause = QUEUE_AUTOPAUSE_OFF;
@@ -1533,8 +1577,8 @@
  		.unload = unload_module,
 Index: addons/chan_ooh323.c
 ===================================================================
---- addons/chan_ooh323.c	(.../branches/1.8)	(revision 337855)
-+++ addons/chan_ooh323.c	(.../team/irroot/distrotech-customers-1.8)	(revision 337855)
+--- addons/chan_ooh323.c	(.../branches/1.8)	(revision 338894)
++++ addons/chan_ooh323.c	(.../team/irroot/distrotech-customers-1.8)	(revision 338894)
 @@ -25,6 +25,42 @@
  #include "chan_ooh323.h"
  #include <math.h>
@@ -2658,8 +2702,8 @@
  
 Index: Makefile
 ===================================================================
---- Makefile	(.../branches/1.8)	(revision 337855)
-+++ Makefile	(.../team/irroot/distrotech-customers-1.8)	(revision 337855)
+--- Makefile	(.../branches/1.8)	(revision 338894)
++++ Makefile	(.../team/irroot/distrotech-customers-1.8)	(revision 338894)
 @@ -127,7 +127,7 @@
  # Asterisk.conf is located in ASTETCDIR or by using the -C flag
  # when starting Asterisk
@@ -2671,8 +2715,8 @@
  # If you use Apache, you may determine by a grep 'DocumentRoot' of your httpd.conf file
 Index: funcs/func_channel.c
 ===================================================================
---- funcs/func_channel.c	(.../branches/1.8)	(revision 337855)
-+++ funcs/func_channel.c	(.../team/irroot/distrotech-customers-1.8)	(revision 337855)
+--- funcs/func_channel.c	(.../branches/1.8)	(revision 338894)
++++ funcs/func_channel.c	(.../team/irroot/distrotech-customers-1.8)	(revision 338894)
 @@ -89,6 +89,9 @@
  					<enum name="callgroup">
  						<para>R/W call groups for call pickup.</para>
@@ -2707,10 +2751,22 @@
  		sscanf(value, "%4hhd", &gainset);
  		ast_channel_setoption(chan, AST_OPTION_TXGAIN, &gainset, sizeof(gainset), 0);
  	} else if (!strcasecmp(data, "rxgain")) {
+Index: include/asterisk/global_datastores.h
+===================================================================
+--- include/asterisk/global_datastores.h	(.../branches/1.8)	(revision 338894)
++++ include/asterisk/global_datastores.h	(.../team/irroot/distrotech-customers-1.8)	(revision 338894)
+@@ -28,6 +28,7 @@
+ 
+ extern const struct ast_datastore_info dialed_interface_info;
+ extern const struct ast_datastore_info secure_call_info;
++extern const struct ast_datastore_info pickup_target_info;
+ 
+ struct ast_dialed_interface {
+ 	AST_LIST_ENTRY(ast_dialed_interface) list;
 Index: include/asterisk/res_fax.h
 ===================================================================
---- include/asterisk/res_fax.h	(.../branches/1.8)	(revision 337855)
-+++ include/asterisk/res_fax.h	(.../team/irroot/distrotech-customers-1.8)	(revision 337855)
+--- include/asterisk/res_fax.h	(.../branches/1.8)	(revision 338894)
++++ include/asterisk/res_fax.h	(.../team/irroot/distrotech-customers-1.8)	(revision 338894)
 @@ -42,6 +42,8 @@
  	AST_FAX_TECH_T38       = (1 << 3),
  	/*! sending mulitple documents supported */
@@ -2743,8 +2799,8 @@
  	/*! the type of fax session supported with this ast_fax_tech structure */
 Index: include/asterisk/dsp.h
 ===================================================================
---- include/asterisk/dsp.h	(.../branches/1.8)	(revision 337855)
-+++ include/asterisk/dsp.h	(.../team/irroot/distrotech-customers-1.8)	(revision 337855)
+--- include/asterisk/dsp.h	(.../branches/1.8)	(revision 338894)
++++ include/asterisk/dsp.h	(.../team/irroot/distrotech-customers-1.8)	(revision 338894)
 @@ -43,9 +43,11 @@
  #define DSP_FEATURE_CALL_PROGRESS	(DSP_PROGRESS_TALK | DSP_PROGRESS_RINGING | DSP_PROGRESS_BUSY | DSP_PROGRESS_CONGESTION)
  #define DSP_FEATURE_WAITDIALTONE	(1 << 20)		/*!< Enable dial tone detection */
@@ -2762,39 +2818,92 @@
  #define DSP_TONE_STATE_RINGING  1
 Index: main/channel.c
 ===================================================================
---- main/channel.c	(.../branches/1.8)	(revision 337855)
-+++ main/channel.c	(.../team/irroot/distrotech-customers-1.8)	(revision 337855)
-@@ -7214,6 +7214,8 @@
+--- main/channel.c	(.../branches/1.8)	(revision 338894)
++++ main/channel.c	(.../team/irroot/distrotech-customers-1.8)	(revision 338894)
+@@ -7214,6 +7214,9 @@
  	long time_left_ms=0;
  	char caller_warning = 0;
  	char callee_warning = 0;
 +	const char *bridge_macro;
 +	const char *bridge_macro_args;
++	struct ast_datastore *ds_bridge_macro;
  
  	*fo = NULL;
  
-@@ -7288,6 +7290,17 @@
+@@ -7288,6 +7291,31 @@
  	ast_indicate(c0, AST_CONTROL_SRCUPDATE);
  	ast_indicate(c1, AST_CONTROL_SRCUPDATE);
  
-+	bridge_macro = pbx_builtin_getvar_helper(c0, "PICKUP_BRIDGE_MACRO");
-+	if (!ast_strlen_zero(bridge_macro)) {
-+		bridge_macro_args = pbx_builtin_getvar_helper(c0, "PICKUP_BRIDGE_MACRO_ARGS");
-+		ast_app_run_macro(c0, c1, bridge_macro, bridge_macro_args);
-+	}
-+	bridge_macro = pbx_builtin_getvar_helper(c1, "PICKUP_BRIDGE_MACRO");
-+	if (!ast_strlen_zero(bridge_macro)) {
-+		bridge_macro_args = pbx_builtin_getvar_helper(c1, "PICKUP_BRIDGE_MACRO_ARGS");
-+		ast_app_run_macro(c1, c0, bridge_macro, bridge_macro_args);
++	if ((ds_bridge_macro = ast_channel_datastore_find(c0, &pickup_target_info, NULL))) {
++		bridge_macro = pbx_builtin_getvar_helper(c0, "PICKUP_BRIDGE_MACRO");
++		if (!ast_strlen_zero(bridge_macro)) {
++			bridge_macro_args = pbx_builtin_getvar_helper(c0, "PICKUP_BRIDGE_MACRO_ARGS");
++			ast_app_run_macro(c0, c1, bridge_macro, bridge_macro_args);
++		}
++		ast_channel_lock(c0);
++		if (!ast_channel_datastore_remove(c0, ds_bridge_macro)) {
++			ast_datastore_free(ds_bridge_macro);
++		}
++		ast_channel_unlock(c0);
++	}
++	if ((ds_bridge_macro = ast_channel_datastore_find(c1, &pickup_target_info, NULL))) {
++		bridge_macro = pbx_builtin_getvar_helper(c1, "PICKUP_BRIDGE_MACRO");
++		if (!ast_strlen_zero(bridge_macro)) {
++			bridge_macro_args = pbx_builtin_getvar_helper(c1, "PICKUP_BRIDGE_MACRO_ARGS");
++			ast_app_run_macro(c1, c0, bridge_macro, bridge_macro_args);
++		}
++		ast_channel_lock(c1);
++		if (!ast_channel_datastore_remove(c1, ds_bridge_macro)) {
++			ast_datastore_free(ds_bridge_macro);
++		}
++		ast_channel_unlock(c1);
 +	}
 +
  	for (/* ever */;;) {
  		struct timeval now = { 0, };
  		int to;
+Index: main/features.c
+===================================================================
+--- main/features.c	(.../branches/1.8)	(revision 338894)
++++ main/features.c	(.../team/irroot/distrotech-customers-1.8)	(revision 338894)
+@@ -7038,6 +7038,7 @@
+ 	struct ast_party_connected_line connected_caller;
+ 	struct ast_channel *chans[2] = { chan, target };
+ 	struct ast_datastore *ds_pickup;
++	struct ast_datastore *ds_bridge_macro;
+ 	const char *chan_name;/*!< A masquerade changes channel names. */
+ 	const char *target_name;/*!< A masquerade changes channel names. */
+ 	int res = -1;
+@@ -7054,6 +7055,15 @@
+ 	}
+ 	ast_channel_datastore_add(target, ds_pickup);
+ 
++	/* Mark the target so a macro can be run on it if needed. */
++	ds_bridge_macro = ast_datastore_alloc(&pickup_target_info, NULL);
++	if (ds_bridge_macro) {
++		ast_channel_datastore_add(target, ds_bridge_macro);
++	} else {
++		ast_log(LOG_WARNING,
++			"Unable to create channel datastore on '%s' for running macro\n", target_name);
++	}
++
+ 	ast_party_connected_line_init(&connected_caller);
+ 	ast_party_connected_line_copy(&connected_caller, &target->connected);
+ 	ast_channel_unlock(target);/* The pickup race is avoided so we do not need the lock anymore. */
+@@ -7107,6 +7117,9 @@
+ 	if (!ast_channel_datastore_remove(target, ds_pickup)) {
+ 		ast_datastore_free(ds_pickup);
+ 	}
++	if (res && ds_bridge_macro && !ast_channel_datastore_remove(target, ds_bridge_macro)) {
++		ast_datastore_free(ds_bridge_macro);
++	}
+ 
+ 	return res;
+ }
 Index: main/dsp.c
 ===================================================================
---- main/dsp.c	(.../branches/1.8)	(revision 337855)
-+++ main/dsp.c	(.../team/irroot/distrotech-customers-1.8)	(revision 337855)
+--- main/dsp.c	(.../branches/1.8)	(revision 338894)
++++ main/dsp.c	(.../team/irroot/distrotech-customers-1.8)	(revision 338894)
 @@ -254,6 +254,20 @@
  
  typedef struct
@@ -2998,8 +3107,8 @@
  
 Index: main/frame.c
 ===================================================================
---- main/frame.c	(.../branches/1.8)	(revision 337855)
-+++ main/frame.c	(.../team/irroot/distrotech-customers-1.8)	(revision 337855)
+--- main/frame.c	(.../branches/1.8)	(revision 338894)
++++ main/frame.c	(.../team/irroot/distrotech-customers-1.8)	(revision 338894)
 @@ -413,7 +413,7 @@
  		out->samples = fr->samples;
  		out->offset = fr->offset;
@@ -3018,10 +3127,36 @@
  	out->ts = f->ts;
  	out->len = f->len;
  	out->seqno = f->seqno;
+Index: main/global_datastores.c
+===================================================================
+--- main/global_datastores.c	(.../branches/1.8)	(revision 338894)
++++ main/global_datastores.c	(.../team/irroot/distrotech-customers-1.8)	(revision 338894)
+@@ -110,3 +110,7 @@
+ 	.destroy = secure_call_store_destroy,
+ 	.duplicate = secure_call_store_duplicate,
+ };
++
++const struct ast_datastore_info pickup_target_info = {
++	.type = "pickup-call",
++};
+Index: configs/sip.conf.sample
+===================================================================
+--- configs/sip.conf.sample	(.../branches/1.8)	(revision 338894)
++++ configs/sip.conf.sample	(.../team/irroot/distrotech-customers-1.8)	(revision 338894)
+@@ -890,6 +890,9 @@
+ ;encryption=no                  ; Whether to offer SRTP encrypted media (and only SRTP encrypted media)
+                                 ; on outgoing calls to a peer. Calls will fail with HANGUPCAUSE=58 if
+                                 ; the peer does not support SRTP. Defaults to no.
++                                ; this option can be set to try to offer encryption and not fail if peer
++                                ; ignores the request. the peer may reject this based on local settings.
++;encryption_taglen=80           ; Set the auth tag length offered in the INVITE either 32/80 default 80
+ 
+ ;----------------------------------------- REALTIME SUPPORT ------------------------
+ ; For additional information on ARA, the Asterisk Realtime Architecture,
 Index: configs/chan_ooh323.conf.sample
 ===================================================================
---- configs/chan_ooh323.conf.sample	(.../branches/1.8)	(revision 337855)
-+++ configs/chan_ooh323.conf.sample	(.../team/irroot/distrotech-customers-1.8)	(revision 337855)
+--- configs/chan_ooh323.conf.sample	(.../branches/1.8)	(revision 338894)
++++ configs/chan_ooh323.conf.sample	(.../team/irroot/distrotech-customers-1.8)	(revision 338894)
 @@ -122,6 +122,18 @@
  ;
  ;roundtrip=x,y
@@ -3043,8 +3178,8 @@
  ; ------------------                     -------------------
 Index: configs/queues.conf.sample
 ===================================================================
---- configs/queues.conf.sample	(.../branches/1.8)	(revision 337855)
-+++ configs/queues.conf.sample	(.../team/irroot/distrotech-customers-1.8)	(revision 337855)
+--- configs/queues.conf.sample	(.../branches/1.8)	(revision 338894)
++++ configs/queues.conf.sample	(.../team/irroot/distrotech-customers-1.8)	(revision 338894)
 @@ -61,6 +61,16 @@
  ;
  ;shared_lastcall=no
@@ -3073,7 +3208,7 @@
  ; Maximum number of people waiting in the queue (0 for unlimited)
  ;
  ;maxlen = 0
-@@ -459,6 +473,9 @@
+@@ -460,6 +474,9 @@
  ; uncomment this option. (Note: only the SIP channel driver currently is able
  ; to report 'in use'.)
  ;
@@ -3083,10 +3218,25 @@
  ; ringinuse = no
  ;
  ; If you wish to have a delay before the member is connected to the caller (or
+Index: configs/features.conf.sample
+===================================================================
+--- configs/features.conf.sample	(.../branches/1.8)	(revision 338894)
++++ configs/features.conf.sample	(.../team/irroot/distrotech-customers-1.8)	(revision 338894)
+@@ -79,6 +79,10 @@
+ ;xfersound = beep               ; to indicate an attended transfer is complete
+ ;xferfailsound = beeperr        ; to indicate a failed transfer
+ ;pickupexten = *8               ; Configure the pickup extension. (default is *8)
++                                ; You can set a channel variable PICKUP_BRIDGE_MACRO
++                                ; to run a macro on a channel that is been picked up
++                                ; arguments can be passed to it by setting PICKUP_BRIDGE_MACRO_ARGS.
++                                ;
+ ;pickupsound = beep             ; to indicate a successful pickup (default: no sound)
+ ;pickupfailsound = beeperr      ; to indicate that the pickup failed (default: no sound)
+ ;featuredigittimeout = 1000     ; Max time (ms) between digits for
 Index: res/res_fax.c
 ===================================================================
---- res/res_fax.c	(.../branches/1.8)	(revision 337855)
-+++ res/res_fax.c	(.../team/irroot/distrotech-customers-1.8)	(revision 337855)
+--- res/res_fax.c	(.../branches/1.8)	(revision 338894)
++++ res/res_fax.c	(.../team/irroot/distrotech-customers-1.8)	(revision 338894)
 @@ -5,7 +5,24 @@
   *
   * Dwayne M. Hubbard <dhubbard at digium.com>
@@ -4580,8 +4730,8 @@
  	return res;
 Index: res/res_fax_spandsp.c
 ===================================================================
---- res/res_fax_spandsp.c	(.../branches/1.8)	(revision 337855)
-+++ res/res_fax_spandsp.c	(.../team/irroot/distrotech-customers-1.8)	(revision 337855)
+--- res/res_fax_spandsp.c	(.../branches/1.8)	(revision 338894)
++++ res/res_fax_spandsp.c	(.../team/irroot/distrotech-customers-1.8)	(revision 338894)
 @@ -5,6 +5,22 @@
   *
   * Matthew Nicholson <mnicholson at digium.com>
@@ -5049,8 +5199,8 @@
  	ast_cli(fd, "\n\n");
 Index: contrib/scripts/safe_asterisk
 ===================================================================
---- contrib/scripts/safe_asterisk	(.../branches/1.8)	(revision 337855)
-+++ contrib/scripts/safe_asterisk	(.../team/irroot/distrotech-customers-1.8)	(revision 337855)
+--- contrib/scripts/safe_asterisk	(.../branches/1.8)	(revision 338894)
++++ contrib/scripts/safe_asterisk	(.../team/irroot/distrotech-customers-1.8)	(revision 338894)
 @@ -2,14 +2,14 @@
  # vim:textwidth=80:tabstop=4:shiftwidth=4:smartindent:autoindent
  
@@ -5093,7 +5243,7 @@
 Added: automerge
    + *
 Added: svnmerge-integrated
-   + /branches/1.8:1-337841
+   + /branches/1.8:1-338811
 Added: automerge-email
    + gregory at distrotech.co.za
 

Modified: team/irroot/patches/distrotech-10.patch
URL: http://svnview.digium.com/svn/asterisk/team/irroot/patches/distrotech-10.patch?view=diff&rev=338895&r1=338894&r2=338895
==============================================================================
--- team/irroot/patches/distrotech-10.patch (original)
+++ team/irroot/patches/distrotech-10.patch Sat Oct  1 04:02:37 2011
@@ -1,8 +1,8 @@
 Index: channels/chan_sip.c
 ===================================================================
---- channels/chan_sip.c	(.../branches/10)	(revision 337855)
-+++ channels/chan_sip.c	(.../team/irroot/distrotech-customers-10)	(revision 337855)
-@@ -5490,17 +5490,23 @@
+--- channels/chan_sip.c	(.../branches/10)	(revision 338894)
++++ channels/chan_sip.c	(.../team/irroot/distrotech-customers-10)	(revision 338894)
+@@ -5481,17 +5481,23 @@
  
  		if (p->rtp && !p->srtp && setup_srtp(&p->srtp) < 0) {
  			ast_log(LOG_WARNING, "SRTP audio setup failed\n");
@@ -29,7 +29,7 @@
  		}
  	}
  
-@@ -9031,32 +9037,48 @@
+@@ -9022,32 +9028,48 @@
  
  	if (secure_audio && !(p->srtp && (ast_test_flag(p->srtp, SRTP_CRYPTO_OFFER_OK)))) {
  		ast_log(LOG_WARNING, "Can't provide secure audio requested in SDP offer\n");
@@ -88,7 +88,7 @@
  	}
  
  	if (udptlportno == -1) {
-@@ -23010,7 +23032,8 @@
+@@ -23007,7 +23029,8 @@
  				transmit_response_with_t38_sdp(p, "200 OK", req, (reinvite ? XMIT_RELIABLE : (req->ignore ?  XMIT_UNRELIABLE : XMIT_CRITICAL)));
  			} else if ((p->t38.state == T38_DISABLED) || (p->t38.state == T38_REJECTED)) {
  				/* If this is not a re-invite or something to ignore - it's critical */
@@ -98,7 +98,7 @@
  					ast_log(LOG_WARNING, "Target does not support required crypto\n");
  					transmit_response_reliable(p, "488 Not Acceptable Here (crypto)", req);
  				} else {
-@@ -27211,6 +27234,11 @@
+@@ -27208,6 +27231,11 @@
  		int duplicate = 0;
  		/* remove leading/trailing whitespace from mailbox string */
  		mbox = ast_strip(mbox);
@@ -110,7 +110,7 @@
  		strsep(&context, "@");
  
  		if (ast_strlen_zero(mbox)) {
-@@ -27686,7 +27714,13 @@
+@@ -27683,7 +27711,13 @@
  			} else if (!strcasecmp(v->name, "use_q850_reason")) {
  				ast_set2_flag(&peer->flags[1], ast_true(v->value), SIP_PAGE2_Q850_REASON);
  			} else if (!strcasecmp(v->name, "encryption")) {
@@ -125,11 +125,10 @@
  			} else if (!strcasecmp(v->name, "encryption_taglen")) {
  				ast_set2_flag(&peer->flags[2], !strcasecmp(v->value, "32"), SIP_PAGE3_SRTP_TAG_32);
  			} else if (!strcasecmp(v->name, "snom_aoc_enabled")) {
-
 Index: channels/sip/include/sip.h
 ===================================================================
---- channels/sip/include/sip.h	(.../branches/10)	(revision 337855)
-+++ channels/sip/include/sip.h	(.../team/irroot/distrotech-customers-10)	(revision 337855)
+--- channels/sip/include/sip.h	(.../branches/10)	(revision 338894)
++++ channels/sip/include/sip.h	(.../team/irroot/distrotech-customers-10)	(revision 338894)
 @@ -355,9 +355,10 @@
  
  #define SIP_PAGE3_SNOM_AOC               (1 << 0)  /*!< DPG: Allow snom aoc messages */
@@ -142,44 +141,69 @@
  
  #define CHECK_AUTH_BUF_INITLEN   256
  
-
 Index: channels/chan_local.c
 ===================================================================
---- channels/chan_local.c	(.../branches/10)	(revision 337855)
-+++ channels/chan_local.c	(.../team/irroot/distrotech-customers-10)	(revision 337855)
-@@ -587,6 +587,7 @@
- static int local_write(struct ast_channel *ast, struct ast_frame *f)
+--- channels/chan_local.c	(.../branches/10)	(revision 338894)
++++ channels/chan_local.c	(.../team/irroot/distrotech-customers-10)	(revision 338894)
+@@ -649,9 +649,10 @@
+ static int local_indicate(struct ast_channel *ast, int condition, const void *data, size_t datalen)
  {
  	struct local_pvt *p = ast->tech_pvt;
 +	struct ast_channel *bridge;
- 	int res = -1;
- 	int isoutbound;
- 
-@@ -601,6 +602,20 @@
- 
- 	if (isoutbound && f && (f->frametype == AST_FRAME_VOICE || f->frametype == AST_FRAME_VIDEO)) {
- 		check_bridge(p);
-+	} else if (!isoutbound) {
-+		/* fixup formats nativeformat has changed we must adjust
+ 	int res = 0;
+ 	struct ast_frame f = { AST_FRAME_CONTROL, };
+-	int isoutbound;
++	int isoutbound = IS_OUTBOUND(ast, p);
+ 
+ 	if (!p)
+ 		return -1;
+@@ -674,7 +675,6 @@
+ 		 * happens to be in this control frame. The same applies for redirecting information, which
+ 		 * is why it is handled here as well.*/
+ 		ao2_lock(p);
+-		isoutbound = IS_OUTBOUND(ast, p);
+ 		if (isoutbound) {
+ 			this_channel = p->chan;
+ 			the_other_channel = p->owner;
+@@ -697,10 +697,33 @@
+ 			res = local_queue_frame(p, isoutbound, &f, ast, 1);
+ 		}
+ 		ao2_unlock(p);
++	} else if (!isoutbound && (condition == AST_CONTROL_SRCUPDATE)) {
++		bridge = ast_bridged_channel(ast);
++		ao2_lock(p);
++		/* fixup audio formats nativeformat might have changed we must adjust.
 +		 * ast is p->owner and is locked here*/
-+		bridge = ast_bridged_channel(ast);
-+		if (bridge && !ast_format_cap_identical(bridge->nativeformats, ast->nativeformats)) {
-+			ast_format_cap_copy(bridge->nativeformats, p->owner->nativeformats);
-+			ast_set_read_format(ast, &ast->readformat);
-+			ast_set_write_format(ast, &ast->writeformat);
-+			ast_channel_lock(p->chan);
-+			ast_format_cap_copy(bridge->nativeformats, p->chan->nativeformats);
-+			ast_set_read_format(p->chan, &p->chan->readformat);
-+			ast_set_write_format(p->chan, &p->chan->writeformat);
-+			ast_channel_unlock(p->chan);
-+		}
- 	}
- 
- 	if (!ast_test_flag(p, LOCAL_ALREADY_MASQED)) {
++		if (p->chan && bridge && (bridge != p->chan) &&
++		    !ast_format_cap_identical(bridge->nativeformats, ast->nativeformats)) {
++			if (!ast_channel_trylock(p->chan)) {
++				ast_format_cap_copy(ast->nativeformats, bridge->nativeformats);
++				ast_set_read_format(ast, &ast->readformat);
++				ast_set_write_format(ast, &ast->writeformat);
++				ast_format_cap_copy(p->chan->nativeformats, bridge->nativeformats);
++				ast_set_read_format(p->chan, &p->chan->readformat);
++				ast_set_write_format(p->chan, &p->chan->writeformat);
++				ast_channel_unlock(p->chan);
++			} else {
++				ast_verb(3, "Tried to get lock on %s to set audio format but failed\n", p->chan->name);
++			}
++		}
++		f.subclass.integer = condition;
++		f.data.ptr = (void*)data;
++		f.datalen = datalen;
++		res = local_queue_frame(p, isoutbound, &f, ast, 1);
++		ao2_unlock(p);
+ 	} else {
+ 		/* Queue up a frame representing the indication as a control frame */
+ 		ao2_lock(p);
+-		isoutbound = IS_OUTBOUND(ast, p);
+ 		f.subclass.integer = condition;
+ 		f.data.ptr = (void*)data;
+ 		f.datalen = datalen;
 Index: configure.ac
 ===================================================================
---- configure.ac	(.../branches/10)	(revision 337855)
-+++ configure.ac	(.../team/irroot/distrotech-customers-10)	(revision 337855)
+--- configure.ac	(.../branches/10)	(revision 338894)
++++ configure.ac	(.../team/irroot/distrotech-customers-10)	(revision 338894)
 @@ -1718,7 +1718,7 @@

[... 856 lines stripped ...]



More information about the asterisk-commits mailing list