[asterisk-dev] app_queue Resetting Member Last Call Time During Answer

Jamuel Starkey jamuel at hcvoip.com
Thu Jan 13 15:30:47 CST 2011


Hi,

I am experimenting with resetting the last call time in app_queue so that the value is set when the call is answered  by the agent (as opposed to the normal behavior of setting it when the call is answered and subsequently hung up by agent).  In the function *wait_for_answer() down in the case AST_CONTROL_ANSWER switch clause (near line 2994 in v1.6.2.10) I've elected to add time(&o->member->lastcall) to set the lastcall to the current time the call was answered.

Is this good enough or do I need to consider any sort of locking implications when dealing with the o->member->lastcall here?

Here's a code snippet:

case AST_CONTROL_ANSWER:
/* This is our guy if someone answered. */
if (!peer) {
    ast_verb(3, "%s answered %s\n", o->chan->name, in->name);
    time(&o->member->lastcall);  /* Update last call now so that agent's last call time is reset upon answer */ 
    peer = o;
}
break;


Thanks for any advice.

Cheers,

JPS



More information about the asterisk-dev mailing list