This commit prevents cdr records with AST_CDR_FLAG_ANSLOCKED and AST_CDR_FLAG_LOCKED from being updated in certain cases.

This is accomplished by adding two functions to update the answer time and disposition of calls that checks for the proper lock flags.  These functions are used in the ast_bridge_call() function so that ForkCDR(A) calls are respected.

This patch also modifies the way ast_bridge_call() chooses the cdr record to base the bridged_cdr on.  Previously the first unlocked cdr record would be chosen, now instead the first cdr record is chosen and forked cdr records are moved to the bridge_cdr.  This allows the original cdr record and any forked cdr records to be properly updated with answer and end times.

(closes issue #13797)
Reported by: sh0t
Tested by: sh0t

(closes issue #14744)
Reported by: deepesh


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@195881 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Matthew Nicholson
2009-05-21 15:25:50 +00:00
parent 91843c8c58
commit df4812c96e
3 changed files with 52 additions and 6 deletions

View File

@@ -266,6 +266,24 @@ void ast_cdr_setdestchan(struct ast_cdr *cdr, const char *chan);
*/
void ast_cdr_setapp(struct ast_cdr *cdr, char *app, char *data);
/*! Set the answer time for a call */
/*!
* \param cdr the cdr you wish to associate with the call
* \param t the answer time
* Starts all CDR stuff necessary for doing CDR when answering a call
* NULL argument is just fine.
*/
void ast_cdr_setanswer(struct ast_cdr *cdr, struct timeval t);
/*! Set the disposition for a call */
/*!
* \param cdr the cdr you wish to associate with the call
* \param disposition the new disposition
* Set the disposition on a call.
* NULL argument is just fine.
*/
void ast_cdr_setdisposition(struct ast_cdr *cdr, long int disposition);
/*! Convert a string to a detail record AMA flag */
/*!
* \param flag string form of flag