Index: apps/app_queue.c =================================================================== --- apps/app_queue.c (revision 295023) +++ apps/app_queue.c (working copy) @@ -1031,6 +1031,7 @@ static void update_realtime_members(struct call_queue *q); static int set_member_paused(const char *queuename, const char *interface, const char *reason, int paused); +static void rna(int rnatime, struct queue_ent *qe, char *interface, char *membername, int pause, int reason); static void queue_transfer_fixup(void *data, struct ast_channel *old_chan, struct ast_channel *new_chan); /*! \brief sets the QUEUESTATUS channel variable */ @@ -2883,6 +2884,7 @@ /* Request the peer */ tmp->chan = ast_request(tech, qe->chan->nativeformats, qe->chan, location, &status); if (!tmp->chan) { /* If we can't, just go on to the next call */ + rna(0, qe, tmp->member->state_interface, tmp->member->membername, 0, AST_CAUSE_CONGESTION); if (qe->chan->cdr) ast_cdr_busy(qe->chan->cdr); tmp->stillgoing = 0; @@ -2966,6 +2968,7 @@ /* Place the call, but don't wait on the answer */ if ((res = ast_call(tmp->chan, location, 0))) { /* Again, keep going even if there's an error */ + rna(0, qe, tmp->member->state_interface, tmp->member->membername, 0, AST_CAUSE_CONGESTION); ast_debug(1, "ast call on peer returned %d\n", res); ast_verb(3, "Couldn't call %s\n", tmp->interface); ast_channel_unlock(tmp->chan); @@ -3188,7 +3191,7 @@ } /*! \brief RNA == Ring No Answer. Common code that is executed when we try a queue member and they don't answer. */ -static void rna(int rnatime, struct queue_ent *qe, char *interface, char *membername, int pause) +static void rna(int rnatime, struct queue_ent *qe, char *interface, char *membername, int pause, int reason) { ast_verb(3, "Nobody picked up in %d ms\n", rnatime); @@ -3208,6 +3211,7 @@ "Member: %s\r\n" "MemberName: %s\r\n" "Ringtime: %d\r\n" + "Reason: %s\r\n" "%s", qe->parent->name, qe->chan->uniqueid, @@ -3215,9 +3219,10 @@ interface, membername, rnatime, + ast_cause2str(reason), qe->parent->eventwhencalled == QUEUE_EVENT_VARIABLES ? vars2manager(qe->chan, vars, sizeof(vars)) : ""); } - ast_queue_log(qe->parent->name, qe->chan->uniqueid, membername, "RINGNOANSWER", "%d", rnatime); + ast_queue_log(qe->parent->name, qe->chan->uniqueid, membername, "RINGNOANSWER", "%d|%s", rnatime, ast_cause2str(reason)); if (qe->parent->autopause != QUEUE_AUTOPAUSE_OFF && pause) { if (qe->parent->autopause == QUEUE_AUTOPAUSE_ON) { if (!set_member_paused(qe->parent->name, interface, "Auto-Pause", 1)) { @@ -3514,7 +3519,7 @@ do_hang(o); endtime = (long) time(NULL); endtime -= starttime; - rna(endtime * 1000, qe, on, membername, 0); + rna(endtime * 1000, qe, on, membername, 0, o->chan->hangupcause); if (qe->parent->strategy != QUEUE_STRATEGY_RINGALL) { if (qe->parent->timeoutrestart) *to = orig; @@ -3532,7 +3537,7 @@ ast_cdr_busy(in->cdr); endtime = (long) time(NULL); endtime -= starttime; - rna(endtime * 1000, qe, on, membername, 0); + rna(endtime * 1000, qe, on, membername, 0, o->chan->hangupcause); do_hang(o); if (qe->parent->strategy != QUEUE_STRATEGY_RINGALL) { if (qe->parent->timeoutrestart) @@ -3602,7 +3607,7 @@ ast_frfree(f); } else { /* ast_read() returned NULL */ endtime = (long) time(NULL) - starttime; - rna(endtime * 1000, qe, on, membername, 1); + rna(endtime * 1000, qe, on, membername, 1, o->chan->hangupcause); do_hang(o); if (qe->parent->strategy != QUEUE_STRATEGY_RINGALL) { if (qe->parent->timeoutrestart) @@ -3647,7 +3652,7 @@ } if (!*to) { for (o = start; o; o = o->call_next) - rna(orig, qe, o->interface, o->member->membername, 1); + rna(orig, qe, o->interface, o->member->membername, 1, AST_CAUSE_NOANSWER); } } Index: UPGRADE.txt =================================================================== --- UPGRADE.txt (revision 295023) +++ UPGRADE.txt (working copy) @@ -30,6 +30,12 @@ - The default value for 'context' and 'parkinglots' in gtalk.conf has been changed to 'default', previously they were empty. +QueueLog: + - RINGNOANSWER now has the hangup reason as the last parameter. +Manager: + - Manager event AgentRingNoAnswer now includes "Reason"- + parameter, which holds the hangup reason. + =========================================================== ===========================================================