[asterisk-commits] file: branch file/pimp_sip_nat r382115 - in /team/file/pimp_sip_nat: ./ addon...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Feb 26 14:15:59 CST 2013


Author: file
Date: Tue Feb 26 14:15:55 2013
New Revision: 382115

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=382115
Log:
Multiple revisions 381751,381795,381871,381884,381897,381920,381952,381979,382010,382025,382057,382072,382112,382114

........
  r381751 | root | 2013-02-19 13:18:01 -0400 (Tue, 19 Feb 2013) | 44 lines
  
  Merged revisions 381741,381749 via svnmerge from 
  file:///srv/subversion/repos/asterisk/trunk
  
  ................
    r381741 | kharwell | 2013-02-19 10:23:29 -0600 (Tue, 19 Feb 2013) | 20 lines
    
    Confbridge channels staying active when all participants leave.
    
    If you started/stopped recording of a conference multiple times channels
    would remain active even when all participants left the conference.  This
    was due to the fact that a reference to the confbridge was being added
    every time a start record command was issued, but when the recording was
    stopped there was no matching de-reference thus keeping the conference alive.
    Made sure only a single reference is added for the record thread no matter how
    many times recording is started/stopped.  A de-reference is issued upon thread
    ending.
    
    Note, this issue is being fixed under AST-1088 since it relates to it and
    should have been corrected along with those modifications.
    
    (issue AST-1088)
    Reported by: John Bigelow
    ........
    
    Merged revisions 381737 from http://svn.asterisk.org/svn/asterisk/branches/11
  ................
    r381749 | elguero | 2013-02-19 11:17:10 -0600 (Tue, 19 Feb 2013) | 15 lines
    
    Add The Status Of A Module To The Output Of "CLI> module show"
    
    When a module's configuration is not loadable, we still load the module but it
    is not in a running state.  When trying to troubleshoot, let's say, why
    chan_motif is ignoring inbound XMPP traffic, there is no way to indicate that a
    loaded module is not currently running.
    
    (closes issue ASTERISK-21108)
    Reported by: Rusty Newton
    Tested by: Michael L. Young
    Patches:
      asterisk-21108_add_status-v2.diff Michael L. Young (license 5026)
    
    Review: https://reviewboard.asterisk.org/r/2331/
  ................
........
  r381795 | root | 2013-02-19 16:17:58 -0400 (Tue, 19 Feb 2013) | 24 lines
  
  Merged revisions 381792 via svnmerge from 
  file:///srv/subversion/repos/asterisk/trunk
  
  ................
    r381792 | kharwell | 2013-02-19 13:47:42 -0600 (Tue, 19 Feb 2013) | 17 lines
    
    Write the correct callid to the data1 field in queue_log for transfer events.
    
    The incorrect callid was being written to the "data1" field in queue_log table
    for transfer events.  The callid of the queue was being written instead of the
    transfer target's callid.  This now gets the correct "transfer to" number and
    places that in the "data1" field of the queue_log table when a transfer event
    is triggered.
    
    (closes issue ASTERISK-19960)
    Reported by: vladimir shmagin
    ........
    
    Merged revisions 381770 from http://svn.asterisk.org/svn/asterisk/branches/1.8
    ........
    
    Merged revisions 381791 from http://svn.asterisk.org/svn/asterisk/branches/11
  ................
........
  r381871 | root | 2013-02-21 22:18:02 -0400 (Thu, 21 Feb 2013) | 23 lines
  
  Merged revisions 381869 via svnmerge from 
  file:///srv/subversion/repos/asterisk/trunk
  
  ................
    r381869 | mjordan | 2013-02-21 19:52:14 -0600 (Thu, 21 Feb 2013) | 16 lines
    
    Properly detect launchd
    
    Asterisk was a little too pro-active in claiming that it found launchd. On
    systems without launchd - such as FreeBSD - this resulted in certain items
    in Asterisk that conflict with launchd to not be selectable, such as
    res_timing_kqueue.
    
    (closes issue ASTERISK-20749)
    Reported by: Oleg Baranov
    ........
    
    Merged revisions 381847 from http://svn.asterisk.org/svn/asterisk/branches/1.8
    ........
    
    Merged revisions 381848 from http://svn.asterisk.org/svn/asterisk/branches/11
  ................
........
  r381884 | root | 2013-02-22 12:17:59 -0400 (Fri, 22 Feb 2013) | 20 lines
  
  Merged revisions 381881 via svnmerge from 
  file:///srv/subversion/repos/asterisk/trunk
  
  ................
    r381881 | jrose | 2013-02-22 09:51:20 -0600 (Fri, 22 Feb 2013) | 13 lines
    
    app_dial: Honor the 'c' flag when the calling party hangs up
    
    Apparently this feature became broken in 11, probably as a result
    of the Hangup Cause project.
    
    (closes issue ASTERISK-21113)
    Reprted by: Heiko Wundram
    Patches:
    	app_dial.patch uploaded by Heiko Wundram (license 5822)
    ........
    
    Merged revisions 381880 from http://svn.asterisk.org/svn/asterisk/branches/11
  ................
........
  r381897 | root | 2013-02-22 16:17:57 -0400 (Fri, 22 Feb 2013) | 40 lines
  
  Merged revisions 381894 via svnmerge from 
  file:///srv/subversion/repos/asterisk/trunk
  
  ................
    r381894 | elguero | 2013-02-22 13:40:02 -0600 (Fri, 22 Feb 2013) | 33 lines
    
    Fix FastAGI To Properly Check For A Connection
    
    When IPv6 support was added to FastAGI, the intent was to have the ability to
    check all addresses resolved for a host since we might receive an IPv4 address
    and an IPv6 address.  The problem with the current code, is that, since we are
    doing O_NONBLOCK, we get EINPROGRESS when calling ast_connect() but are ignoring
    this instead of handling it.  We break out of the loop and continue on.  When we
    later call ast_poll(), it succeeds but we never check if we have a connection or
    not on the socket level.  We then attempt to send data to the host address that
    we think is setup and it fails.  We then check the errno and see that we have
    "connection refused" and then return with agi failed.
    
    This patch does the following:
    
    * Handles EINPROGRESS by creating the function handle_connection()
      - ast_poll() was moved into this function
      - This function checks the results of the connection on the socket level after
        calling ast_poll()
    * Continues to the next address if the above fails to create a connection
    * Once all addresses resolved are tried and we still are unable to establish a
      connection, then we return that the FastAGI call failed
    
    (closes issue ASTERISK-21065)
    Reported by: Jeremy Kister
    Tested by: Jeremy Kister, Michael L. Young
    Patches:
      asterisk-21065_poll_correctly_v4.diff Michael L. Young (license 5026)
    
    Review: https://reviewboard.asterisk.org/r/2330/
    ........
    
    Merged revisions 381893 from http://svn.asterisk.org/svn/asterisk/branches/11
  ................
........
  r381920 | root | 2013-02-24 12:18:38 -0400 (Sun, 24 Feb 2013) | 34 lines
  
  Merged revisions 381918 via svnmerge from 
  file:///srv/subversion/repos/asterisk/trunk
  
  ................
    r381918 | mjordan | 2013-02-24 09:45:29 -0600 (Sun, 24 Feb 2013) | 27 lines
    
    Make ParkAndAnnounce return to priority + 1 when return context is not defined
    
    The ParkAndAnnounce application documentation for the optional return_context
    parameter states the following:
    
    return_context
        The goto-style label to jump the call back into after timeout. Default
        'priority+1'.
    
    Unfortunately, the application was sending the channel back into the dialplan
    at 'priority', which is the ParkAndAnnounce application call. This causes an
    infinite loop of the channel constantly being parked, announced, timed out,
    parked, announced, timed out... while fun, especially for those callers you
    wish to drive to the end of madness, this was not the intent of the
    application.
    
    (closes issue ASTERISK-20113)
    Reported by: serginuez
    patches:
      app_parkandannounce.diff uploaded by serginuez (License 6405)
    ........
    
    Merged revisions 381916 from http://svn.asterisk.org/svn/asterisk/branches/1.8
    ........
    
    Merged revisions 381917 from http://svn.asterisk.org/svn/asterisk/branches/11
  ................
........
  r381952 | root | 2013-02-24 13:17:53 -0400 (Sun, 24 Feb 2013) | 35 lines
  
  Merged revisions 381949 via svnmerge from 
  file:///srv/subversion/repos/asterisk/trunk
  
  ................
    r381949 | mjordan | 2013-02-24 10:27:47 -0600 (Sun, 24 Feb 2013) | 28 lines
    
    Don't display the AMI ALL class authorization for users if they don't have it
    
    When converting AMI class authorizations to a string representation, the
    method always appends the ALL class authorization. This is especially
    important for events, as they should always communicate that class
    authorization - even if the event itself does not specify ALL as a class
    authorization for itself. (Events have always assumed that the ALL class
    authorization is implied when they are raised)
    
    Unfortunately, this did mean that specifying a user with restricted class
    authorizations would show up in the 'manager show user' CLI command as
    having the ALL class authorization.
    
    Rather then modifying the existing string manipulation function, this patch
    adds a function that will only return a string if the field being compared
    explicitly matches class authorization field it is being compared against.
    This prevents ALL from being returned unless it is actually specified for
    the user.
    
    (closes issue ASTERISK-20397)
    Reported by: Johan Wilfer
    ........
    
    Merged revisions 381939 from http://svn.asterisk.org/svn/asterisk/branches/1.8
    ........
    
    Merged revisions 381943 from http://svn.asterisk.org/svn/asterisk/branches/11
  ................
........
  r381979 | root | 2013-02-24 19:17:56 -0400 (Sun, 24 Feb 2013) | 29 lines
  
  Merged revisions 381977 via svnmerge from 
  file:///srv/subversion/repos/asterisk/trunk
  
  ................
    r381977 | mjordan | 2013-02-24 17:01:17 -0600 (Sun, 24 Feb 2013) | 22 lines
    
    Set the sin_family on the bind address socket during initialization
    
    Somehow, chan_jingle has managed to operate for years without setting the
    sin_family on its bindaddr socket. This patch properly sets the field during
    initial module load to AF_INET.
    
    Note that the patch on the issue was modified slightly to change the
    initialization of the socket from allocation of a chan_jingle private to the
    module initialization, as the bindaddr object (which is static) only needs to
    have the address set once.
    
    (closes issue ASTERISK-19341)
    Reported by: andre valentin
    patches:
      0105-chan_jingle.patch uploaded by avalentin (License 6064)
    ........
    
    Merged revisions 381975 from http://svn.asterisk.org/svn/asterisk/branches/1.8
    ........
    
    Merged revisions 381976 from http://svn.asterisk.org/svn/asterisk/branches/11
  ................
........
  r382010 | root | 2013-02-25 03:17:53 -0400 (Mon, 25 Feb 2013) | 36 lines
  
  Merged revisions 382007-382008 via svnmerge from 
  file:///srv/subversion/repos/asterisk/trunk
  
  ........
    r382007 | wedhorn | 2013-02-25 00:46:00 -0600 (Mon, 25 Feb 2013) | 13 lines
    
    Add prinotify messages to skinny.
    
    Adds both fixed and variable prinotify messages and clearprinotify messages to skinny.
    Also adds cli function for pushing messages to devices. i
    
    Initial code by snuffy, expanded by myself to include fixed messages.
    
    (closes issue ASTERISK-21091)
    Reported by: snuffy
    Tested by: snuffy, myself
    Patches: 
        skinny-prinotify02.diff uploaded by wedhorn (license 5019)
  ........
    r382008 | wedhorn | 2013-02-25 01:09:37 -0600 (Mon, 25 Feb 2013) | 14 lines
    
    More called details fixup for skinny.
    
    Basically sets the callerid and callername to the first device talked to for the
    purposes of putting the the calls made log on the device. Does not affect the device
    displaying who the device is currently talking to.
    
    Also some minor changes to use sub->exten in lieu of l->lastnumberdialed.
    
    (closes issue ASTERISK-21095)
    Reported by: wedhorn
    Tested by: snuffy, myself
    Patches: 
        skinny-calllogsoutbound03.diff uploaded by wedhorn (license 5019)
  ........
........
  r382025 | root | 2013-02-25 09:18:34 -0400 (Mon, 25 Feb 2013) | 27 lines
  
  Merged revisions 382023 via svnmerge from 
  file:///srv/subversion/repos/asterisk/trunk
  
  ................
    r382023 | mjordan | 2013-02-25 06:51:24 -0600 (Mon, 25 Feb 2013) | 20 lines
    
    Clean up use of va_end/va_args in res_config_mysql
    
    There were several problems using variadic argument macros in res_config_mysql.
     * Improper use of va_end. Multiple calls to va_end were possible resulting in
       an unbalanced matching of va_start/va_end.
     * Calls to va_arg after a possible encounter of a SENTINEL value.
    
    This patch corrects those errors.
    
    (closes issue ASTERISK-19451)
    Reported by: wdoekes
    patches:
      ASTERISK-19451-1.8--2.diff uploaded by wdoekes (License 5674)
    ........
    
    Merged revisions 382021 from http://svn.asterisk.org/svn/asterisk/branches/1.8
    ........
    
    Merged revisions 382022 from http://svn.asterisk.org/svn/asterisk/branches/11
  ................
........
  r382057 | file | 2013-02-25 15:55:35 -0400 (Mon, 25 Feb 2013) | 2 lines
  
  Remove assumption that the INVITE session will exist when the session is ended.
........
  r382072 | root | 2013-02-26 12:18:37 -0400 (Tue, 26 Feb 2013) | 59 lines
  
  Merged revisions 382067,382070 via svnmerge from 
  file:///srv/subversion/repos/asterisk/trunk
  
  ................
    r382067 | mjordan | 2013-02-26 09:26:16 -0600 (Tue, 26 Feb 2013) | 20 lines
    
    Ensure that the default bridge/user profiles are always available
    
    ConfBridge and Page require that there always be a default bridge and user
    profile available. While properties of the default profiles can be overriden
    in the configuration file, removing them can create situations where neither
    application can function properly.
    
    This patch ensures that if an administrator removes the profiles from the
    confbridge.conf configuration file, the profiles are added upon load.
    Documentation clarifying this has been added to the confbridge.conf.sample file.
    
    Review: https://reviewboard.asterisk.org/r/2356/
    
    (closes issue AST-1115)
    Reported by: John Bigelow
    Tested by: John Bigelow
    ........
    
    Merged revisions 382066 from http://svn.asterisk.org/svn/asterisk/branches/11
  ................
    r382070 | mjordan | 2013-02-26 09:52:02 -0600 (Tue, 26 Feb 2013) | 30 lines
    
    Clean up ConfBridge commands to account for wait_marked users
    
    When ConfBridge was refactored to better handle the concept of marked,
    wait_marked, and normal users co-existing in a conference (thereby implementing
    a state machine for the conference), the wait_marked users were put into their
    own list of conference participants, separate from the active users. This list
    is used for wait_marked users when they are waiting in a conference but no
    marked user has joined; normal users may have joined at this point however.
    There are several AMI/CLI commands that affect conference users that were not
    checking the wait_marked users list:
    * CLI/AMI commands that mute/unmute a participant. In this case, wait_marked
      users have to remain in their particular state and should not be affected -
      however, the commands would return "Channel not found" as opposed to the
      appropriate error condition.
    * CLI/AMI commands that kick a participant. An admin should always be able to
      kick a participant out of the conference.
    
    This patch fixes both sets of commands, and cleans up the CLI commands slightly
    by allowing them to complete a participant name (this was supposed to have been
    added, but the function call was commented out and wasn't implemented).
    
    Review: https://reviewboard.asterisk.org/r/2346/
    
    (closes issue AST-1114)
    Reported by: John Bigelow
    Tested by: John Bigelow
    ........
    
    Merged revisions 382068 from http://svn.asterisk.org/svn/asterisk/branches/11
  ................
........
  r382112 | mmichelson | 2013-02-26 15:55:31 -0400 (Tue, 26 Feb 2013) | 60 lines
  
  Merge pool_shark2 branch.
  
  Copied from the reviewboard description:
  
  * The ast_sip_work structure and some of its methods have been removed in
  favor of the generic task serializer.
  
  * A PJSIP module, the message distributor, has been added. This module has a
  high priority and gets called into after the PJSIP transport layer but before
  the PJSIP transaction layer. The distributor is used as a means of moving an
  incoming message from a PJSIP thread into a SIP servant thread. Then from the
  SIP servant thread, the message bubbles up through the PJSIP transaction layer,
  PJSIP dialog layer, and any relevant PJSIP modules that Asterisk has registered.
  This means that any PJSIP module that registers itself at the transaction layer
  or higher will have all of its incoming SIP messages already in a SIP servant
  thread when called back. Unless they need to serialize operations, they do not
  need to do any special processing to ensure the incoming message is handled in a
  specific thread. A good example of this is what the SIP OPTIONS handler does in
  this set of changes.
  
  * Two new PJSIP modules have been added above the dialog layer. The endpoint
  module and the authenticator module are responsible for doing endpoint lookups
  and authentication for incoming requests. The placement of these modules means
  that they are only ever called into for out-of-dialog requests. This means that
  on an initial INVITE, or on a REGISTER, or on an OPTIONS request, or any other
  out-of-dialog request, the application-layer modules do not need to worry about
  endpoint lookup or authentication since that is done already for them. If they
  need the endpoint, they can call ast_pjsip_rdata_get_endpoint(). For dialog-
  forming application modules, they will want to save off the endpoint that the
  endpoint module finds since the endpoint will not be looked up again on in-
  dialog requests, meaning they will not be able to call
  ast_pjsip_rdata_get_endpoint().
  
  * Modules that were passing incoming messages off to servants no longer need to
  do this, so they have been changed not to. So the session module and options
  module now handle incoming requests in-line rather than pushing them to a
  servant thread.
  
  * Since it no longer makes sense to pre-allocate a serializer before an
  ast_sip_session, the functions for allocating SIP sessions has been changed not
  to take a serializer any more. Instead, the allocation routine creates its own.
  In addition, the behavior of endpoint references has changed from how it
  previously was. Now allocating a session results in the endpoint reference count
  increasing by one rather than having the session inherit the reference passed
  into it. This makes endpoint reference handling much cleaner, especially in the
  session module.
  
  * To assist programmers who want to write PJSIP modules in Asterisk, there is a
  helper method called ast_sip_thread_is_servant() that has been added. It can be
  used to discern if the thread you currently are in is a SIP servant thread. This
  means it is not as necessary to dig into the PJSIP internals to know what type
  of thread you are in when called back. Instead, you can be safe and use this
  function. This function is currently unused though, since there hasn't been a
  need for it yet. This is because all uses of SIP servants where it may be
  questionable what type of thread we are in need to serialize the task anyway.
  
  * Documentation of the SIP threadpool has been updated.
  
  Review: https://reviewboard.asterisk.org/r/2355
........
  r382114 | mmichelson | 2013-02-26 16:09:59 -0400 (Tue, 26 Feb 2013) | 3 lines
  
  Invert logic so that things actually start up properly.
........

Merged revisions 381751,381795,381871,381884,381897,381920,381952,381979,382010,382025,382057,382072,382112,382114 from http://svn.asterisk.org/svn/asterisk/team/group/pimp_my_sip

Added:
    team/file/pimp_sip_nat/res/res_sip/sip_distributor.c
      - copied unchanged from r382114, team/group/pimp_my_sip/res/res_sip/sip_distributor.c
Modified:
    team/file/pimp_sip_nat/   (props changed)
    team/file/pimp_sip_nat/addons/res_config_mysql.c
    team/file/pimp_sip_nat/apps/app_confbridge.c
    team/file/pimp_sip_nat/apps/app_dial.c
    team/file/pimp_sip_nat/apps/app_parkandannounce.c
    team/file/pimp_sip_nat/apps/confbridge/conf_config_parser.c
    team/file/pimp_sip_nat/channels/chan_gulp.c
    team/file/pimp_sip_nat/channels/chan_jingle.c
    team/file/pimp_sip_nat/channels/chan_motif.c
    team/file/pimp_sip_nat/channels/chan_skinny.c
    team/file/pimp_sip_nat/configs/confbridge.conf.sample
    team/file/pimp_sip_nat/configure
    team/file/pimp_sip_nat/configure.ac
    team/file/pimp_sip_nat/include/asterisk/module.h
    team/file/pimp_sip_nat/include/asterisk/res_sip.h
    team/file/pimp_sip_nat/include/asterisk/res_sip_session.h
    team/file/pimp_sip_nat/main/cli.c
    team/file/pimp_sip_nat/main/features.c
    team/file/pimp_sip_nat/main/loader.c
    team/file/pimp_sip_nat/main/manager.c
    team/file/pimp_sip_nat/res/pjproject/pjsip/include/pjsip/sip_endpoint.h
    team/file/pimp_sip_nat/res/pjproject/pjsip/src/pjsip/sip_endpoint.c
    team/file/pimp_sip_nat/res/res_agi.c
    team/file/pimp_sip_nat/res/res_sip.c
    team/file/pimp_sip_nat/res/res_sip.exports.in
    team/file/pimp_sip_nat/res/res_sip/config_transport.c
    team/file/pimp_sip_nat/res/res_sip/sip_options.c
    team/file/pimp_sip_nat/res/res_sip_endpoint_identifier_ip.c
    team/file/pimp_sip_nat/res/res_sip_session.c
    team/file/pimp_sip_nat/res/snmp/agent.c

Propchange: team/file/pimp_sip_nat/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Propchange: team/file/pimp_sip_nat/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Feb 26 14:15:55 2013
@@ -1,1 +1,1 @@
-/team/group/pimp_my_sip:1-381746
+/team/group/pimp_my_sip:1-382114

Modified: team/file/pimp_sip_nat/addons/res_config_mysql.c
URL: http://svnview.digium.com/svn/asterisk/team/file/pimp_sip_nat/addons/res_config_mysql.c?view=diff&rev=382115&r1=382114&r2=382115
==============================================================================
--- team/file/pimp_sip_nat/addons/res_config_mysql.c (original)
+++ team/file/pimp_sip_nat/addons/res_config_mysql.c Tue Feb 26 14:15:55 2013
@@ -343,9 +343,7 @@
 	}
 
 	/* Get the first parameter and first value in our list of passed paramater/value pairs */
-	newparam = va_arg(ap, const char *);
-	newval = va_arg(ap, const char *);
-	if (!newparam || !newval)  {
+	if (!(newparam = va_arg(ap, const char *)) || !(newval = va_arg(ap, const char *)))  {
 		ast_log(LOG_WARNING, "MySQL RealTime: Realtime retrieval requires at least 1 parameter and 1 value to search on.\n");
 		release_database(dbh);
 		return NULL;
@@ -376,7 +374,6 @@
 		ESCAPE_STRING(buf, newval);
 		ast_str_append(&sql, 0, " AND %s%s '%s'", newparam, op, ast_str_buffer(buf));
 	}
-	va_end(ap);
 
 	ast_debug(1, "MySQL RealTime: Retrieve SQL: %s\n", ast_str_buffer(sql));
 
@@ -457,9 +454,7 @@
 	}
 
 	/* Get the first parameter and first value in our list of passed paramater/value pairs */
-	newparam = va_arg(ap, const char *);
-	newval = va_arg(ap, const char *);
-	if (!newparam || !newval)  {
+	if (!(newparam = va_arg(ap, const char *)) || !(newval = va_arg(ap, const char *)))  {
 		ast_log(LOG_WARNING, "MySQL RealTime: Realtime retrieval requires at least 1 parameter and 1 value to search on.\n");
 		ast_config_destroy(cfg);
 		release_database(dbh);
@@ -498,8 +493,6 @@
 	if (initfield) {
 		ast_str_append(&sql, 0, " ORDER BY %s", initfield);
 	}
-
-	va_end(ap);
 
 	ast_debug(1, "MySQL RealTime: Retrieve SQL: %s\n", ast_str_buffer(sql));
 
@@ -581,9 +574,7 @@
 	}
 
 	/* Get the first parameter and first value in our list of passed paramater/value pairs */
-	newparam = va_arg(ap, const char *);
-	newval = va_arg(ap, const char *);
-	if (!newparam || !newval)  {
+	if (!(newparam = va_arg(ap, const char *)) || !(newval = va_arg(ap, const char *)))  {
 		ast_log(LOG_WARNING, "MySQL RealTime: Realtime update requires at least 1 parameter and 1 value to update.\n");
 		release_table(table);
 		release_database(dbh);
@@ -633,7 +624,6 @@
 			internal_require(database, tablename, newparam, RQ_CHAR, ast_str_strlen(buf), SENTINEL);
 		}
 	}
-	va_end(ap);
 
 	ESCAPE_STRING(buf, lookup);
 	ast_str_append(&sql, 0, " WHERE `%s` = '%s'", keyfield, ast_str_buffer(buf));
@@ -667,7 +657,7 @@
 {
 	struct mysql_conn *dbh;
 	my_ulonglong numrows;
-	int first = 1;
+	int first;
 	const char *newparam, *newval;
 	struct ast_str *sql = ast_str_thread_get(&sql_buf, 100), *buf = ast_str_thread_get(&scratch_buf, 100);
 	struct ast_str *where = ast_str_thread_get(&sql2_buf, 100);
@@ -706,6 +696,7 @@
 		return -1;
 	}
 
+	first = 1;
 	while ((newparam = va_arg(ap, const char *))) {
 		if (!(column = find_column(table, newparam))) {
 			ast_log(LOG_ERROR, "Updating on column '%s', but that column does not exist within the table '%s'!\n", newparam, tablename);
@@ -753,7 +744,7 @@
 			internal_require(database, tablename, newparam, RQ_CHAR, ast_str_strlen(buf), SENTINEL);
 		}
 	}
-	va_end(ap);
+
 	release_table(table);
 
 	ast_str_append(&sql, 0, " %s", ast_str_buffer(where));
@@ -802,9 +793,7 @@
 		return -1;
 	}
 	/* Get the first parameter and first value in our list of passed paramater/value pairs */
-	newparam = va_arg(ap, const char *);
-	newval = va_arg(ap, const char *);
-	if (!newparam || !newval)  {
+	if (!(newparam = va_arg(ap, const char *)) || !(newval = va_arg(ap, const char *))) {
 		ast_log(LOG_WARNING, "MySQL RealTime: Realtime storage requires at least 1 parameter and 1 value to search on.\n");
 		release_database(dbh);
 		return -1;
@@ -833,7 +822,6 @@
 			ast_str_append(&sql2, 0, ", '%s'", ast_str_buffer(buf));
 		}
 	}
-	va_end(ap);
 	ast_str_append(&sql, 0, "%s)", ast_str_buffer(sql2));
 	ast_debug(1,"MySQL RealTime: Insert SQL: %s\n", ast_str_buffer(sql));
 
@@ -901,7 +889,6 @@
 		ESCAPE_STRING(buf, newval);
 		ast_str_append(&sql, 0, " AND `%s` = '%s'", newparam, ast_str_buffer(buf));
 	}
-	va_end(ap);
 
 	ast_debug(1, "MySQL RealTime: Delete SQL: %s\n", ast_str_buffer(sql));
 

Modified: team/file/pimp_sip_nat/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/team/file/pimp_sip_nat/apps/app_confbridge.c?view=diff&rev=382115&r1=382114&r2=382115
==============================================================================
--- team/file/pimp_sip_nat/apps/app_confbridge.c (original)
+++ team/file/pimp_sip_nat/apps/app_confbridge.c Tue Feb 26 14:15:55 2013
@@ -775,8 +775,6 @@
  */
 static int start_conf_record_thread(struct conference_bridge *conference_bridge)
 {
-	ao2_ref(conference_bridge, +1); /* give the record thread a ref */
-
 	conf_start_record(conference_bridge);
 
 	/*
@@ -785,6 +783,8 @@
 	if (conference_bridge->record_thread != AST_PTHREADT_NULL) {
 		return 0;
 	}
+
+	ao2_ref(conference_bridge, +1); /* give the record thread a ref */
 
 	if (ast_pthread_create_background(&conference_bridge->record_thread, NULL, record_thread, conference_bridge)) {
 		ast_log(LOG_WARNING, "Failed to create recording channel for conference %s\n", conference_bridge->name);
@@ -2180,6 +2180,29 @@
 	return 0;
 }
 
+static int kick_conference_participant(struct conference_bridge *bridge, const char *channel)
+{
+	struct conference_bridge_user *participant = NULL;
+
+	SCOPED_AO2LOCK(bridge_lock, bridge);
+	AST_LIST_TRAVERSE(&bridge->active_list, participant, list) {
+		if (!strcasecmp(ast_channel_name(participant->chan), channel)) {
+			participant->kicked = 1;
+			ast_bridge_remove(bridge->bridge, participant->chan);
+			return 0;
+		}
+	}
+	AST_LIST_TRAVERSE(&bridge->waiting_list, participant, list) {
+		if (!strcasecmp(ast_channel_name(participant->chan), channel)) {
+			participant->kicked = 1;
+			ast_bridge_remove(bridge->bridge, participant->chan);
+			return 0;
+		}
+	}
+
+	return -1;
+}
+
 static char *complete_confbridge_name(const char *line, const char *word, int pos, int state)
 {
 	int which = 0;
@@ -2202,11 +2225,44 @@
 	return res;
 }
 
+static char *complete_confbridge_participant(const char *bridge_name, const char *line, const char *word, int pos, int state)
+{
+	int which = 0;
+	RAII_VAR(struct conference_bridge *, bridge, NULL, ao2_cleanup);
+	struct conference_bridge tmp;
+	struct conference_bridge_user *participant;
+	char *res = NULL;
+	int wordlen = strlen(word);
+
+	ast_copy_string(tmp.name, bridge_name, sizeof(tmp.name));
+	bridge = ao2_find(conference_bridges, &tmp, OBJ_POINTER);
+	if (!bridge) {
+		return NULL;
+	}
+
+	{
+		SCOPED_AO2LOCK(bridge_lock, bridge);
+		AST_LIST_TRAVERSE(&bridge->active_list, participant, list) {
+			if (!strncasecmp(ast_channel_name(participant->chan), word, wordlen) && ++which > state) {
+				res = ast_strdup(ast_channel_name(participant->chan));
+				return res;
+			}
+		}
+		AST_LIST_TRAVERSE(&bridge->waiting_list, participant, list) {
+			if (!strncasecmp(ast_channel_name(participant->chan), word, wordlen) && ++which > state) {
+				res = ast_strdup(ast_channel_name(participant->chan));
+				return res;
+			}
+		}
+	}
+
+	return NULL;
+}
+
 static char *handle_cli_confbridge_kick(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	struct conference_bridge *bridge = NULL;
 	struct conference_bridge tmp;
-	struct conference_bridge_user *participant = NULL;
 
 	switch (cmd) {
 	case CLI_INIT:
@@ -2219,11 +2275,9 @@
 		if (a->pos == 2) {
 			return complete_confbridge_name(a->line, a->word, a->pos, a->n);
 		}
-		/*
 		if (a->pos == 3) {
-			return complete_confbridge_channel(a->line, a->word, a->pos, a->n);
-		}
-		*/
+			return complete_confbridge_participant(a->argv[2], a->line, a->word, a->pos, a->n);
+		}
 		return NULL;
 	}
 
@@ -2237,19 +2291,12 @@
 		ast_cli(a->fd, "No conference bridge named '%s' found!\n", a->argv[2]);
 		return CLI_SUCCESS;
 	}
-	ao2_lock(bridge);
-	AST_LIST_TRAVERSE(&bridge->active_list, participant, list) {
-		if (!strncmp(a->argv[3], ast_channel_name(participant->chan), strlen(ast_channel_name(participant->chan)))) {
-			break;
-		}
-	}
-	if (participant) {
-		ast_cli(a->fd, "Kicking %s from confbridge %s\n", ast_channel_name(participant->chan), bridge->name);
-		participant->kicked = 1;
-		ast_bridge_remove(bridge->bridge, participant->chan);
-	}
-	ao2_unlock(bridge);
+	if (kick_conference_participant(bridge, a->argv[3])) {
+		ast_cli(a->fd, "No participant named '%s' found!\n", a->argv[3]);
+		return CLI_SUCCESS;
+	}
 	ao2_ref(bridge, -1);
+	ast_cli(a->fd, "Participant '%s' kicked out of conference '%s'\n", a->argv[3], a->argv[2]);
 	return CLI_SUCCESS;
 }
 
@@ -2437,12 +2484,16 @@
 	case CLI_INIT:
 		e->command = "confbridge mute";
 		e->usage =
-			"Usage: confbridge mute <conference> <channel>\n";
+			"Usage: confbridge mute <conference> <channel>\n"
+			"       Mute a channel in a conference.\n";
 		return NULL;
 	case CLI_GENERATE:
 		if (a->pos == 2) {
 			return complete_confbridge_name(a->line, a->word, a->pos, a->n);
 		}
+		if (a->pos == 3) {
+			return complete_confbridge_participant(a->argv[2], a->line, a->word, a->pos, a->n);
+		}
 		return NULL;
 	}
 	if (a->argc != 4) {
@@ -2460,12 +2511,16 @@
 	case CLI_INIT:
 		e->command = "confbridge unmute";
 		e->usage =
-			"Usage: confbridge unmute <conference> <channel>\n";
+			"Usage: confbridge unmute <conference> <channel>\n"
+			"       Unmute a channel in a conference.\n";
 		return NULL;
 	case CLI_GENERATE:
 		if (a->pos == 2) {
 			return complete_confbridge_name(a->line, a->word, a->pos, a->n);
 		}
+		if (a->pos == 3) {
+			return complete_confbridge_participant(a->argv[2], a->line, a->word, a->pos, a->n);
+		}
 		return NULL;
 	}
 	if (a->argc != 4) {
@@ -2483,7 +2538,9 @@
 	case CLI_INIT:
 		e->command = "confbridge lock";
 		e->usage =
-			"Usage: confbridge lock <conference>\n";
+			"Usage: confbridge lock <conference>\n"
+			"       Lock a conference. While locked, no new non-admins\n"
+			"       may join the conference.\n";
 		return NULL;
 	case CLI_GENERATE:
 		if (a->pos == 2) {
@@ -2508,7 +2565,8 @@
 	case CLI_INIT:
 		e->command = "confbridge unlock";
 		e->usage =
-			"Usage: confbridge unlock <conference>\n";
+			"Usage: confbridge unlock <conference>\n"
+			"       Unlock a previously locked conference.\n";
 		return NULL;
 	case CLI_GENERATE:
 		if (a->pos == 2) {
@@ -2596,7 +2654,8 @@
 	case CLI_INIT:
 		e->command = "confbridge record stop";
 		e->usage =
-			"Usage: confbridge record stop <conference>\n";
+			"Usage: confbridge record stop <conference>\n"
+			"       Stop a previously started recording.\n";
 		return NULL;
 	case CLI_GENERATE:
 		if (a->pos == 3) {
@@ -2852,7 +2911,6 @@
 {
 	const char *conference = astman_get_header(m, "Conference");
 	const char *channel = astman_get_header(m, "Channel");
-	struct conference_bridge_user *participant = NULL;
 	struct conference_bridge *bridge = NULL;
 	struct conference_bridge tmp;
 	int found = 0;
@@ -2865,6 +2923,7 @@
 		astman_send_error(s, m, "No active conferences.");
 		return 0;
 	}
+
 	ast_copy_string(tmp.name, conference, sizeof(tmp.name));
 	bridge = ao2_find(conference_bridges, &tmp, OBJ_POINTER);
 	if (!bridge) {
@@ -2872,16 +2931,7 @@
 		return 0;
 	}
 
-	ao2_lock(bridge);
-	AST_LIST_TRAVERSE(&bridge->active_list, participant, list) {
-		if (!strcasecmp(ast_channel_name(participant->chan), channel)) {
-			participant->kicked = 1;
-			ast_bridge_remove(bridge->bridge, participant->chan);
-			found = 1;
-			break;
-		}
-	}
-	ao2_unlock(bridge);
+	found = !kick_conference_participant(bridge, channel);
 	ao2_ref(bridge, -1);
 
 	if (found) {
@@ -3060,6 +3110,9 @@
 	ao2_lock(bridge);
 	if (!strncasecmp(args.type, "parties", 7)) {
 		AST_LIST_TRAVERSE(&bridge->active_list, participant, list) {
+			count++;
+		}
+		AST_LIST_TRAVERSE(&bridge->waiting_list, participant, list) {
 			count++;
 		}
 	} else if (!strncasecmp(args.type, "admins", 6)) {

Modified: team/file/pimp_sip_nat/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/file/pimp_sip_nat/apps/app_dial.c?view=diff&rev=382115&r1=382114&r2=382115
==============================================================================
--- team/file/pimp_sip_nat/apps/app_dial.c (original)
+++ team/file/pimp_sip_nat/apps/app_dial.c Tue Feb 26 14:15:55 2013
@@ -3096,7 +3096,7 @@
 	}
 
 	ast_channel_early_bridge(chan, NULL);
-	hanguptree(&out_chans, NULL, ast_channel_hangupcause(chan)==AST_CAUSE_ANSWERED_ELSEWHERE ? 1 : 0 ); /* forward 'answered elsewhere' if we received it */
+	hanguptree(&out_chans, NULL, ast_channel_hangupcause(chan)==AST_CAUSE_ANSWERED_ELSEWHERE || ast_test_flag64(&opts, OPT_CANCEL_ELSEWHERE) ? 1 : 0 ); /* forward 'answered elsewhere' if we received it */
 	pbx_builtin_setvar_helper(chan, "DIALSTATUS", pa.status);
 	senddialendevent(chan, pa.status);
 	ast_debug(1, "Exiting with DIALSTATUS=%s.\n", pa.status);

Modified: team/file/pimp_sip_nat/apps/app_parkandannounce.c
URL: http://svnview.digium.com/svn/asterisk/team/file/pimp_sip_nat/apps/app_parkandannounce.c?view=diff&rev=382115&r1=382114&r2=382115
==============================================================================
--- team/file/pimp_sip_nat/apps/app_parkandannounce.c (original)
+++ team/file/pimp_sip_nat/apps/app_parkandannounce.c Tue Feb 26 14:15:55 2013
@@ -139,6 +139,8 @@
 	if (!ast_strlen_zero(args.return_context)) {
 		ast_clear_flag(ast_channel_flags(chan), AST_FLAG_IN_AUTOLOOP);
 		ast_parseable_goto(chan, args.return_context);
+	} else {
+		ast_channel_priority_set(chan, ast_channel_priority(chan) + 1);
 	}
 
 	ast_verb(3, "Return Context: (%s,%s,%d) ID: %s\n", ast_channel_context(chan), ast_channel_exten(chan),

Modified: team/file/pimp_sip_nat/apps/confbridge/conf_config_parser.c
URL: http://svnview.digium.com/svn/asterisk/team/file/pimp_sip_nat/apps/confbridge/conf_config_parser.c?view=diff&rev=382115&r1=382114&r2=382115
==============================================================================
--- team/file/pimp_sip_nat/apps/confbridge/conf_config_parser.c (original)
+++ team/file/pimp_sip_nat/apps/confbridge/conf_config_parser.c Tue Feb 26 14:15:55 2013
@@ -504,6 +504,7 @@
 	struct ao2_container *menus;
 };
 
+static int verify_default_profiles(void);
 static void *bridge_profile_alloc(const char *category);
 static void *bridge_profile_find(struct ao2_container *container, const char *category);
 static struct bridge_profile_sounds *bridge_profile_sounds_alloc(void);
@@ -641,6 +642,7 @@
 
 CONFIG_INFO_STANDARD(cfg_info, cfg_handle, confbridge_cfg_alloc,
 	.files = ACO_FILES(&confbridge_conf),
+	.pre_apply_config = verify_default_profiles,
 );
 
 /*! bridge profile container functions */
@@ -1749,6 +1751,41 @@
 	return 0;
 }
 
+static int verify_default_profiles(void)
+{
+	RAII_VAR(struct user_profile *, user_profile, NULL, ao2_cleanup);
+	RAII_VAR(struct bridge_profile *, bridge_profile, NULL, ao2_cleanup);
+	struct confbridge_cfg *cfg = aco_pending_config(&cfg_info);
+
+	if (!cfg) {
+		return 0;
+	}
+
+	bridge_profile = ao2_find(cfg->bridge_profiles, DEFAULT_BRIDGE_PROFILE, OBJ_KEY);
+	if (!bridge_profile) {
+		bridge_profile = bridge_profile_alloc(DEFAULT_BRIDGE_PROFILE);
+		if (!bridge_profile) {
+			return -1;
+		}
+		ast_log(AST_LOG_NOTICE, "Adding %s profile to app_confbridge\n", DEFAULT_BRIDGE_PROFILE);
+		aco_set_defaults(&bridge_type, DEFAULT_BRIDGE_PROFILE, bridge_profile);
+		ao2_link(cfg->bridge_profiles, bridge_profile);
+	}
+
+	user_profile = ao2_find(cfg->bridge_profiles, DEFAULT_USER_PROFILE, OBJ_KEY);
+	if (!user_profile) {
+		user_profile = user_profile_alloc(DEFAULT_USER_PROFILE);
+		if (!user_profile) {
+			return -1;
+		}
+		ast_log(AST_LOG_NOTICE, "Adding %s profile to app_confbridge\n", DEFAULT_USER_PROFILE);
+		aco_set_defaults(&user_type, DEFAULT_USER_PROFILE, user_profile);
+		ao2_link(cfg->user_profiles, user_profile);
+	}
+
+	return 0;
+}
+
 int conf_load_config(int reload)
 {
 	if (!reload) {

Modified: team/file/pimp_sip_nat/channels/chan_gulp.c
URL: http://svnview.digium.com/svn/asterisk/team/file/pimp_sip_nat/channels/chan_gulp.c?view=diff&rev=382115&r1=382114&r2=382115
==============================================================================
--- team/file/pimp_sip_nat/channels/chan_gulp.c (original)
+++ team/file/pimp_sip_nat/channels/chan_gulp.c Tue Feb 26 14:15:55 2013
@@ -53,6 +53,7 @@
 #include "asterisk/app.h"
 #include "asterisk/musiconhold.h"
 #include "asterisk/causes.h"
+#include "asterisk/taskprocessor.h"
 
 #include "asterisk/res_sip.h"
 #include "asterisk/res_sip_session.h"
@@ -204,7 +205,7 @@
 	ast_setstate(ast, AST_STATE_UP);
 
 	ao2_ref(session, +1);
-	if (ast_sip_push_task(session->work, answer, session)) {
+	if (ast_sip_push_task(session->serializer, answer, session)) {
 		ast_log(LOG_WARNING, "Unable to push answer task to the threadpool. Cannot answer call\n");
 		ao2_cleanup(session);
 		return -1;
@@ -296,7 +297,7 @@
 		return -1;
 	}
 
-	if (ast_sip_push_task_synchronous(session->work, fixup, &fix_data)) {
+	if (ast_sip_push_task_synchronous(session->serializer, fixup, &fix_data)) {
 		ast_log(LOG_WARNING, "Unable to perform channel fixup\n");
 		return -1;
 	}
@@ -431,7 +432,7 @@
 	if (!res && response_code) {

[... 2105 lines stripped ...]



More information about the asterisk-commits mailing list