summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES5
-rw-r--r--apps/app_queue.c103
-rw-r--r--configs/samples/ast_debug_tools.conf.sample17
-rw-r--r--contrib/Makefile10
-rwxr-xr-xcontrib/scripts/ast_coredumper39
-rwxr-xr-xcontrib/scripts/ast_loggrabber255
-rw-r--r--res/res_calendar.c9
-rw-r--r--res/res_pjsip_outbound_authenticator_digest.c12
8 files changed, 425 insertions, 25 deletions
diff --git a/CHANGES b/CHANGES
index d843848cf..5921e9b32 100644
--- a/CHANGES
+++ b/CHANGES
@@ -74,6 +74,11 @@ CLI Commands
[registrar] when that information is available. Currently only extensions
registered by pbx_config when loading/reloading will use this format.
+app_queue
+------------------
+ * Add 'QueueUpdate' application which can be used to track outbound calls
+ using app_queue.
+
------------------------------------------------------------------------------
--- Functionality changes from Asterisk 14.2.0 to Asterisk 14.3.0 ------------
------------------------------------------------------------------------------
diff --git a/apps/app_queue.c b/apps/app_queue.c
index f33d22903..68ee6165f 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -490,6 +490,24 @@
<ref type="function">QUEUE_MEMBER_PENALTY</ref>
</see-also>
</application>
+ <application name="QueueUpdate" language="en_US">
+ <synopsis>
+ Writes to the queue_log file for OutBound calls and updates Realtime Data.
+ Is used at h extension to be able to have all the parameters.
+ </synopsis>
+ <syntax>
+ <parameter name="queuename" required="true" />
+ <parameter name="uniqueid" required="true" />
+ <parameter name="agent" required="true" />
+ <parameter name="status" required="true" />
+ <parameter name="talktime" required="true" />
+ <parameter name="params" required="false" />
+ </syntax>
+ <description>
+ <para>Allows you to write Outbound events into the queue log.</para>
+ <para>Example: exten => h,1,QueueUpdate(${QUEUE}, ${UNIQUEID}, ${AGENT}, ${DIALSTATUS}, ${ANSWEREDTIME}, ${DIALEDTIME} | ${DIALEDNUMBER})</para>
+ </description>
+ </application>
<function name="QUEUE_VARIABLES" language="en_US">
<synopsis>
Return Queue information in variables.
@@ -1403,6 +1421,8 @@ static char *app_upqm = "UnpauseQueueMember" ;
static char *app_ql = "QueueLog" ;
+static char *app_qupd = "QueueUpdate";
+
/*! \brief Persistent Members astdb family */
static const char * const pm_family = "Queue/PersistentMembers";
@@ -10724,6 +10744,86 @@ static char *handle_queue_reload(struct ast_cli_entry *e, int cmd, struct ast_cl
return CLI_SUCCESS;
}
+/*!
+ * \brief Update Queue with data of an outgoing call
+*/
+static int qupd_exec(struct ast_channel *chan, const char *data)
+{
+ int oldtalktime;
+ char *parse;
+ struct call_queue *q;
+ struct member *mem;
+ int newtalktime = 0;
+
+ AST_DECLARE_APP_ARGS(args,
+ AST_APP_ARG(queuename);
+ AST_APP_ARG(uniqueid);
+ AST_APP_ARG(agent);
+ AST_APP_ARG(status);
+ AST_APP_ARG(talktime);
+ AST_APP_ARG(params););
+
+ if (ast_strlen_zero(data)) {
+ ast_log(LOG_WARNING, "QueueUpdate requires arguments (queuename,uniqueid,agent,status,talktime,params[totaltime,callednumber])\n");
+ return -1;
+ }
+
+ parse = ast_strdupa(data);
+
+ AST_STANDARD_APP_ARGS(args, parse);
+
+ if (ast_strlen_zero(args.queuename) || ast_strlen_zero(args.uniqueid) || ast_strlen_zero(args.agent) || ast_strlen_zero(args.status)) {
+ ast_log(LOG_WARNING, "Missing argument to QueueUpdate (queuename,uniqueid,agent,status,talktime,params[totaltime|callednumber])\n");
+ return -1;
+ }
+
+ if (!ast_strlen_zero(args.talktime)) {
+ newtalktime = atoi(args.talktime);
+ }
+
+ q = find_load_queue_rt_friendly(args.queuename);
+ if (!q) {
+ ast_log(LOG_WARNING, "QueueUpdate could not find requested queue '%s'\n", args.queuename);
+ return 0;
+ }
+
+ ao2_lock(q);
+ if (q->members) {
+ struct ao2_iterator mem_iter = ao2_iterator_init(q->members, 0);
+ while ((mem = ao2_iterator_next(&mem_iter))) {
+ if (!strcasecmp(mem->membername, args.agent)) {
+ if (!strcasecmp(args.status, "ANSWER")) {
+ oldtalktime = q->talktime;
+ q->talktime = (((oldtalktime << 2) - oldtalktime) + newtalktime) >> 2;
+ time(&mem->lastcall);
+ mem->calls++;
+ mem->lastqueue = q;
+ q->callscompleted++;
+
+ if (newtalktime <= q->servicelevel) {
+ q->callscompletedinsl++;
+ }
+ } else {
+
+ time(&mem->lastcall);
+ q->callsabandoned++;
+ }
+
+ ast_queue_log(args.queuename, args.uniqueid, args.agent, "OUTCALL", "%s|%s|%s", args.status, args.talktime, args.params);
+ }
+
+ ao2_ref(mem, -1);
+ }
+
+ ao2_iterator_destroy(&mem_iter);
+ }
+
+ ao2_unlock(q);
+ queue_t_unref(q, "Done with temporary pointer");
+
+ return 0;
+}
+
static struct ast_cli_entry cli_queue[] = {
AST_CLI_DEFINE(queue_show, "Show status of a specified queue"),
AST_CLI_DEFINE(handle_queue_rule_show, "Show the rules defined in queuerules.conf"),
@@ -11041,6 +11141,7 @@ static int unload_module(void)
ast_manager_unregister("QueueRemove");
ast_manager_unregister("QueuePause");
ast_manager_unregister("QueueLog");
+ ast_manager_unregister("QueueUpdate");
ast_manager_unregister("QueuePenalty");
ast_manager_unregister("QueueReload");
ast_manager_unregister("QueueReset");
@@ -11050,6 +11151,7 @@ static int unload_module(void)
ast_unregister_application(app_pqm);
ast_unregister_application(app_upqm);
ast_unregister_application(app_ql);
+ ast_unregister_application(app_qupd);
ast_unregister_application(app);
ast_custom_function_unregister(&queueexists_function);
ast_custom_function_unregister(&queuevar_function);
@@ -11149,6 +11251,7 @@ static int load_module(void)
err |= ast_register_application_xml(app_pqm, pqm_exec);
err |= ast_register_application_xml(app_upqm, upqm_exec);
err |= ast_register_application_xml(app_ql, ql_exec);
+ err |= ast_register_application_xml(app_qupd, qupd_exec);
err |= ast_manager_register_xml("Queues", 0, manager_queues_show);
err |= ast_manager_register_xml("QueueStatus", 0, manager_queues_status);
err |= ast_manager_register_xml("QueueSummary", 0, manager_queues_summary);
diff --git a/configs/samples/ast_debug_tools.conf.sample b/configs/samples/ast_debug_tools.conf.sample
index 90e976f1b..f26626b20 100644
--- a/configs/samples/ast_debug_tools.conf.sample
+++ b/configs/samples/ast_debug_tools.conf.sample
@@ -38,3 +38,20 @@ COREDUMPS=(/tmp/core[-._]asterisk!(*.txt) /tmp/core[-._]$(hostname)!(*.txt))
#
# Readable Local time
DATEFORMAT='date +%FT%H-%M-%S%z'
+
+# A list of log files and/or log file search patterns using the
+# same syntax as COREDUMPS.
+#
+LOGFILES=(/var/log/asterisk/messages* /var/log/asterisk/queue* \
+ /var/log/asterisk/debug* /var/log/asterisk/security*)
+
+# ast_loggrabber converts POSIX timestamps to readable format
+# using this Python strftime format string. If not specified
+# or an empty string, no format covnersion is done.
+LOG_DATEFORMAT="%m/%d-%H:%M:%S.%f"
+
+# The timezone to use when converting POSIX timestamps to
+# readable format. It can be specified in "<continent>/<city>"
+# format or in abbreviation format such as "CST6CDT". If not
+# specified, the "local" timezone is used.
+# LOG_TIMEZONE=
diff --git a/contrib/Makefile b/contrib/Makefile
index a5775cb82..a66724311 100644
--- a/contrib/Makefile
+++ b/contrib/Makefile
@@ -20,10 +20,12 @@ clean:
include $(ASTTOPDIR)/Makefile.rules
install:
- $(INSTALL) -d "$(DESTDIR)$(ASTDATADIR)/scripts"; \
- $(INSTALL) -m 755 scripts/refcounter.py "$(DESTDIR)$(ASTDATADIR)/scripts/refcounter.py"; \
+ $(INSTALL) -d "$(DESTDIR)$(ASTDATADIR)/scripts"
+ $(INSTALL) -m 755 scripts/ast_loggrabber "$(DESTDIR)$(ASTDATADIR)/scripts/ast_loggrabber"
$(INSTALL) -m 755 scripts/ast_coredumper "$(DESTDIR)$(ASTDATADIR)/scripts/ast_coredumper"
+ $(INSTALL) -m 755 scripts/refcounter.py "$(DESTDIR)$(ASTDATADIR)/scripts/refcounter.py"
uninstall:
- rm -f "$(DESTDIR)$(ASTDATADIR)/scripts/refcounter.py"
- rm -f "$(DESTDIR)$(ASTDATADIR)/scripts/ast_coredumper"
+ -rm -f "$(DESTDIR)$(ASTDATADIR)/scripts/ast_loggrabber"
+ -rm -f "$(DESTDIR)$(ASTDATADIR)/scripts/ast_coredumper"
+ -rm -f "$(DESTDIR)$(ASTDATADIR)/scripts/refcounter.py"
diff --git a/contrib/scripts/ast_coredumper b/contrib/scripts/ast_coredumper
index c82732be9..81e94e945 100755
--- a/contrib/scripts/ast_coredumper
+++ b/contrib/scripts/ast_coredumper
@@ -15,6 +15,7 @@ SYNOPSIS
$prog [ --help ] [ --running | --RUNNING ] [ --latest ]
[ --tarball-coredumps ] [ --delete-coredumps-after ]
[ --tarball-results ] [ --delete-results-after ]
+ [ --tarball-uniqueid="<uniqueid>" ]
[ --no-default-search ] [ --append-coredumps ]
[ <coredump> | <pattern> ... ]
@@ -81,6 +82,11 @@ DESCRIPTION
to use this option unless you have also specified
--tarball-results.
+ --tarball-uniqueid="<uniqueid>"
+ Normally DATEFORMAT is used to make the tarballs unique
+ but you can use your own unique id in the tarball names
+ such as the Jira issue id.
+
--no-default-search
Ignore COREDUMPS from the config files and process only
coredumps listed on the command line (if any) and/or
@@ -111,6 +117,8 @@ DESCRIPTION
/tmp/core[-._]\$(hostname)!(*.txt)
NOTES
+ You must be root to use $prog.
+
The script relies on not only bash, but also recent GNU date and
gdb with python support. *BSD operating systems may require
installation of the 'coreutils' and 'devel/gdb' packagess and minor
@@ -171,6 +179,11 @@ EOF
exit 1
}
+if [ $EUID -ne 0 ] ; then
+ echo "You must be root to use $prog."
+ exit 1
+fi
+
running=false
RUNNING=false
latest=false
@@ -245,6 +258,9 @@ for a in "$@" ; do
--append-coredumps)
append_coredumps=true
;;
+ --tarball-uniqueid=*)
+ tarball_uniqueid=${a#*=}
+ ;;
--help|-*)
print_help
;;
@@ -294,7 +310,7 @@ if [ ${#COREDUMPS[@]} -gt 0 ] && $latest ; then
fi
# Timestamp to use for output files
-df=$(${DATEFORMAT})
+df=${tarball_uniqueid:-$(${DATEFORMAT})}
if $running || $RUNNING ; then
# We need to go through some gyrations to find the pid of the running
@@ -321,12 +337,9 @@ if $running || $RUNNING ; then
read -p "WARNING: Taking a core dump of the running asterisk instance will suspend call processing while the dump is saved. Do you wish to continue? (y/N) " answer
fi
if [[ "$answer" =~ ^[Yy] ]] ; then
- cf="/tmp/core.asterisk.running.$df"
- # We want a consistent coredump so stop the process
- # and continue it after the dump is complete.
- # kill -STOP $pid
+ cf="/tmp/core-asterisk-running-$df"
+ echo "Dumping running asterisk process to $cf"
${GDB} -p $pid -q --batch --ex "gcore $cf" >/dev/null 2>&1
- # kill -CONT $pid
COREDUMPS+=("$cf")
else
echo "Skipping dump of running process"
@@ -343,17 +356,17 @@ fi
# and save them to /tmp/.gdbinit
ss=`egrep -n "^#@@@SCRIPTSTART@@@" $0 |cut -f1 -d:`
-tail -n +${ss} $0 >/tmp/.gdbinit
+tail -n +${ss} $0 >/tmp/.ast_coredumper.gdbinit
# Now iterate over the coredumps and dump the debugging info
for i in ${!COREDUMPS[@]} ; do
cf=${COREDUMPS[$i]}
echo "Processing $cf"
- ${GDB} -n --batch -q --ex "source /tmp/.gdbinit" $(which asterisk) "$cf" 2>/dev/null | (
+ ${GDB} -n --batch -q --ex "source /tmp/.ast_coredumper.gdbinit" $(which asterisk) "$cf" 2>/dev/null | (
of=/dev/null
while IFS= read line ; do
if [[ "$line" =~ !@!@!@!\ ([^\ ]+)\ !@!@!@! ]] ; then
- of=$cf.${BASH_REMATCH[1]}
+ of=${cf}-${BASH_REMATCH[1]}
of=${of//:/-}
rm -f "$of"
echo "Creating $of"
@@ -364,7 +377,7 @@ for i in ${!COREDUMPS[@]} ; do
done
if $tarball_coredumps ; then
- tf=/tmp/asterisk.$df.coredumps.tar
+ tf=/tmp/asterisk-$df.coredumps.tar
echo "Creating $tf.gz"
for i in ${!COREDUMPS[@]} ; do
tar -uvf $tf "${COREDUMPS[@]}" 2>/dev/null
@@ -379,17 +392,17 @@ if $delete_coredumps_after ; then
fi
if $tarball_results ; then
- tf=/tmp/asterisk.$df.results.tar
+ tf=/tmp/asterisk-$df-results.tar
echo "Creating $tf.gz"
for i in ${!COREDUMPS[@]} ; do
- tar -uvf $tf "${COREDUMPS[$i]//:/-}".{brief,full,thread1,locks}.txt 2>/dev/null
+ tar -uvf $tf "${COREDUMPS[$i]//:/-}"-{brief,full,thread1,locks}.txt 2>/dev/null
done
gzip $tf
fi
if $delete_results_after ; then
for i in ${!COREDUMPS[@]} ; do
- rm -rf "${COREDUMPS[$i]//:/-}".{brief,full,thread1,locks}.txt
+ rm -rf "${COREDUMPS[$i]//:/-}"-{brief,full,thread1,locks}.txt
done
fi
diff --git a/contrib/scripts/ast_loggrabber b/contrib/scripts/ast_loggrabber
new file mode 100755
index 000000000..2036d54ba
--- /dev/null
+++ b/contrib/scripts/ast_loggrabber
@@ -0,0 +1,255 @@
+#!/usr/bin/env bash
+# Turn on extended globbing
+shopt -s extglob
+# Bail on any error
+set -e
+
+prog=$(basename $0)
+
+print_help() {
+cat <<EOF
+NAME
+$prog - Gather asterisk log files
+
+SYNOPSIS
+ $prog [ --help ] [ --dateformat="<dateformat>" ]
+ [ --timezone="<timezone>" ] [ --append-logfiles ]
+ [ --tarball-uniqueid="<uniqueid>" ]
+ [ <logfiles> | <pattern> ... ]
+
+DESCRIPTION
+
+ Gathers log files, optionally converts POSIX timestamps
+ to readable format. and creates a tarball.
+
+ Options:
+
+ --help
+ Print this help.
+
+ --dateformat="<dateformat>"
+ A Python strftime format string to be used when converting
+ POSIX timestamps in log files to readable format. If not
+ specified as an argument or in the config file, no conversion
+ is done.
+
+ --timezone="<timezone>"
+ The timezone to use when converting POSIX timestamps to
+ readable format. It can be specified in "<continent>/<city>"
+ format or in abbreviation format such as "CST6CDT". If not
+ specified as an argument or in the config file, the "local"
+ timezone is used.
+
+ --append-logfiles
+ Append any log files specified on the command line to the
+ config file specified ones instead of overriding them.
+
+ --tarball-uniqueid="<uniqueid>"
+ Normally DATEFORMAT is used to make the tarballs unique
+ but you can use your own unique id in the tarball names
+ such as a Jira issue id.
+
+ <logfiles> | <pattern>
+ A list of log files or log file search patterns. Unless
+ --append-logfiles was specified, these entries will override
+ those specified in the config files.
+
+ If no files are specified on the command line the, value of
+ LOGFILES from ast_debug_tools.conf will be used. Failing
+ that, the following patterns will be used:
+ /var/log/asterisk/messages*
+ /var/log/asterisk/queue*
+ /var/log/asterisk/debug*
+ /var/log/asterisk/security*
+
+NOTES
+ Any files output will have ':' characters changed to '-'. This is
+ to facilitate uploading those files to Jira which doesn't like the
+ colons.
+
+FILES
+ /etc/asterisk/ast_debug_tools.conf
+ ~/ast_debug_tools.conf
+ ./ast_debug_tools.conf
+
+ # Readable Local time for the tarball names
+ DATEFORMAT='date +%FT%H-%M-%S%z'
+
+ # A list of log files and/or log file search patterns using the
+ # same syntax as COREDUMPS.
+ #
+ LOGFILES=(/var/log/asterisk/messages* /var/log/asterisk/queue* \\
+ /var/log/asterisk/debug* /var/log/asterisk/security*)
+
+ # $prog converts POSIX timestamps to readable format
+ # using this Python strftime format string. If not specified
+ # or an empty string, no format covnersion is done.
+ LOG_DATEFORMAT="%m/%d %H:%M:%S.%f"
+
+ # The timezone to use when converting POSIX timestamps to
+ # readable format. It can be specified in "<continent>/<city>"
+ # format or in abbreviation format such as "CST6CDT". If not
+ # specified, the "local" timezone is used.
+ # LOG_TIMEZONE=
+
+EOF
+ exit 1
+}
+
+append_logfiles=false
+
+declare -a LOGFILES
+declare -a ARGS_LOGFILES
+
+# Read config files from least important to most important
+[ -f /etc/asterisk/ast_debug_tools.conf ] && source /etc/asterisk/ast_debug_tools.conf
+[ -f ~/ast_debug_tools.conf ] && source ~/ast_debug_tools.conf
+[ -f ./ast_debug_tools.conf ] && source ./ast_debug_tools.conf
+
+if [ ${#LOGFILES[@]} -eq 0 ] ; then
+ LOGFILES+=(/var/log/asterisk/messages* /var/log/asterisk/queue* \
+ /var/log/asterisk/debug* /var/log/asterisk/security*)
+fi
+
+DATEFORMAT=${DATEFORMAT:-'date +%FT%H-%M-%S%z'}
+
+# Use "$@" (with the quotes) so spaces in patterns or
+# file names are preserved.
+# Later on when we have to iterate over LOGFILES, we always
+# use the indexes rather than trying to expand the values of LOGFILES
+# just in case.
+
+for a in "$@" ; do
+ case "$a" in
+ --dateformat=*)
+ LOG_DATEFORMAT=${a#*=}
+ ;;
+ --timezone=*)
+ LOG_TIMEZONE=${a#*=}
+ ;;
+ --append-logfiles)
+ append_logfiles=true
+ ;;
+ --tarball-uniqueid=*)
+ tarball_uniqueid=${a#*=}
+ ;;
+ --help|-*)
+ print_help
+ ;;
+ *)
+ ARGS_LOGFILES+=("$a")
+ # If any files are specified on the command line, ignore those
+ # specified in the config files unless append-logfiles was specified.
+ if ! $append_logfiles ; then
+ LOGFILES=()
+ fi
+ esac
+done
+
+# append logfiles/patterns specified as command line arguments to LOGFILES.
+for i in ${!ARGS_LOGFILES[@]} ; do
+ LOGFILES+=("${ARGS_LOGFILES[$i]}")
+done
+
+# At this point, all glob entries that match files should be expanded.
+# Any entries that don't exist are probably globs that didn't match anything
+# and need to be pruned.
+
+for i in ${!LOGFILES[@]} ; do
+ if [ ! -f "${LOGFILES[$i]}" ] ; then
+ unset LOGFILES[$i]
+ continue
+ fi
+done
+
+# Sort and weed out any dups
+IFS=$'\x0a'
+readarray -t LOGFILES < <(echo -n "${LOGFILES[*]}" | sort -u )
+unset IFS
+
+if [ "${#LOGFILES[@]}" -eq 0 ] ; then
+ echo "No log files found"
+ print_help
+fi
+
+# Timestamp to use for output files
+df=${tarball_uniqueid:-$(${DATEFORMAT})}
+
+# Extract the Python timestamp conver script from the end of this
+# script and save it to /tmp/.ast_tsconvert.py
+
+ss=`egrep -n "^#@@@SCRIPTSTART@@@" $0 |cut -f1 -d:`
+tail -n +${ss} $0 >/tmp/.ast_tsconvert.py
+
+tmpdir=$(mktemp -d)
+if [ -z "$tmpdir" ] ; then
+ echo "${prog}: Unable to create temporary directory."
+ exit 1
+fi
+trap "rm -rf $tmpdir" EXIT
+tardir=asterisk-${df}.logfiles
+
+# Now iterate over the logfiles
+for i in ${!LOGFILES[@]} ; do
+ lf=${LOGFILES[$i]}
+ destdir="$tmpdir/$tardir/$(dirname $lf)"
+ destfile="$tmpdir/$tardir/$lf"
+ mkdir -p "$destdir" 2>/dev/null || :
+ if [ -n "$LOG_DATEFORMAT" ] ; then
+ echo "Converting $lf"
+ cat "$lf" | python /tmp/.ast_tsconvert.py --format="$LOG_DATEFORMAT" --timezone="$LOG_TIMEZONE" > "${destfile}"
+ else
+ echo "Copying $lf"
+ cp "$lf" "${destfile}"
+ fi
+done
+
+echo "Creating /tmp/$tardir.tar.gz"
+tar -czvf /tmp/$tardir.tar.gz -C $tmpdir $tardir 2>/dev/null
+
+exit
+
+# Be careful editng the inline scripts.
+# They're space-indented.
+
+# We need the python bit because lock_infos isn't
+# a valid symbol in asterisk unless DEBUG_THREADS was
+# used during the compile. Also, interrupt and continue
+# are only valid for a running program.
+
+#@@@SCRIPTSTART@@@
+import argparse
+import datetime as dt
+import dateutil.tz as tz
+import re
+import sys
+import time
+
+parser = argparse.ArgumentParser(description="Make POSIX timestamps readable")
+parser.add_argument('--format', action='store', required=True)
+parser.add_argument('--timezone', action='store', required=False)
+args=parser.parse_args()
+
+# We only convert timestamps that are at the beginning of a line
+# or are preceeded by a whilespace character or a '['
+rets = re.compile(r'(^|(?<=\s|\[))\d+(\.\d+)?', flags=re.M)
+if args.timezone and len(args.timezone) > 0:
+ tzf = tz.tzfile('/usr/share/zoneinfo/' + args.timezone)
+else:
+ tzf = tz.tzfile('/etc/localtime')
+
+now = time.time()
+a_year_ago = now - (86400.0 * 365)
+
+def convert(match):
+ ts = float(match.group(0))
+ if ts <= now and ts > a_year_ago and len(args.format) > 0:
+ return dt.datetime.fromtimestamp(ts, tzf).strftime(args.format)
+ else:
+ return match.group(0)
+
+while 1:
+ line = sys.stdin.readline()
+ if not line:
+ break
+ print(rets.sub(convert, line))
diff --git a/res/res_calendar.c b/res/res_calendar.c
index 46775507c..92b73c1ed 100644
--- a/res/res_calendar.c
+++ b/res/res_calendar.c
@@ -406,7 +406,12 @@ static struct ast_calendar *build_calendar(struct ast_config *cfg, const char *c
struct ast_variable *v, *last = NULL;
int new_calendar = 0;
- if (!(cal = find_calendar(cat))) {
+ cal = find_calendar(cat);
+ if (cal && cal->fetch_again_at_reload) {
+ /** Create new calendar, old will be removed during reload */
+ cal = unref_calendar(cal);
+ }
+ if (!cal) {
new_calendar = 1;
if (!(cal = ao2_alloc(sizeof(*cal), calendar_destructor))) {
ast_log(LOG_ERROR, "Could not allocate calendar structure. Stopping.\n");
@@ -483,7 +488,7 @@ static struct ast_calendar *build_calendar(struct ast_config *cfg, const char *c
}
}
- if (new_calendar || cal->fetch_again_at_reload) {
+ if (new_calendar) {
cal->thread = AST_PTHREADT_NULL;
ast_cond_init(&cal->unload, NULL);
ao2_link(calendars, cal);
diff --git a/res/res_pjsip_outbound_authenticator_digest.c b/res/res_pjsip_outbound_authenticator_digest.c
index ce77c3bad..4bbac342f 100644
--- a/res/res_pjsip_outbound_authenticator_digest.c
+++ b/res/res_pjsip_outbound_authenticator_digest.c
@@ -141,18 +141,18 @@ static int digest_create_request_with_auth(const struct ast_sip_auth_vector *aut
++cseq->cseq;
return 0;
case PJSIP_ENOCREDENTIAL:
- ast_log(LOG_WARNING, "Unable to create request with auth."
- "No auth credentials for any realms in challenge.\n");
+ ast_log(LOG_WARNING,
+ "Unable to create request with auth. No auth credentials for any realms in challenge.\n");
break;
case PJSIP_EAUTHSTALECOUNT:
- ast_log(LOG_WARNING, "Unable to create request with auth."
- "Number of stale retries exceeded\n");
+ ast_log(LOG_WARNING,
+ "Unable to create request with auth. Number of stale retries exceeded.\n");
break;
case PJSIP_EFAILEDCREDENTIAL:
- ast_log(LOG_WARNING, "Authentication credentials not accepted by server\n");
+ ast_log(LOG_WARNING, "Authentication credentials not accepted by server.\n");
break;
default:
- ast_log(LOG_WARNING, "Unable to create request with auth. Unknown failure\n");
+ ast_log(LOG_WARNING, "Unable to create request with auth. Unknown failure.\n");
break;
}