Asterisk - The Open Source Telephony Project GIT-master-f36a736
cdr.h
Go to the documentation of this file.
1/*
2 * Asterisk -- An open source telephony toolkit.
3 *
4 * Copyright (C) 1999 - 2005, Digium, Inc.
5 *
6 * Mark Spencer <markster@digium.com>
7 *
8 * See http://www.asterisk.org for more information about
9 * the Asterisk project. Please do not directly contact
10 * any of the maintainers of this project for assistance;
11 * the project provides a web site, mailing lists and IRC
12 * channels for your use.
13 *
14 * This program is free software, distributed under the terms of
15 * the GNU General Public License Version 2. See the LICENSE file
16 * at the top of the source tree.
17 */
18
19/*!
20 * \file
21 * \brief Call Detail Record API
22 *
23 * \author Mark Spencer <markster@digium.com>
24 */
25
26#ifndef _ASTERISK_CDR_H
27#define _ASTERISK_CDR_H
28
29#include "asterisk/channel.h"
30
31/*! \file
32 *
33 * \since 12
34 *
35 * \brief Call Detail Record Engine.
36 *
37 * \page CDR Call Detail Record Engine
38 *
39 * \par Intro
40 *
41 * The Call Detail Record (CDR) engine uses the \ref stasis Stasis Message Bus
42 * to build records for the channels in Asterisk. As the state of a channel and
43 * the bridges it participates in changes, notifications are sent over the
44 * Stasis Message Bus. The CDR engine consumes these notifications and builds
45 * records that reflect that state. Over the lifetime of a channel, many CDRs
46 * may be generated for that channel or that involve that channel.
47 *
48 * CDRs have a lifecycle that is a subset of the channel that they reflect. A
49 * single CDR for a channel represents a path of communication between the
50 * endpoint behind a channel and Asterisk, or between two endpoints. When a
51 * channel establishes a new path of communication, a new CDR is created for the
52 * channel. Likewise, when a path of communication is terminated, a CDR is
53 * finalized. Finally, when a channel is no longer present in Asterisk, all CDRs
54 * for that channel are dispatched for recording.
55 *
56 * Dispatching of CDRs occurs to registered CDR backends. CDR backends register
57 * through \ref ast_cdr_register and are responsible for taking the produced
58 * CDRs and storing them in permanent storage.
59 *
60 * \par CDR attributes
61 *
62 * While a CDR can have many attributes, all CDRs have two parties: a Party A
63 * and a Party B. The Party A is \em always the channel that owns the CDR. A CDR
64 * may or may not have a Party B, depending on its state.
65 *
66 * For the most part, attributes on a CDR are reflective of those same
67 * attributes on the channel at the time when the CDR was finalized. Specific
68 * CDR attributes include:
69 * \li \c start The time when the CDR was created
70 * \li \c answer The time when the Party A was answered, or when the path of
71 * communication between Party A and Party B was established
72 * \li \c end The time when the CDR was finalized
73 * \li \c duration \c end - \c start. If \c end is not known, the current time
74 * is used
75 * \li \c billsec \c end - \c answer. If \c end is not known, the current time
76 * is used
77 * \li \c userfield User set data on some party in the CDR
78 *
79 * Note that \c accountcode and \c amaflags are actually properties of a
80 * channel, not the CDR.
81 *
82 * \par CDR States
83 *
84 * CDRs go through various states during their lifetime. State transitions occur
85 * due to messages received over the \ref stasis Stasis Message Bus. The
86 * following describes the possible states a CDR can be in, and how it
87 * transitions through the states.
88 *
89 * \par Single
90 *
91 * When a CDR is created, it is put into the Single state. The Single state
92 * represents a CDR for a channel that has no Party B. CDRs can be unanswered
93 * or answered while in the Single state.
94 *
95 * The following transitions can occur while in the Single state:
96 * \li If a \ref ast_channel_dial_type indicating a Dial Begin is received, the
97 * state transitions to Dial
98 * \li If a \ref ast_channel_snapshot is received indicating that the channel
99 * has hung up, the state transitions to Finalized
100 * \li If a \ref ast_bridge_blob is received indicating a Bridge Enter, the
101 * state transitions to Bridge
102 * \li If a \ref ast_bridge_blob message indicating an entrance to a
103 * holding bridge with a subclass type of "parking" is received, the CDR is
104 * transitioned to the Parked state.
105 *
106 * \par Dial
107 *
108 * This state represents a dial that is occurring within Asterisk. The Party A
109 * can either be the caller for a two party dial, or it can be the dialed party
110 * if the calling party is Asterisk (that is, an Originated channel). In the
111 * first case, the Party B is \em always the dialed channel; in the second case,
112 * the channel is not considered to be a "dialed" channel as it is alone in the
113 * dialed operation.
114 *
115 * While in the Dial state, multiple CDRs can be created for the Party A if a
116 * parallel dial occurs. Each dialed party receives its own CDR with Party A.
117 *
118 * The following transitions can occur while in the Dial state:
119 * \li If a \ref ast_channel_dial_type indicating a Dial End is received where
120 * the \c dial_status is not ANSWER, the state transitions to Finalized
121 * \li If a \ref ast_channel_snapshot is received indicating that the channel
122 * has hung up, the state transitions to Finalized
123 * \li If a \ref ast_channel_dial_type indicating a Dial End is received where
124 * the \c dial_status is ANSWER, the state transitions to DialedPending
125 * \li If a \ref ast_bridge_blob is received indicating a Bridge Enter, the
126 * state transitions to Bridge
127 *
128 * \par DialedPending
129 *
130 * Technically, after being dialed, a CDR does not have to transition to the
131 * Bridge state. If the channel being dialed was originated, the channel may
132 * being executing dialplan. Strangely enough, it is also valid to have both
133 * Party A and Party B - after a dial - to not be bridged and instead execute
134 * dialplan. DialedPending handles the state where we figure out if the CDR
135 * showing the dial needs to move to the Bridge state; if the CDR should show
136 * that we started executing dialplan; of if we need a new CDR.
137 *
138 * The following transition can occur while in the DialedPending state:
139 * \li If a \ref ast_channel_snapshot is received that indicates that the
140 * channel has begun executing dialplan, we transition to the Finalized state
141 * if we have a Party B. Otherwise, we transition to the Single state.
142 * \li If a \ref ast_bridge_blob is received indicating a Bridge Enter, the
143 * state transitions to Bridge (through the Dial state)
144 * \li If a \ref ast_bridge_blob message indicating an entrance to a
145 * holding bridge with a subclass type of "parking" is received, the CDR is
146 * transitioned to the Parked state.
147 *
148 * \par Bridge
149 *
150 * The Bridge state represents a path of communication between Party A and one
151 * or more other parties. When a CDR enters into the Bridge state, the following
152 * occurs:
153 * \li The CDR attempts to find a Party B. If the CDR has a Party B, it looks
154 * for that channel in the bridge and updates itself accordingly. If the CDR
155 * does not yet have a Party B, it attempts to find a channel that can be its
156 * Party B. If it finds one, it updates itself; otherwise, the CDR is
157 * temporarily finalized.
158 * \li Once the CDR has a Party B or it is determined that it cannot have a
159 * Party B, new CDRs are created for each pairing of channels with the CDR's
160 * Party A.
161 *
162 * As an example, consider the following:
163 * \li A Dials B - both answer
164 * \li B joins a bridge. Since no one is in the bridge and it was a dialed
165 * channel, it cannot have a Party B.
166 * \li A joins the bridge. Since A's Party B is B, A updates itself with B.
167 * \li Now say an Originated channel, C, joins the bridge. The bridge becomes
168 * a multi-party bridge.
169 * \li C attempts to get a Party B. A cannot be C's Party B, as it was created
170 * before it. B is a dialed channel and can thus be C's Party B, so C's CDR
171 * updates its Party B to B.
172 * \li New CDRs are now generated. A gets a new CDR for A -> C. B is dialed, and
173 * hence cannot get any CDR.
174 * \li Now say another Originated channel, D, joins the bridge. Say D has the
175 * \ref AST_CDR_FLAG_PARTY_A flag set on it, such that it is always the
176 * preferred Party A. As such, it takes A as its Party B.
177 * \li New CDRs are generated. D gets new CDRs for D -> B and D -> C.
178 *
179 * The following transitions can occur while in the Bridge state:
180 * \li If a \ref ast_bridge_blob message indicating a leave is received,
181 * the state transitions to the Finalized state.
182 *
183 * \par Parked
184 *
185 * Parking is technically just another bridge in the Asterisk bridging
186 * framework. Unlike other bridges, however there are several key distinctions:
187 * \li With normal bridges, you want to show paths of communication between
188 * the participants. In parking, however, each participant is independent.
189 * From the perspective of a CDR, a call in parking should look like a dialplan
190 * application just executed.
191 * \li Holding bridges are typically items using in more complex applications,
192 * and so we usually don't want to show them. However, with Park, there is no
193 * application execution - often, a channel will be put directly into the
194 * holding bridge, bypassing the dialplan. This occurs when a call is blind
195 * transferred to a parking extension.
196 *
197 * As such, if a channel enters a bridge and that happens to be a holding bridge
198 * with a subclass type of "parking", we transition the CDR into the Parked
199 * state. The parking Stasis message updates the application name and data to
200 * reflect that the channel is in parking. When this occurs, a special flag is
201 * set on the CDR that prevents the application name from being updates by
202 * subsequent channel snapshot updates.
203 *
204 * The following transitions can occur while in the Parked state:
205 * \li If a \ref ast_bridge_blob message indicating a leave is received,
206 * the state transitions to the Finalized state
207 *
208 * \par Finalized
209 *
210 * Once a CDR enters the finalized state, it is finished. No further updates
211 * can be made to the party information, and the CDR cannot be changed.
212 *
213 * One exception to this occurs during linkedid propagation, in which the CDRs
214 * linkedids are updated based on who the channel is bridged with. In general,
215 * however, a finalized CDR is waiting for dispatch to the CDR backends.
216 */
217
218/*! \brief CDR engine settings */
220 CDR_ENABLED = 1 << 0, /*!< Enable CDRs */
221 CDR_BATCHMODE = 1 << 1, /*!< Whether or not we should dispatch CDRs in batches */
222 CDR_UNANSWERED = 1 << 2, /*!< Log unanswered CDRs */
223 CDR_CONGESTION = 1 << 3, /*!< Treat congestion as if it were a failed call */
224 CDR_END_BEFORE_H_EXTEN = 1 << 4, /*!< End the CDR before the 'h' extension runs */
225 CDR_INITIATED_SECONDS = 1 << 5, /*!< Include microseconds into the billing time */
226 CDR_DEBUG = 1 << 6, /*!< Enables extra debug statements */
227 CDR_CHANNEL_DEFAULT_ENABLED = 1 << 7, /*!< Whether CDR is enabled for each channel by default */
228 CDR_IGNORE_STATE_CHANGES = 1 << 8, /*!< Whether to ignore bridge and other call state change events */
229 CDR_IGNORE_DIAL_CHANGES = 1 << 9, /*!< Whether to ignore dial state changes */
230};
231
232/*! \brief CDR Batch Mode settings */
234 BATCH_MODE_SCHEDULER_ONLY = 1 << 0, /*!< Don't spawn a thread to handle the batches - do it on the scheduler */
235 BATCH_MODE_SAFE_SHUTDOWN = 1 << 1, /*!< During safe shutdown, submit the batched CDRs */
236};
237
238/*!
239 * \brief CDR manipulation options. Certain function calls will manipulate the
240 * state of a CDR object based on these flags.
241 */
243 AST_CDR_FLAG_KEEP_VARS = (1 << 0), /*!< Copy variables during the operation */
244 AST_CDR_FLAG_DISABLE = (1 << 1), /*!< Disable the current CDR */
245 AST_CDR_FLAG_DISABLE_ALL = (3 << 1), /*!< Disable the CDR and all future CDRs */
246 AST_CDR_FLAG_PARTY_A = (1 << 3), /*!< Set the channel as party A */
247 AST_CDR_FLAG_FINALIZE = (1 << 4), /*!< Finalize the current CDRs */
248 AST_CDR_FLAG_SET_ANSWER = (1 << 5), /*!< If the channel is answered, set the answer time to now */
249 AST_CDR_FLAG_RESET = (1 << 6), /*!< If set, set the start and answer time to now */
250 AST_CDR_LOCK_APP = (1 << 7), /*!< Prevent any further changes to the application field/data field for this CDR */
251};
252
253/*!
254 * \brief CDR Flags - Disposition
255 */
258 AST_CDR_NULL = (1 << 0),
259 AST_CDR_FAILED = (1 << 1),
260 AST_CDR_BUSY = (1 << 2),
263};
264
265
266/*! \brief The global options available for CDRs */
268 struct ast_flags settings; /*!< CDR settings */
270 unsigned int time; /*!< Time between batches */
271 unsigned int size; /*!< Size to trigger a batch */
272 struct ast_flags settings; /*!< Settings for batches */
274};
275
276/*!
277 * \brief Responsible for call detail data
278 */
279struct ast_cdr {
280 /*! Caller*ID with text */
282 /*! Caller*ID number */
284 /*! Destination extension */
286 /*! Destination context */
288
290 /*! Destination channel if appropriate */
292 /*! Last application if appropriate */
294 /*! Last application data */
296
297 struct timeval start;
298
299 struct timeval answer;
300
301 struct timeval end;
302 /*! Total time in system, in seconds */
303 long int duration;
304 /*! Total time call is up, in seconds */
305 long int billsec;
306 /*! What happened to the call */
307 long int disposition;
308 /*! What flags to use */
309 long int amaflags;
310 /*! What account number to use */
312 /*! Account number of the last person we talked to */
314 /*! flags */
315 unsigned int flags;
316 /*! Unique Channel Identifier */
318 /*! Linked group Identifier */
320 /*! Channel tenant Identifier */
322 /*! Channel tenant Identifier of the last person we talked to */
324 /*! User field */
326 /*! Sequence field */
328
329 /*! A linked list for variables */
331
332 struct ast_cdr *next;
333};
334
335/*!
336 * \since 12
337 * \brief Obtain the current CDR configuration
338 *
339 * The configuration is a ref counted object. The caller of this function must
340 * decrement the ref count when finished with the configuration.
341 *
342 * \retval NULL on error
343 * \return The current CDR configuration
344 */
346
347/*!
348 * \since 12
349 * \brief Set the current CDR configuration
350 *
351 * \param config The new CDR configuration
352 */
354
355/*!
356 * \since 12
357 * \brief Format a CDR variable from an already posted CDR
358 *
359 * \param cdr The dispatched CDR to process
360 * \param name The name of the variable
361 * \param ret Pointer to the formatted buffer
362 * \param workspace A pointer to the buffer to use to format the variable
363 * \param workspacelen The size of \p workspace
364 * \param raw If non-zero and a date/time is extracted, provide epoch seconds. Otherwise format as a date/time stamp
365 */
366void ast_cdr_format_var(struct ast_cdr *cdr, const char *name, char **ret, char *workspace, int workspacelen, int raw);
367
368/*!
369 * \since 12
370 * \brief Retrieve a CDR variable from a channel's current CDR
371 *
372 * \param channel_name The name of the party A channel that the CDR is associated with
373 * \param name The name of the variable to retrieve
374 * \param value Buffer to hold the value
375 * \param length The size of the buffer
376 *
377 * \retval 0 on success
378 * \retval non-zero on failure
379 */
380int ast_cdr_getvar(const char *channel_name, const char *name, char *value, size_t length);
381
382/*!
383 * \since 12
384 * \brief Set a variable on a CDR
385 *
386 * \param channel_name The channel to set the variable on
387 * \param name The name of the variable to set
388 * \param value The value of the variable to set
389 *
390 * \retval 0 on success
391 * \retval non-zero on failure
392 */
393int ast_cdr_setvar(const char *channel_name, const char *name, const char *value);
394
395/*!
396 * \since 12
397 * \brief Fork a CDR
398 *
399 * \param channel_name The name of the channel whose CDR should be forked
400 * \param options Options to control how the fork occurs.
401 *
402 * \retval 0 on success
403 * \retval -1 on failure
404 */
405int ast_cdr_fork(const char *channel_name, struct ast_flags *options);
406
407/*!
408 * \since 12
409 * \brief Set a property on a CDR for a channel
410 *
411 * This function sets specific administrative properties on a CDR for a channel.
412 * This includes properties like preventing a CDR from being dispatched, to
413 * setting the channel as the preferred Party A in future CDRs. See
414 * \ref ast_cdr_options for more information.
415 *
416 * \param channel_name The CDR's channel
417 * \param option Option to apply to the CDR
418 *
419 * \retval 0 on success
420 * \retval 1 on error
421 */
422int ast_cdr_set_property(const char *channel_name, enum ast_cdr_options option);
423
424/*!
425 * \since 12
426 * \brief Clear a property on a CDR for a channel
427 *
428 * Clears a flag previously set by \ref ast_cdr_set_property
429 *
430 * \param channel_name The CDR's channel
431 * \param option Option to clear from the CDR
432 *
433 * \retval 0 on success
434 * \retval 1 on error
435 */
436int ast_cdr_clear_property(const char *channel_name, enum ast_cdr_options option);
437
438/*!
439 * \brief Reset the detail record
440 * \param channel_name The channel that the CDR is associated with
441 * \param keep_variables Keep the variables during the reset. If zero,
442 * variables are discarded during the reset.
443 *
444 * \retval 0 on success
445 * \retval -1 on failure
446 */
447int ast_cdr_reset(const char *channel_name, int keep_variables);
448
449/*!
450 * \brief Serializes all the data and variables for a current CDR record
451 * \param channel_name The channel to get the CDR for
452 * \param buf A buffer to use for formatting the data
453 * \param delim A delimeter to use to separate variable keys/values
454 * \param sep A separator to use between nestings
455 * \return the total number of serialized variables
456 */
457int ast_cdr_serialize_variables(const char *channel_name, struct ast_str **buf, char delim, char sep);
458
459/*!
460 * \brief CDR backend callback
461 * \warning CDR backends should NOT attempt to access the channel associated
462 * with a CDR record. This channel is not guaranteed to exist when the CDR
463 * backend is invoked.
464 */
465typedef int (*ast_cdrbe)(struct ast_cdr *cdr);
466
467/*! \brief Return TRUE if CDR subsystem is enabled */
468int ast_cdr_is_enabled(void);
469
470/*!
471 * \brief Allocate a CDR record
472 * \return a malloc'd ast_cdr structure
473 * \retval NULL on error (malloc failure)
474 */
475struct ast_cdr *ast_cdr_alloc(void);
476
478
479/*!
480 * \brief Return the message router for the CDR engine
481 *
482 * This returns the \ref stasis_message_router that the CDR engine
483 * uses for dispatching \ref stasis messages. The reference on the
484 * message router is bumped and must be released by the caller of
485 * this function.
486 *
487 * \retval NULL if the CDR engine is disabled or unavailable
488 * \return the \ref stasis_message_router otherwise
489 */
491
492/*!
493 * \brief Duplicate a public CDR
494 * \param cdr the record to duplicate
495 *
496 * \return a malloc'd ast_cdr structure,
497 * \retval NULL on error (malloc failure)
498 */
499struct ast_cdr *ast_cdr_dup(struct ast_cdr *cdr);
500
501/*!
502 * \brief Free a CDR record
503 * \param cdr ast_cdr structure to free
504 */
505void ast_cdr_free(struct ast_cdr *cdr);
506
507/*!
508 * \brief Register a CDR handling engine
509 * \param name name associated with the particular CDR handler
510 * \param desc description of the CDR handler
511 * \param be function pointer to a CDR handler
512 * Used to register a Call Detail Record handler.
513 * \retval 0 on success.
514 * \retval -1 on error
515 */
516int ast_cdr_register(const char *name, const char *desc, ast_cdrbe be);
517
518/*!
519 * \brief Unregister a CDR handling engine
520 * \param name name of CDR handler to unregister
521 * Unregisters a CDR by it's name
522 *
523 * \retval 0 The backend unregistered successfully
524 * \retval -1 The backend could not be unregistered at this time
525 */
526int ast_cdr_unregister(const char *name);
527
528/*!
529 * \brief Suspend a CDR backend temporarily
530 *
531 * \retval 0 The backend is suspended
532 * \retval -1 The backend could not be suspended
533 */
534int ast_cdr_backend_suspend(const char *name);
535
536/*!
537 * \brief Unsuspend a CDR backend
538 *
539 * \retval 0 The backend was unsuspended
540 * \retval -1 The back could not be unsuspended
541 */
542int ast_cdr_backend_unsuspend(const char *name);
543
544/*!
545 * \brief Register a CDR modifier
546 * \param name name associated with the particular CDR modifier
547 * \param desc description of the CDR modifier
548 * \param be function pointer to a CDR modifier
549 *
550 * Used to register a Call Detail Record modifier.
551 *
552 * This gives modules a chance to modify CDR fields before they are dispatched
553 * to registered backends (odbc, syslog, etc).
554 *
555 * \note The *modified* CDR will be passed to **all** registered backends for
556 * logging. For instance, if cdr_manager changes the CDR data, cdr_adaptive_odbc
557 * will also get the modified CDR.
558 *
559 * \retval 0 on success.
560 * \retval -1 on error
561 */
562int ast_cdr_modifier_register(const char *name, const char *desc, ast_cdrbe be);
563
564/*!
565 * \brief Unregister a CDR modifier
566 * \param name name of CDR modifier to unregister
567 * Unregisters a CDR modifier by its name
568 *
569 * \retval 0 The modifier unregistered successfully
570 * \retval -1 The modifier could not be unregistered at this time
571 */
572int ast_cdr_modifier_unregister(const char *name);
573
574/*!
575 * \brief Disposition to a string
576 * \param disposition input binary form
577 * Converts the binary form of a disposition to string form.
578 * \return a pointer to the string form
579 */
580const char *ast_cdr_disp2str(int disposition);
581
582/*!
583 * \brief Set CDR user field for channel (stored in CDR)
584 *
585 * \param channel_name The name of the channel that owns the CDR
586 * \param userfield The user field to set
587 */
588void ast_cdr_setuserfield(const char *channel_name, const char *userfield);
589
590/*! Submit any remaining CDRs and prepare for shutdown */
591void ast_cdr_engine_term(void);
592
593#endif /* _ASTERISK_CDR_H */
int ast_cdr_is_enabled(void)
Return TRUE if CDR subsystem is enabled.
Definition: cdr.c:2927
void ast_cdr_setuserfield(const char *channel_name, const char *userfield)
Set CDR user field for channel (stored in CDR)
Definition: cdr.c:3556
int ast_cdr_modifier_register(const char *name, const char *desc, ast_cdrbe be)
Register a CDR modifier.
Definition: cdr.c:3014
void ast_cdr_free(struct ast_cdr *cdr)
Free a CDR record.
Definition: cdr.c:3490
ast_cdr_settings
CDR engine settings.
Definition: cdr.h:219
@ CDR_UNANSWERED
Definition: cdr.h:222
@ CDR_IGNORE_STATE_CHANGES
Definition: cdr.h:228
@ CDR_INITIATED_SECONDS
Definition: cdr.h:225
@ CDR_ENABLED
Definition: cdr.h:220
@ CDR_CHANNEL_DEFAULT_ENABLED
Definition: cdr.h:227
@ CDR_END_BEFORE_H_EXTEN
Definition: cdr.h:224
@ CDR_IGNORE_DIAL_CHANGES
Definition: cdr.h:229
@ CDR_BATCHMODE
Definition: cdr.h:221
@ CDR_CONGESTION
Definition: cdr.h:223
@ CDR_DEBUG
Definition: cdr.h:226
void ast_cdr_set_config(struct ast_cdr_config *config)
Set the current CDR configuration.
Definition: cdr.c:2906
ast_cdr_batch_mode_settings
CDR Batch Mode settings.
Definition: cdr.h:233
@ BATCH_MODE_SAFE_SHUTDOWN
Definition: cdr.h:235
@ BATCH_MODE_SCHEDULER_ONLY
Definition: cdr.h:234
struct stasis_message_router * ast_cdr_message_router(void)
Return the message router for the CDR engine.
Definition: cdr.c:4373
int ast_cdr_modifier_unregister(const char *name)
Unregister a CDR modifier.
Definition: cdr.c:3059
int ast_cdr_clear_property(const char *channel_name, enum ast_cdr_options option)
Clear a property on a CDR for a channel.
Definition: cdr.c:3654
int ast_cdr_setvar(const char *channel_name, const char *name, const char *value)
Set a variable on a CDR.
Definition: cdr.c:3249
void ast_cdr_format_var(struct ast_cdr *cdr, const char *name, char **ret, char *workspace, int workspacelen, int raw)
Format a CDR variable from an already posted CDR.
Definition: cdr.c:3116
ast_cdr_disposition
CDR Flags - Disposition.
Definition: cdr.h:256
@ AST_CDR_CONGESTION
Definition: cdr.h:262
@ AST_CDR_NULL
Definition: cdr.h:258
@ AST_CDR_NOANSWER
Definition: cdr.h:257
@ AST_CDR_ANSWERED
Definition: cdr.h:261
@ AST_CDR_BUSY
Definition: cdr.h:260
@ AST_CDR_FAILED
Definition: cdr.h:259
void ast_cdr_engine_term(void)
Definition: cdr.c:4682
struct ast_cdr * ast_cdr_alloc(void)
Allocate a CDR record.
Definition: cdr.c:3501
int(* ast_cdrbe)(struct ast_cdr *cdr)
CDR backend callback.
Definition: cdr.h:465
int ast_cdr_backend_unsuspend(const char *name)
Unsuspend a CDR backend.
Definition: cdr.c:2950
ast_cdr_options
CDR manipulation options. Certain function calls will manipulate the state of a CDR object based on t...
Definition: cdr.h:242
@ AST_CDR_FLAG_DISABLE_ALL
Definition: cdr.h:245
@ AST_CDR_LOCK_APP
Definition: cdr.h:250
@ AST_CDR_FLAG_FINALIZE
Definition: cdr.h:247
@ AST_CDR_FLAG_DISABLE
Definition: cdr.h:244
@ AST_CDR_FLAG_PARTY_A
Definition: cdr.h:246
@ AST_CDR_FLAG_KEEP_VARS
Definition: cdr.h:243
@ AST_CDR_FLAG_RESET
Definition: cdr.h:249
@ AST_CDR_FLAG_SET_ANSWER
Definition: cdr.h:248
int ast_cdr_fork(const char *channel_name, struct ast_flags *options)
Fork a CDR.
Definition: cdr.c:3716
int ast_cdr_getvar(const char *channel_name, const char *name, char *value, size_t length)
Retrieve a CDR variable from a channel's current CDR.
Definition: cdr.c:3403
int ast_cdr_unregister(const char *name)
Unregister a CDR handling engine.
Definition: cdr.c:3054
int ast_cdr_serialize_variables(const char *channel_name, struct ast_str **buf, char delim, char sep)
Serializes all the data and variables for a current CDR record.
Definition: cdr.c:3432
const char * ast_cdr_disp2str(int disposition)
Disposition to a string.
Definition: cdr.c:3509
int ast_cdr_register(const char *name, const char *desc, ast_cdrbe be)
Register a CDR handling engine.
Definition: cdr.c:3009
int ast_cdr_backend_suspend(const char *name)
Suspend a CDR backend temporarily.
Definition: cdr.c:2932
struct ast_cdr_config * ast_cdr_get_config(void)
Obtain the current CDR configuration.
Definition: cdr.c:2892
struct ast_cdr * ast_cdr_dup(struct ast_cdr *cdr)
Duplicate a public CDR.
Definition: cdr.c:3064
int ast_cdr_reset(const char *channel_name, int keep_variables)
Reset the detail record.
Definition: cdr.c:3677
int ast_cdr_set_property(const char *channel_name, enum ast_cdr_options option)
Set a property on a CDR for a channel.
Definition: cdr.c:3627
static const char desc[]
Definition: cdr_radius.c:84
static const char config[]
Definition: chan_ooh323.c:111
General Asterisk PBX channel definitions.
#define AST_MAX_ACCOUNT_CODE
Definition: channel.h:172
#define AST_MAX_TENANT_ID
Definition: channel.h:149
#define AST_MAX_UNIQUEID
Definition: channel.h:170
#define AST_MAX_USER_FIELD
Definition: channel.h:176
#define AST_MAX_EXTENSION
Definition: channel.h:134
char * be
Definition: eagi_proxy.c:73
char buf[BUFSIZE]
Definition: eagi_proxy.c:66
static const char name[]
Definition: format_mp3.c:68
struct ast_flags settings
Definition: cdr.h:272
The global options available for CDRs.
Definition: cdr.h:267
struct ast_flags settings
Definition: cdr.h:268
struct ast_cdr_config::batch_settings batch_settings
Responsible for call detail data.
Definition: cdr.h:279
char dstchannel[AST_MAX_EXTENSION]
Definition: cdr.h:291
long int disposition
Definition: cdr.h:307
char lastdata[AST_MAX_EXTENSION]
Definition: cdr.h:295
char linkedid[AST_MAX_UNIQUEID]
Definition: cdr.h:319
char userfield[AST_MAX_USER_FIELD]
Definition: cdr.h:325
char peertenantid[AST_MAX_TENANT_ID]
Definition: cdr.h:323
long int billsec
Definition: cdr.h:305
struct timeval answer
Definition: cdr.h:299
char channel[AST_MAX_EXTENSION]
Definition: cdr.h:289
char peeraccount[AST_MAX_ACCOUNT_CODE]
Definition: cdr.h:313
struct ast_cdr * next
Definition: cdr.h:332
long int duration
Definition: cdr.h:303
long int amaflags
Definition: cdr.h:309
char src[AST_MAX_EXTENSION]
Definition: cdr.h:283
char dst[AST_MAX_EXTENSION]
Definition: cdr.h:285
char clid[AST_MAX_EXTENSION]
Definition: cdr.h:281
char uniqueid[AST_MAX_UNIQUEID]
Definition: cdr.h:317
unsigned int flags
Definition: cdr.h:315
char tenantid[AST_MAX_TENANT_ID]
Definition: cdr.h:321
int sequence
Definition: cdr.h:327
struct timeval start
Definition: cdr.h:297
char accountcode[AST_MAX_ACCOUNT_CODE]
Definition: cdr.h:311
char lastapp[AST_MAX_EXTENSION]
Definition: cdr.h:293
char dcontext[AST_MAX_EXTENSION]
Definition: cdr.h:287
struct timeval end
Definition: cdr.h:301
Structure used to handle boolean flags.
Definition: utils.h:199
Support for dynamic strings.
Definition: strings.h:623
int value
Definition: syslog.c:37
static struct test_options options