Files
pkgsrc-ng/comms/asterisk13/patches/patch-apps_app__queue.c
2016-11-18 22:39:22 +01:00

118 lines
5.6 KiB
C

$NetBSD: patch-apps_app__queue.c,v 1.1.1.1 2015/12/05 23:29:09 jnemeth Exp $
--- apps/app_queue.c.orig 2015-10-09 21:48:48.000000000 +0000
+++ apps/app_queue.c
@@ -5286,7 +5286,7 @@ static int wait_our_turn(struct queue_en
if ((status = get_member_status(qe->parent, qe->max_penalty, qe->min_penalty, qe->parent->leavewhenempty, 0))) {
*reason = QUEUE_LEAVEEMPTY;
- ast_queue_log(qe->parent->name, ast_channel_uniqueid(qe->chan), "NONE", "EXITEMPTY", "%d|%d|%ld", qe->pos, qe->opos, (long) (time(NULL) - qe->start));
+ ast_queue_log(qe->parent->name, ast_channel_uniqueid(qe->chan), "NONE", "EXITEMPTY", "%d|%d|%jd", qe->pos, qe->opos, (intmax_t) (time(NULL) - qe->start));
leave_queue(qe);
break;
}
@@ -6638,8 +6638,8 @@ static int try_calling(struct queue_ent
/* if setinterfacevar is defined, make member variables available to the channel */
/* use pbx_builtin_setvar to set a load of variables with one call */
if (qe->parent->setinterfacevar) {
- snprintf(interfacevar, sizeof(interfacevar), "MEMBERINTERFACE=%s,MEMBERNAME=%s,MEMBERCALLS=%d,MEMBERLASTCALL=%ld,MEMBERPENALTY=%d,MEMBERDYNAMIC=%d,MEMBERREALTIME=%d",
- member->interface, member->membername, member->calls, (long)member->lastcall, member->penalty, member->dynamic, member->realtime);
+ snprintf(interfacevar, sizeof(interfacevar), "MEMBERINTERFACE=%s,MEMBERNAME=%s,MEMBERCALLS=%d,MEMBERLASTCALL=%jd,MEMBERPENALTY=%d,MEMBERDYNAMIC=%d,MEMBERREALTIME=%d",
+ member->interface, member->membername, member->calls, (intmax_t)member->lastcall, member->penalty, member->dynamic, member->realtime);
pbx_builtin_setvar_multiple(qe->chan, interfacevar);
pbx_builtin_setvar_multiple(peer, interfacevar);
}
@@ -6647,8 +6647,8 @@ static int try_calling(struct queue_ent
/* if setqueueentryvar is defined, make queue entry (i.e. the caller) variables available to the channel */
/* use pbx_builtin_setvar to set a load of variables with one call */
if (qe->parent->setqueueentryvar) {
- snprintf(interfacevar, sizeof(interfacevar), "QEHOLDTIME=%ld,QEORIGINALPOS=%d",
- (long) (time(NULL) - qe->start), qe->opos);
+ snprintf(interfacevar, sizeof(interfacevar), "QEHOLDTIME=%jd,QEORIGINALPOS=%d",
+ (intmax_t) (time(NULL) - qe->start), qe->opos);
pbx_builtin_setvar_multiple(qe->chan, interfacevar);
pbx_builtin_setvar_multiple(peer, interfacevar);
}
@@ -7838,8 +7838,8 @@ static int queue_exec(struct ast_channel
}
}
- ast_debug(1, "queue: %s, expires: %ld, priority: %d\n",
- args.queuename, (long)qe.expire, prio);
+ ast_debug(1, "queue: %s, expires: %jd, priority: %d\n",
+ args.queuename, (intmax_t)qe.expire, prio);
qe.chan = chan;
qe.prio = prio;
@@ -7889,8 +7889,8 @@ check_turns:
record_abandoned(&qe);
reason = QUEUE_TIMEOUT;
res = 0;
- ast_queue_log(args.queuename, ast_channel_uniqueid(chan),"NONE", "EXITWITHTIMEOUT", "%d|%d|%ld",
- qe.pos, qe.opos, (long) (time(NULL) - qe.start));
+ ast_queue_log(args.queuename, ast_channel_uniqueid(chan),"NONE", "EXITWITHTIMEOUT", "%d|%d|%jd",
+ qe.pos, qe.opos, (intmax_t) (time(NULL) - qe.start));
break;
}
@@ -7935,7 +7935,7 @@ check_turns:
if ((status = get_member_status(qe.parent, qe.max_penalty, qe.min_penalty, qe.parent->leavewhenempty, 0))) {
record_abandoned(&qe);
reason = QUEUE_LEAVEEMPTY;
- ast_queue_log(args.queuename, ast_channel_uniqueid(chan), "NONE", "EXITEMPTY", "%d|%d|%ld", qe.pos, qe.opos, (long)(time(NULL) - qe.start));
+ ast_queue_log(args.queuename, ast_channel_uniqueid(chan), "NONE", "EXITEMPTY", "%d|%d|%jd", qe.pos, qe.opos, (intmax_t)(time(NULL) - qe.start));
res = 0;
break;
}
@@ -7958,7 +7958,7 @@ check_turns:
record_abandoned(&qe);
reason = QUEUE_TIMEOUT;
res = 0;
- ast_queue_log(qe.parent->name, ast_channel_uniqueid(qe.chan),"NONE", "EXITWITHTIMEOUT", "%d|%d|%ld", qe.pos, qe.opos, (long) (time(NULL) - qe.start));
+ ast_queue_log(qe.parent->name, ast_channel_uniqueid(qe.chan),"NONE", "EXITWITHTIMEOUT", "%d|%d|%jd", qe.pos, qe.opos, (intmax_t) (time(NULL) - qe.start));
break;
}
@@ -7986,8 +7986,8 @@ stop:
if (!qe.handled) {
record_abandoned(&qe);
ast_queue_log(args.queuename, ast_channel_uniqueid(chan), "NONE", "ABANDON",
- "%d|%d|%ld", qe.pos, qe.opos,
- (long) (time(NULL) - qe.start));
+ "%d|%d|%jd", qe.pos, qe.opos,
+ (intmax_t) (time(NULL) - qe.start));
res = -1;
} else if (qcontinue) {
reason = QUEUE_CONTINUE;
@@ -7995,7 +7995,7 @@ stop:
}
} else if (qe.valid_digits) {
ast_queue_log(args.queuename, ast_channel_uniqueid(chan), "NONE", "EXITWITHKEY",
- "%s|%d|%d|%ld", qe.digits, qe.pos, qe.opos, (long) (time(NULL) - qe.start));
+ "%s|%d|%d|%jd", qe.digits, qe.pos, qe.opos, (intmax_t) (time(NULL) - qe.start));
}
}
@@ -9163,9 +9163,9 @@ static char *__queues_show(struct manses
do_print(s, fd, " Callers: ");
for (qe = q->head; qe; qe = qe->next) {
- ast_str_set(&out, 0, " %d. %s (wait: %ld:%2.2ld, prio: %d)",
- pos++, ast_channel_name(qe->chan), (long) (now - qe->start) / 60,
- (long) (now - qe->start) % 60, qe->prio);
+ ast_str_set(&out, 0, " %d. %s (wait: %jd:%2.2jd, prio: %d)",
+ pos++, ast_channel_name(qe->chan), (intmax_t) (now - qe->start) / 60,
+ (intmax_t) (now - qe->start) % 60, qe->prio);
do_print(s, fd, ast_str_buffer(out));
}
}
@@ -9531,7 +9531,7 @@ static int manager_queues_status(struct
"CallerIDName: %s\r\n"
"ConnectedLineNum: %s\r\n"
"ConnectedLineName: %s\r\n"
- "Wait: %ld\r\n"
+ "Wait: %jd\r\n"
"%s"
"\r\n",
q->name, pos++, ast_channel_name(qe->chan), ast_channel_uniqueid(qe->chan),