[asterisk-commits] eliel: branch group/data_api_gsoc2009 r199223 - in /team/group/data_api_gsoc2...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jun 5 08:17:15 CDT 2009


Author: eliel
Date: Fri Jun  5 08:17:09 2009
New Revision: 199223

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=199223
Log:
Merged revisions 198248,198285,198312,198371,198375,198434,198437-198438,198442,198470,198498,198500,198511,198529-198530,198558,198561,198565,198597,198626,198661,198666,198670,198725,198727,198729,198762,198791,198824,198856,198892,198954,198958,199051,199091,199139 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
  r198248 | file | 2009-05-29 22:31:48 -0400 (Fri, 29 May 2009) | 2 lines
  
  When removing all packets from a dialog we also need to free the data if present.
................
  r198285 | seanbright | 2009-05-29 23:26:06 -0400 (Fri, 29 May 2009) | 15 lines
  
  Merged revisions 198251 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r198251 | seanbright | 2009-05-29 22:46:41 -0400 (Fri, 29 May 2009) | 8 lines
    
    Treat an empty FORWARD_CONTEXT the same way we treat a missing one.
    
    (closes issue #15056)
    Reported by: p_lindheimer
    Patches:
          05292009_bug15056.diff uploaded by seanbright (license 71)
    Tested by: p_lindheimer
  ........
................
  r198312 | russell | 2009-05-29 23:43:23 -0400 (Fri, 29 May 2009) | 12 lines
  
  Merged revisions 198311 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r198311 | russell | 2009-05-29 22:42:46 -0500 (Fri, 29 May 2009) | 5 lines
    
    Fix a crash that occurred when MWI SMDI messages expired.
    
    (closes issue #14561)
    Reported by: cmoss28
  ........
................
  r198371 | seanbright | 2009-05-30 15:38:58 -0400 (Sat, 30 May 2009) | 19 lines
  
  Merged revisions 198370 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r198370 | seanbright | 2009-05-30 15:36:20 -0400 (Sat, 30 May 2009) | 12 lines
    
    Properly terminate AMI JabberSend response messages.
    
    The response message (either Error or Success) needs an extra trailing \r\n
    after the fields to inform the client that the message is complete.
    
    (closes issue #14876)
    Reported by: srt
    Patches:
          05302009_1.4_res_jabber.c.diff uploaded by seanbright (license 71)
          asterisk_14876.patch uploaded by srt (license 378)
          trunk-14876-2.diff uploaded by phsultan (license 73)
  ........
................
  r198375 | seanbright | 2009-05-30 16:11:33 -0400 (Sat, 30 May 2009) | 13 lines
  
  Properly terminate the receive buffer before sending to iksemel.
  
  aji_io_recv takes the maximum number of bytes to read (instead of the total
  buffer size), so we have to subtract 1 from our buffer size.  Without this, when
  we receive packets that are larger than our buffer, iksemel will choke and
  things get wonky.
  
  (closes issue #15232)
  Reported by: lp0
  Patches:
        05302009_res_jabber.c.patch uploaded by seanbright (license 71)
  Tested by: seanbright, lp0
................
  r198434 | russell | 2009-05-30 21:19:30 -0400 (Sat, 30 May 2009) | 2 lines
  
  Constify the ast_frame arg to ast_queue_frame().
................
  r198437 | eliel | 2009-05-30 21:22:15 -0400 (Sat, 30 May 2009) | 11 lines
  
  Avoid a crash when res_timing_dahdi is unloaded but wasn't properly loaded.
  
  if dahdi_test_timer() fails, timing_funcs_handle remains NULL causing a crash
  when calling ast_unregister_timing_interface() with a NULL pointer.
  
  (closes issue #15234)
  Reported by: eliel
  Patches:
        timing_dahdi1.diff uploaded by eliel (license 64)
................
  r198438 | russell | 2009-05-30 21:40:02 -0400 (Sat, 30 May 2009) | 2 lines
  
  Constification and remove some unused code.
................
  r198442 | eliel | 2009-05-30 22:09:06 -0400 (Sat, 30 May 2009) | 3 lines
  
  Filter the say.o object, it is being added later.
................
  r198470 | tilghman | 2009-05-31 13:52:28 -0400 (Sun, 31 May 2009) | 2 lines
  
  Fix documentation for FIELDQTY.
................
  r198498 | file | 2009-06-01 09:31:27 -0400 (Mon, 01 Jun 2009) | 5 lines
  
  Fix a bug where the Event and Content-Type headers were added twice to outgoing SIP NOTIFY messages.
  
  (closes issue #15239)
  Reported by: pj
................
  r198500 | mmichelson | 2009-06-01 10:02:05 -0400 (Mon, 01 Jun 2009) | 6 lines
  
  Remove documentation for the 'exten' argument to the AGENT function.
  
  Since AgentCallbackLogin has been removed, this should not be documented
  any more.
................
  r198511 | mmichelson | 2009-06-01 10:19:49 -0400 (Mon, 01 Jun 2009) | 3 lines
  
  Add missing unlock of local pvt.
................
  r198529 | mmichelson | 2009-06-01 10:42:57 -0400 (Mon, 01 Jun 2009) | 5 lines
  
  Remove extra lock from local_indicate in connected line case.
  
  Oh, and this fixes a deadlock I was seeing.
................
  r198530 | mmichelson | 2009-06-01 10:45:43 -0400 (Mon, 01 Jun 2009) | 3 lines
  
  Remove extra lock from app_queue.
................
  r198558 | dvossel | 2009-06-01 11:23:21 -0400 (Mon, 01 Jun 2009) | 3 lines
  
  Fixed an issue in the threadstorage cli functions resulting from the constification of struct ast_cli_args in r196072.
................
  r198561 | eliel | 2009-06-01 11:38:48 -0400 (Mon, 01 Jun 2009) | 2 lines
  
  Move static documentation of E|Dead|AGI() application and manager action to XML.
................
  r198565 | eliel | 2009-06-01 12:09:42 -0400 (Mon, 01 Jun 2009) | 2 lines
  
  Move JabberSend manager action from static docs to the AstXML form.
................
  r198597 | eliel | 2009-06-01 13:53:38 -0400 (Mon, 01 Jun 2009) | 3 lines
  
  Do not add say.o in a separate line.
................
  r198626 | tilghman | 2009-06-01 14:40:35 -0400 (Mon, 01 Jun 2009) | 2 lines
  
  Add information for new meetme realtime fields
................
  r198661 | eliel | 2009-06-01 15:37:30 -0400 (Mon, 01 Jun 2009) | 6 lines
  
  Moved more static documentation to the new AstXML form.
  
  Moved more static docs to XML (pplications and manager actions):
  Monitor, StopMonitor, ChangeMonitor, PauseMonitor, UnpauseMonitor.
................
  r198666 | tilghman | 2009-06-01 16:09:56 -0400 (Mon, 01 Jun 2009) | 13 lines
  
  Blocked revisions 198665 via svnmerge
  
  ........
    r198665 | tilghman | 2009-06-01 15:07:04 -0500 (Mon, 01 Jun 2009) | 7 lines
    
    If using the old deprecated format, a reload would cause the class to disappear.
    (closes issue #14759)
     Reported by: lidocaineus
     Patches: 
           20090518__issue14759.diff.txt uploaded by tilghman (license 14)
     Tested by: lmadsen
  ........
................
  r198670 | russell | 2009-06-01 16:17:50 -0400 (Mon, 01 Jun 2009) | 2 lines
  
  Minor whitespace fix.
................
  r198725 | tilghman | 2009-06-01 16:33:50 -0400 (Mon, 01 Jun 2009) | 8 lines
  
  Add INCrement and DECrement functions
  (closes issue #15025)
   Reported by: greenfieldtech
   Patches: 
         func_math.c.patch_v4 uploaded by greenfieldtech (license 369)
         slightly modified by me
   Tested by: greenfieldtech, lmadsen
................
  r198727 | mmichelson | 2009-06-01 16:57:31 -0400 (Mon, 01 Jun 2009) | 13 lines
  
  Add the ability to execute connected line interception macros.
  
  When connected line updates are received or generated in the middle
  of an application call, it is now possible to execute a macro to
  manipulate the connected line data. This way, phone numbers may be
  manipulated to be more presentable to users, names may be changed 
  for...whatever reason, or whatever else needs to be done may be.
  
  Review: https://reviewboard.asterisk.org/r/256
  
  AST-165
................
  r198729 | russell | 2009-06-01 17:03:18 -0400 (Mon, 01 Jun 2009) | 2 lines
  
  Tell the IAX2 parser about more control frame types.
................
  r198762 | file | 2009-06-02 09:12:59 -0400 (Tue, 02 Jun 2009) | 5 lines
  
  Fix a bug where we were passing in address information that should remain unmodified to a function that may modify it.
  
  (closes issue #15243)
  Reported by: pj
................
  r198791 | file | 2009-06-02 09:48:06 -0400 (Tue, 02 Jun 2009) | 5 lines
  
  Correct documentation for the register line, specifically where the domain should be specified.
  
  (closes issue #14367)
  Reported by: Nick_Lewis
................
  r198824 | dvossel | 2009-06-02 13:55:35 -0400 (Tue, 02 Jun 2009) | 8 lines
  
  fixes issue with channels not going down after transfer
  
  Iax2 currently does not support native bridging if the timeoutms value is set.  We check for that in iax2_bridge, but then set timeoutms to 0 by default.  If the timeoutms is not provided it is set to -1. By setting timeoutms to 0 it is processed causing a bridging retry loop.
  
  (closes issue #15216)
  Reported by: oxymoron
  Tested by: dvossel
................
  r198856 | dvossel | 2009-06-02 17:17:49 -0400 (Tue, 02 Jun 2009) | 10 lines
  
  Generic call forward api, ast_call_forward()
  
  The function ast_call_forward() forwards a call to an extension specified in an ast_channel's call_forward string.  After an ast_channel is called, if the channel's call_forward string is set this function can be used to forward the call to a new channel and terminate the original one.  I have included this api call in both channel.c's ast_request_and_dial() and feature.c's feature_request_and_dial().  App_dial and app_queue already contain call forward logic specific for their application and options.
  
  (closes issue #13630)
  Reported by: festr
  
  Review: https://reviewboard.asterisk.org/r/271/
................
  r198892 | dvossel | 2009-06-03 11:51:10 -0400 (Wed, 03 Jun 2009) | 15 lines
  
  Blocked revisions 198891 via svnmerge
  
  ........
    r198891 | dvossel | 2009-06-03 10:49:46 -0500 (Wed, 03 Jun 2009) | 10 lines
    
    Generic call forward api, ast_call_forward()
    
    The function ast_call_forward() forwards a call to an extension specified in an ast_channel's call_forward string.  After an ast_channel is called, if the channel's call_forward string is set this function can be used to forward the call to a new channel and terminate the original one.  I have included this api call in both channel.c's ast_request_and_dial() and res_feature.c's feature_request_and_dial().  App_dial and app_queue already contain call forward logic specific for their application and options.
    
    (closes issue #13630)
    Reported by: festr
    
    Review: https://reviewboard.asterisk.org/r/271/
  ........
................
  r198954 | dvossel | 2009-06-03 16:30:10 -0400 (Wed, 03 Jun 2009) | 3 lines
  
  ast_call_forward() todo notes and originate flag copy.
................
  r198958 | seanbright | 2009-06-03 16:49:11 -0400 (Wed, 03 Jun 2009) | 17 lines
  
  Blocked revisions 198957 via svnmerge
  
  ........
    r198957 | seanbright | 2009-06-03 16:39:10 -0400 (Wed, 03 Jun 2009) | 11 lines
    
    Fix a possible crash in pbx_spool.
    
    We were trying to reference members of a struct that had previously been freed.
    This patch makes sure that we free the struct after it has been removed from
    the spooler queue.
    
    (closes issue #15072)
    Reported by: garlew
    Patches:
          spool.diff uploaded by garlew (license 376)
  ........
................
  r199051 | seanbright | 2009-06-04 10:31:24 -0400 (Thu, 04 Jun 2009) | 47 lines
  
  Merged revisions 199022 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r199022 | seanbright | 2009-06-04 10:14:57 -0400 (Thu, 04 Jun 2009) | 40 lines
    
    Safely handle AMI connections/reload requests that occur during startup.
    
    During asterisk startup, a lock on the list of modules is obtained by the
    primary thread while each module is initialized.  Issue 13778 pointed out a
    problem with this approach, however.  Because the AMI is loaded before other
    modules, it is possible for a module reload to be issued by a connected client
    (via Action: Command), causing a deadlock.
    
    The resolution for 13778 was to move initialization of the manager to happen
    after the other modules had already been lodaded.  While this fixed this
    particular issue, it caused a problem for users (like FreePBX) who call AMI
    scripts via an #exec in a configuration file (See issue 15189).
    
    The solution I have come up with is to defer any reload requests that come in
    until after the server is fully booted.  When a call comes in to
    ast_module_reload (from wherever) before we are fully booted, the request is
    added to a queue of pending requests.  Once we are done booting up, we then
    execute these deferred requests in turn.
    
    Note that I have tried to make this a bit more intelligent in that it will not
    queue up more than 1 request for the same module to be reloaded, and if a
    general reload request comes in ('module reload') the queue is flushed and we
    only issue a single deferred reload for the entire system.
    
    As for how this will impact existing installations - Before 13778, a reload
    issued before module initialization was completed would result in a deadlock.
    After 13778, you simply couldn't connect to the manager during startup (which
    causes problems with #exec-that-calls-AMI configuration files).  I believe this
    is a good general purpose solution that won't negatively impact existing
    installations.
    
    (closes issue #15189)
    (closes issue #13778)
    Reported by: p_lindheimer
    Patches:
          06032009_15189_deferred_reloads.diff uploaded by seanbright (license 71)
    Tested by: p_lindheimer, seanbright
    
    Review: https://reviewboard.asterisk.org/r/272/
  ........
................
  r199091 | eliel | 2009-06-04 12:29:50 -0400 (Thu, 04 Jun 2009) | 11 lines
  
  Move static docs to the new AstXML form.
  
  Move SMDI_MSG and SMDI_MSG_RETRIEVE functions statis documentation
  to XML.
  
  (issue #15245)
  Reported by: eliel
  Patches:
        res_smdi_static_conversion.txt uploaded by lmadsen (license 10)
................
  r199139 | dvossel | 2009-06-04 15:10:16 -0400 (Thu, 04 Jun 2009) | 9 lines
  
  Merged revisions 199138 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r199138 | dvossel | 2009-06-04 14:00:15 -0500 (Thu, 04 Jun 2009) | 3 lines
    
    Additional updates to AST-2009-001
  ........
................

Modified:
    team/group/data_api_gsoc2009/   (props changed)
    team/group/data_api_gsoc2009/apps/app_dial.c
    team/group/data_api_gsoc2009/apps/app_directed_pickup.c
    team/group/data_api_gsoc2009/apps/app_macro.c
    team/group/data_api_gsoc2009/apps/app_queue.c
    team/group/data_api_gsoc2009/channels/chan_agent.c
    team/group/data_api_gsoc2009/channels/chan_iax2.c
    team/group/data_api_gsoc2009/channels/chan_local.c
    team/group/data_api_gsoc2009/channels/chan_sip.c
    team/group/data_api_gsoc2009/channels/iax2-parser.c
    team/group/data_api_gsoc2009/configs/sip.conf.sample
    team/group/data_api_gsoc2009/contrib/scripts/meetme.sql
    team/group/data_api_gsoc2009/doc/tex/channelvariables.tex
    team/group/data_api_gsoc2009/funcs/func_math.c
    team/group/data_api_gsoc2009/funcs/func_strings.c
    team/group/data_api_gsoc2009/include/asterisk/_private.h
    team/group/data_api_gsoc2009/include/asterisk/app.h
    team/group/data_api_gsoc2009/include/asterisk/channel.h
    team/group/data_api_gsoc2009/include/asterisk/frame.h
    team/group/data_api_gsoc2009/main/Makefile
    team/group/data_api_gsoc2009/main/app.c
    team/group/data_api_gsoc2009/main/asterisk.c
    team/group/data_api_gsoc2009/main/channel.c
    team/group/data_api_gsoc2009/main/dial.c
    team/group/data_api_gsoc2009/main/features.c
    team/group/data_api_gsoc2009/main/loader.c
    team/group/data_api_gsoc2009/main/manager.c
    team/group/data_api_gsoc2009/main/rtp_engine.c
    team/group/data_api_gsoc2009/main/threadstorage.c
    team/group/data_api_gsoc2009/res/res_agi.c
    team/group/data_api_gsoc2009/res/res_jabber.c
    team/group/data_api_gsoc2009/res/res_monitor.c
    team/group/data_api_gsoc2009/res/res_smdi.c
    team/group/data_api_gsoc2009/res/res_timing_dahdi.c

Propchange: team/group/data_api_gsoc2009/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.

Propchange: team/group/data_api_gsoc2009/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/group/data_api_gsoc2009/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Jun  5 08:17:09 2009
@@ -1,1 +1,1 @@
-/trunk:1-198235
+/trunk:1-199221

Modified: team/group/data_api_gsoc2009/apps/app_dial.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/data_api_gsoc2009/apps/app_dial.c?view=diff&rev=199223&r1=199222&r2=199223
==============================================================================
--- team/group/data_api_gsoc2009/apps/app_dial.c (original)
+++ team/group/data_api_gsoc2009/apps/app_dial.c Fri Jun  5 08:17:09 2009
@@ -724,6 +724,8 @@
  *
  * XXX this code is highly suspicious, as it essentially overwrites
  * the outgoing channel without properly deleting it.
+ *
+ * \todo eventually this function should be intergrated into and replaced by ast_call_forward() 
  */
 static void do_forward(struct chanlist *o,
 	struct cause_args *num, struct ast_flags64 *peerflags, int single, int *to)
@@ -746,6 +748,9 @@
 		const char *forward_context;
 		ast_channel_lock(c);
 		forward_context = pbx_builtin_getvar_helper(c, "FORWARD_CONTEXT");
+		if (ast_strlen_zero(forward_context)) {
+			forward_context = NULL;
+		}
 		snprintf(tmpchan, sizeof(tmpchan), "%s@%s", c->call_forward, forward_context ? forward_context : c->context);
 		ast_channel_unlock(c);
 		stuff = tmpchan;
@@ -934,7 +939,9 @@
 					ast_verb(3, "%s answered %s\n", c->name, in->name);
 					if (!single && !ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE)) {
 						if (o->connected.id.number) {
-							ast_channel_update_connected_line(in, &o->connected);
+							if (ast_channel_connected_line_macro(c, in, &o->connected, 1, 0)) {
+								ast_channel_update_connected_line(in, &o->connected);
+							}
 						} else if (!ast_test_flag64(o, DIAL_NOCONNECTEDLINE)) {
 							ast_channel_lock(c);
 							ast_connected_line_copy_from_caller(&connected_caller, &c->cid);
@@ -984,7 +991,9 @@
 						ast_verb(3, "%s answered %s\n", c->name, in->name);
 						if (!single && !ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE)) {
 							if (o->connected.id.number) {
-								ast_channel_update_connected_line(in, &o->connected);
+								if (ast_channel_connected_line_macro(c, in, &o->connected, 1, 0)) {
+									ast_channel_update_connected_line(in, &o->connected);
+								}
 							} else if (!ast_test_flag64(o, DIAL_NOCONNECTEDLINE)) {
 								ast_channel_lock(c);
 								ast_connected_line_copy_from_caller(&connected_caller, &c->cid);
@@ -1073,8 +1082,9 @@
 						ast_party_connected_line_set(&o->connected, &connected);
 						ast_party_connected_line_free(&connected);
 					} else {
-						ast_verb(3, "%s connected line has changed, passing it to %s\n", c->name, in->name);
-						ast_indicate_data(in, AST_CONTROL_CONNECTED_LINE, f->data.ptr, f->datalen);
+						if (ast_channel_connected_line_macro(c, in, f, 1, 1)) {
+							ast_indicate_data(in, AST_CONTROL_CONNECTED_LINE, f->data.ptr, f->datalen);
+						}
 					}
 					break;
 				case AST_CONTROL_REDIRECTING:
@@ -1195,15 +1205,19 @@
 				if (ast_write(outgoing->chan, f))
 					ast_log(LOG_WARNING, "Unable to forward voice or dtmf\n");
 			}
-			if (single && (f->frametype == AST_FRAME_CONTROL) &&
-				((f->subclass == AST_CONTROL_HOLD) ||
-				(f->subclass == AST_CONTROL_UNHOLD) ||
-				(f->subclass == AST_CONTROL_VIDUPDATE) ||
-				(f->subclass == AST_CONTROL_SRCUPDATE) ||
-				(f->subclass == AST_CONTROL_CONNECTED_LINE) ||
-				(f->subclass == AST_CONTROL_REDIRECTING))) {
-				ast_verb(3, "%s requested special control %d, passing it to %s\n", in->name, f->subclass, outgoing->chan->name);
-				ast_indicate_data(outgoing->chan, f->subclass, f->data.ptr, f->datalen);
+			if (single && (f->frametype == AST_FRAME_CONTROL)) { 
+				if ((f->subclass == AST_CONTROL_HOLD) ||
+				    (f->subclass == AST_CONTROL_UNHOLD) ||
+				    (f->subclass == AST_CONTROL_VIDUPDATE) ||
+				    (f->subclass == AST_CONTROL_SRCUPDATE) ||
+				    (f->subclass == AST_CONTROL_REDIRECTING)) {
+					ast_verb(3, "%s requested special control %d, passing it to %s\n", in->name, f->subclass, outgoing->chan->name);
+					ast_indicate_data(outgoing->chan, f->subclass, f->data.ptr, f->datalen);
+				} else if (f->subclass == AST_CONTROL_CONNECTED_LINE) {
+					if (ast_channel_connected_line_macro(in, outgoing->chan, f, 0, 1)) {
+						ast_indicate_data(outgoing->chan, f->subclass, f->data.ptr, f->datalen);
+					}
+				}
 			}
 			ast_frfree(f);
 		}

Modified: team/group/data_api_gsoc2009/apps/app_directed_pickup.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/data_api_gsoc2009/apps/app_directed_pickup.c?view=diff&rev=199223&r1=199222&r2=199223
==============================================================================
--- team/group/data_api_gsoc2009/apps/app_directed_pickup.c (original)
+++ team/group/data_api_gsoc2009/apps/app_directed_pickup.c Fri Jun  5 08:17:09 2009
@@ -98,7 +98,9 @@
 
 	connected_caller = target->connected;
 	connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
-	ast_channel_update_connected_line(chan, &connected_caller);
+	if (ast_channel_connected_line_macro(NULL, chan, &connected_caller, 0, 0)) {
+		ast_channel_update_connected_line(chan, &connected_caller);
+	}
 
 	ast_channel_lock(chan);
 	ast_connected_line_copy_from_caller(&connected_caller, &chan->cid);

Modified: team/group/data_api_gsoc2009/apps/app_macro.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/data_api_gsoc2009/apps/app_macro.c?view=diff&rev=199223&r1=199222&r2=199223
==============================================================================
--- team/group/data_api_gsoc2009/apps/app_macro.c (original)
+++ team/group/data_api_gsoc2009/apps/app_macro.c Fri Jun  5 08:17:09 2009
@@ -36,6 +36,7 @@
 #include "asterisk/config.h"
 #include "asterisk/utils.h"
 #include "asterisk/lock.h"
+#include "asterisk/app.h"
 
 /*** DOCUMENTATION
 	<application name="Macro" language="en_US">

Modified: team/group/data_api_gsoc2009/apps/app_queue.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/data_api_gsoc2009/apps/app_queue.c?view=diff&rev=199223&r1=199222&r2=199223
==============================================================================
--- team/group/data_api_gsoc2009/apps/app_queue.c (original)
+++ team/group/data_api_gsoc2009/apps/app_queue.c Fri Jun  5 08:17:09 2009
@@ -2735,7 +2735,6 @@
 		strcpy(tmp->chan->cdr->accountcode, qe->chan->cdr->accountcode);
 		strcpy(tmp->chan->cdr->userfield, qe->chan->cdr->userfield);
 	}
-	ast_channel_unlock(qe->chan);
 
 	/* Place the call, but don't wait on the answer */
 	if ((res = ast_call(tmp->chan, location, 0))) {
@@ -3002,6 +3001,8 @@
  * \param[in] prebusies number of busy members calculated prior to calling wait_for_answer
  * \param[in] caller_disconnect if the 'H' option is used when calling Queue(), this is used to detect if the caller pressed * to disconnect the call
  * \param[in] forwardsallowed used to detect if we should allow call forwarding, based on the 'i' option to Queue()
+ *
+ * \todo eventually all call forward logic should be intergerated into and replaced by ast_call_forward()
  */
 static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callattempt *outgoing, int *to, char *digit, int prebusies, int caller_disconnect, int forwardsallowed, int update_connectedline)
 {
@@ -3093,7 +3094,9 @@
 					ast_verb(3, "%s answered %s\n", ochan_name, inchan_name);
 					if (update_connectedline) {
 						if (o->connected.id.number) {
-							ast_channel_update_connected_line(in, &o->connected);
+							if (ast_channel_connected_line_macro(o->chan, in, &o->connected, 1, 0)) {
+								ast_channel_update_connected_line(in, &o->connected);
+							}
 						} else if (o->update_connectedline) {
 							ast_channel_lock(o->chan);
 							ast_connected_line_copy_from_caller(&connected_caller, &o->chan->cid);
@@ -3193,7 +3196,9 @@
 								ast_verb(3, "%s answered %s\n", ochan_name, inchan_name);
 								if (update_connectedline) {
 									if (o->connected.id.number) {
-										ast_channel_update_connected_line(in, &o->connected);
+										if (ast_channel_connected_line_macro(o->chan, in, &o->connected, 1, 0)) {
+											ast_channel_update_connected_line(in, &o->connected);
+										}
 									} else if (o->update_connectedline) {
 										ast_channel_lock(o->chan);
 										ast_connected_line_copy_from_caller(&connected_caller, &o->chan->cid);
@@ -3253,8 +3258,9 @@
 								ast_party_connected_line_set(&o->connected, &connected);
 								ast_party_connected_line_free(&connected);
 							} else {
-								ast_verb(3, "%s connected line has changed, passing it to %s\n", ochan_name, inchan_name);
-								ast_indicate_data(in, AST_CONTROL_CONNECTED_LINE, f->data.ptr, f->datalen);
+								if (ast_channel_connected_line_macro(o->chan, in, f, 1, 1)) {
+									ast_indicate_data(in, AST_CONTROL_CONNECTED_LINE, f->data.ptr, f->datalen);
+								}
 							}
 							break;
 						case AST_CONTROL_REDIRECTING:

Modified: team/group/data_api_gsoc2009/channels/chan_agent.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/data_api_gsoc2009/channels/chan_agent.c?view=diff&rev=199223&r1=199222&r2=199223
==============================================================================
--- team/group/data_api_gsoc2009/channels/chan_agent.c (original)
+++ team/group/data_api_gsoc2009/channels/chan_agent.c Fri Jun  5 08:17:09 2009
@@ -156,9 +156,6 @@
 					<enum name="mohclass">
 						<para>MusicOnHold class</para>
 					</enum>
-					<enum name="exten">
-						<para>The callback extension for the Agent (AgentCallbackLogin)</para>
-					</enum>
 					<enum name="channel">
 						<para>The name of the active channel for the Agent (AgentLogin)</para>
 					</enum>

Modified: team/group/data_api_gsoc2009/channels/chan_iax2.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/data_api_gsoc2009/channels/chan_iax2.c?view=diff&rev=199223&r1=199222&r2=199223
==============================================================================
--- team/group/data_api_gsoc2009/channels/chan_iax2.c (original)
+++ team/group/data_api_gsoc2009/channels/chan_iax2.c Fri Jun  5 08:17:09 2009
@@ -736,7 +736,8 @@
 		/*! Default parkinglot */
 		AST_STRING_FIELD(parkinglot);
 	);
-	
+	/*! AUTHREJ all AUTHREP frames */
+	int authrej;
 	/*! permitted authentication methods */
 	int authmethods;
 	/*! permitted encryption methods */
@@ -4277,7 +4278,7 @@
 		return AST_BRIDGE_FAILED;
 	}
 
-	timeoutms = 0;
+	timeoutms = -1;
 
 	lock_both(callno0, callno1);
 	if (!iaxs[callno0] || !iaxs[callno1]) {
@@ -6488,6 +6489,18 @@
 			ast_string_field_set(iaxs[callno], secret, user->secret);
 		res = 0;
 		user = user_unref(user);
+	} else {
+		 /* user was not found, but we should still fake an AUTHREQ.
+		  * Set authmethods to the last known authmethod used by the system
+		  * Set a fake secret, it's not looked at, just required to attempt authentication.
+		  * Set authrej so the AUTHREP is rejected without even looking at its contents */
+		iaxs[callno]->authmethods = last_authmethod ? last_authmethod : (IAX_AUTH_MD5 | IAX_AUTH_PLAINTEXT);
+		ast_string_field_set(iaxs[callno], secret, "badsecret");
+		iaxs[callno]->authrej = 1;
+		if (!ast_strlen_zero(iaxs[callno]->username)) {
+			/* only send the AUTHREQ if a username was specified. */
+			res = 0;
+		}
 	}
 	ast_set2_flag(iaxs[callno], iax2_getpeertrunk(*sin), IAX_TRUNK);	
 	return res;
@@ -6598,6 +6611,9 @@
 		.name = p->username,	
 	};
 
+	if (p->authrej) {
+		return res;
+	}
 	user = ao2_find(users, &tmp_user, OBJ_POINTER);
 	if (user) {
 		if (ast_test_flag(p, IAX_MAXAUTHREQ)) {

Modified: team/group/data_api_gsoc2009/channels/chan_local.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/data_api_gsoc2009/channels/chan_local.c?view=diff&rev=199223&r1=199222&r2=199223
==============================================================================
--- team/group/data_api_gsoc2009/channels/chan_local.c (original)
+++ team/group/data_api_gsoc2009/channels/chan_local.c Fri Jun  5 08:17:09 2009
@@ -434,10 +434,11 @@
 			}
 			f.subclass = condition;
 			f.data.ptr = frame_data;
-			ast_mutex_lock(&p->lock);
 			if (!(res = local_queue_frame(p, isoutbound, &f, ast, 1))) {
 				ast_mutex_unlock(&p->lock);
 			}
+		} else {
+			ast_mutex_unlock(&p->lock);
 		}
 	} else {
 		/* Queue up a frame representing the indication as a control frame */

Modified: team/group/data_api_gsoc2009/channels/chan_sip.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/data_api_gsoc2009/channels/chan_sip.c?view=diff&rev=199223&r1=199222&r2=199223
==============================================================================
--- team/group/data_api_gsoc2009/channels/chan_sip.c (original)
+++ team/group/data_api_gsoc2009/channels/chan_sip.c Fri Jun  5 08:17:09 2009
@@ -3079,6 +3079,9 @@
 		dialog->packets = dialog->packets->next;
 		AST_SCHED_DEL(sched, cp->retransid);
 		dialog_unref(cp->owner, "remove all current packets in this dialog, and the pointer to the dialog too as part of __sip_destroy");
+		if (cp->data) {
+			ast_free(cp->data);
+		}
 		ast_free(cp);
 	}
 
@@ -7236,7 +7239,7 @@
 	if (hostname)
 		*hostname++ = '\0';
 	if (ast_strlen_zero(username) || ast_strlen_zero(hostname)) {
-		ast_log(LOG_WARNING, "Format for registration is [transport://]user[:secret[:authuser]]@domain[:port][/extension][~expiry] at line %d\n", lineno);
+		ast_log(LOG_WARNING, "Format for registration is [transport://]user[@domain][:secret[:authuser]]@host[:port][/extension][~expiry] at line %d\n", lineno);
 		return -1;
 	}
 
@@ -10791,8 +10794,6 @@
 
 	reqprep(&req, p, SIP_NOTIFY, 0, 1);
 
-	add_header(&req, "Event", subscriptiontype->event);
-	add_header(&req, "Content-Type", subscriptiontype->mediatype);
 	switch(state) {
 	case AST_EXTENSION_DEACTIVATED:
 		if (timeout)
@@ -20406,6 +20407,8 @@
 					/* Chan 2: Call from Asterisk to target */
 	int res = 0;
 	struct sip_pvt *targetcall_pvt;
+	struct ast_party_connected_line connected_to_transferee;
+	struct ast_party_connected_line connected_to_target;
 
 	/* Check if the call ID of the replaces header does exist locally */
 	if (!(targetcall_pvt = get_sip_pvt_byid_locked(transferer->refer->replaces_callid, transferer->refer->replaces_callid_totag, 
@@ -20473,6 +20476,13 @@
 		transferer->callid,
 		target.chan1->name,
 		target.chan1->uniqueid);
+	ast_party_connected_line_init(&connected_to_transferee);
+	ast_party_connected_line_init(&connected_to_target);
+	/* No need to lock current->chan1 here since it was locked in sipsock_read */
+	ast_party_connected_line_copy(&connected_to_transferee, &current->chan1->connected);
+	/* No need to lock target.chan1 here since it was locked in get_sip_pvt_byid_locked */
+	ast_party_connected_line_copy(&connected_to_target, &target.chan1->connected);
+	connected_to_target.source = connected_to_transferee.source = AST_CONNECTED_LINE_UPDATE_SOURCE_TRANSFER;
 	res = attempt_transfer(current, &target);
 	sip_pvt_unlock(targetcall_pvt);
 	if (res) {
@@ -20483,8 +20493,6 @@
 			ast_channel_unlock(targetcall_pvt->owner);
 		ast_clear_flag(&transferer->flags[0], SIP_DEFER_BYE_ON_TRANSFER);
 	} else {
-		struct ast_party_connected_line connected_caller;
-
 		/* Transfer succeeded! */
 		const char *xfersound = pbx_builtin_getvar_helper(target.chan1, "ATTENDED_TRANSFER_COMPLETE_SOUND");
 
@@ -20500,45 +20508,29 @@
 			ast_channel_unlock(targetcall_pvt->owner);
 		}
 
-		ast_party_connected_line_init(&connected_caller);
+		/* By forcing the masquerade, we know that target.chan1 and target.chan2 are bridged. We then
+		 * can queue connected line updates where they need to go.
+		 *
+		 * No need to lock target.chan1 here since it was previously locked in get_sip_pvt_byid_locked
+		 */
+		if (target.chan1->masq) {
+			/* If the channel thread already did the masquerade, then we don't need to do anything */
+			ast_do_masquerade(target.chan1);
+		}
 		if (target.chan2) {
-			if (current->chan2) {
-				/* Tell each of the other channels to whom they are now connected */
-				ast_channel_lock(current->chan2);
-				ast_connected_line_copy_from_caller(&connected_caller, &current->chan2->cid);
-				ast_channel_unlock(current->chan2);
-				connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_TRANSFER;
-				ast_channel_update_connected_line(target.chan2, &connected_caller);
-				ast_channel_lock(target.chan2);
-				ast_connected_line_copy_from_caller(&connected_caller, &target.chan2->cid);
-				ast_channel_unlock(target.chan2);
-				connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_TRANSFER;
-				ast_channel_update_connected_line(current->chan2, &connected_caller);
-				ast_party_connected_line_free(&connected_caller);
-			}
+			ast_channel_queue_connected_line_update(target.chan1, &connected_to_transferee);
+			ast_channel_queue_connected_line_update(target.chan2, &connected_to_target);
 		} else {
-			/* Notify the first other party that they are connected to someone else assuming that target.chan1
-			   has progressed far enough through the dialplan to have its called party information set. */
-			if (current->chan2) {
-				ast_channel_lock(target.chan1);
-				ast_party_connected_line_copy(&connected_caller, &target.chan1->connected);
-				ast_channel_unlock(target.chan1);
-				connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_TRANSFER;
-				ast_channel_update_connected_line(current->chan2, &connected_caller);
-				ast_party_connected_line_free(&connected_caller);
-			}
-
-			/* We can't indicate to the called channel directly so we force the masquerade to complete
-			   and queue and update to be read and passed-through */
-			ast_channel_lock(target.chan1);
-			ast_do_masquerade(target.chan1);
-			ast_channel_unlock(target.chan1);
-
-			ast_party_connected_line_collect_caller(&connected_caller, &target.chan1->cid);
-			connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_TRANSFER;
-			ast_channel_queue_connected_line_update(target.chan1, &connected_caller);
-		}
-	}
+			/* Since target.chan1 isn't actually connected to another channel, there is no way for us
+			 * to queue a frame so that its connected line status will be updated. Instead, we have to
+			 * change it directly. Since we are not the channel thread, we cannot run a connected line
+			 * interception macro on target.chan1
+			 */
+			ast_channel_update_connected_line(target.chan1, &connected_to_target);
+		}
+	}
+	ast_party_connected_line_free(&connected_to_target);
+	ast_party_connected_line_free(&connected_to_transferee);
 	if (targetcall_pvt)
 		ao2_t_ref(targetcall_pvt, -1, "drop targetcall_pvt");
 	return 1;

Modified: team/group/data_api_gsoc2009/channels/iax2-parser.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/data_api_gsoc2009/channels/iax2-parser.c?view=diff&rev=199223&r1=199222&r2=199223
==============================================================================
--- team/group/data_api_gsoc2009/channels/iax2-parser.c (original)
+++ team/group/data_api_gsoc2009/channels/iax2-parser.c Fri Jun  5 08:17:09 2009
@@ -573,7 +573,13 @@
 		"PROCDNG",
 		"HOLD   ",
 		"UNHOLD ",
-		"VIDUPDT", };
+		"VIDUPDT",
+		"T38    ",
+		"SRCUPDT",
+		"TXFER  ",
+		"CNLINE ",
+		"REDIR  ",
+	};
 	struct ast_iax2_full_hdr *fh;
 	char retries[20];
 	char class2[20];

Modified: team/group/data_api_gsoc2009/configs/sip.conf.sample
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/data_api_gsoc2009/configs/sip.conf.sample?view=diff&rev=199223&r1=199222&r2=199223
==============================================================================
--- team/group/data_api_gsoc2009/configs/sip.conf.sample (original)
+++ team/group/data_api_gsoc2009/configs/sip.conf.sample Fri Jun  5 08:17:09 2009
@@ -475,7 +475,7 @@
 ;----------------------------------------- OUTBOUND SIP REGISTRATIONS  ------------------------
 ; Asterisk can register as a SIP user agent to a SIP proxy (provider)
 ; Format for the register statement is:
-;       register => [transport://]user[:secret[:authuser]]@domain[:port][/extension][~expiry]
+;       register => [transport://]user[@domain][:secret[:authuser]]@host[:port][/extension][~expiry]
 ;
 ;
 ;

Modified: team/group/data_api_gsoc2009/contrib/scripts/meetme.sql
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/data_api_gsoc2009/contrib/scripts/meetme.sql?view=diff&rev=199223&r1=199222&r2=199223
==============================================================================
--- team/group/data_api_gsoc2009/contrib/scripts/meetme.sql (original)
+++ team/group/data_api_gsoc2009/contrib/scripts/meetme.sql Fri Jun  5 08:17:09 2009
@@ -4,9 +4,17 @@
 
 CREATE TABLE meetme (
 	confno char(80) DEFAULT '0' NOT NULL,
+	-- Must set schedule=yes in meetme.conf to use starttime and endtime
+	starttime datetime NULL,
+	endtime datetime NULL,
+	-- PIN to enter the conference, if any
 	pin char(20) NULL,
+	-- PIN to enter the conference as an administrator, if any
 	adminpin char(20) NULL,
+	-- Current count of conference participants
 	members integer DEFAULT 0 NOT NULL,
-	PRIMARY KEY (confno)
+	-- Maximum conference participants allowed concurrently
+	maxusers integer DEFAULT 0 NOT NULL,
+	PRIMARY KEY (confno, starttime)
 );
 

Modified: team/group/data_api_gsoc2009/doc/tex/channelvariables.tex
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/data_api_gsoc2009/doc/tex/channelvariables.tex?view=diff&rev=199223&r1=199222&r2=199223
==============================================================================
--- team/group/data_api_gsoc2009/doc/tex/channelvariables.tex (original)
+++ team/group/data_api_gsoc2009/doc/tex/channelvariables.tex Fri Jun  5 08:17:09 2009
@@ -1005,3 +1005,10 @@
 ${OSPOUTTIMELIMIT}      Duration limit for out_bound call
 ${OSPRESULTS}           Number of remained destinations
 \end{verbatim}
+
+\subsection{Connected line digit manipulation}
+\begin{verbatim}
+${CONNECTED_LINE_SEND_CALLEE_MACRO}        Macro to call before sending a connected line update to the callee
+${CONNECTED_LINE_SEND_CALLEE_MACRO_ARGS}   Arguments to pass to ${CONNECTED_LINE_SEND_CALLEE_MACRO}
+${CONNECTED_LINE_SEND_CALLER_MACRO}        Macro to call before sending a connected line update to the caller
+${CONNECTED_LINE_SEND_CALLER_MACRO_ARGS}   Arguments to pass to ${CONNECTED_LINE_SEND_CALLER_MACRO}

Modified: team/group/data_api_gsoc2009/funcs/func_math.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/data_api_gsoc2009/funcs/func_math.c?view=diff&rev=199223&r1=199222&r2=199223
==============================================================================
--- team/group/data_api_gsoc2009/funcs/func_math.c (original)
+++ team/group/data_api_gsoc2009/funcs/func_math.c Fri Jun  5 08:17:09 2009
@@ -1,9 +1,10 @@
 /*
  * Asterisk -- An open source telephony toolkit.
  *
- * Copyright (C) 2004 - 2006, Andy Powell 
+ * Copyright (C) 2004 - 2006, Andy Powell
  *
  * Updated by Mark Spencer <markster at digium.com>
+ * Updated by Nir Simionovich <nirs at greenfieldtech.net>
  *
  * See http://www.asterisk.org for more information about
  * the Asterisk project. Please do not directly contact
@@ -22,6 +23,7 @@
  *
  * \author Andy Powell
  * \author Mark Spencer <markster at digium.com>

[... 1910 lines stripped ...]



More information about the asterisk-commits mailing list