> For the complete documentation index, see [llms.txt](https://prosbcdocs.telcobridges.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://prosbcdocs.telcobridges.com/telecom-references/telecom-concepts/incoherent-cdr-during-switchover.md).

# Incoherent CDR during switchover

It is worth noting that some CDR records can be lost during transition from active to standby following a system fault. Consequently, a CDR analysis script must handle few "corner" cases:

### A "Start" CDR entry without corresponding "End" entry

This happens if a call was terminated during the switchover period.

\==> In that case, billing the call is not possible, the "End" CDR information was lost.

### A "End" CDR entry without corresponding "Start" entry

This happens if a call was answered just before the HA switchover occurred, and the CDR entry was not yet flushed to disk.

\==> In that case, billing can still be done using the "End" entry's "end time" versus "connected time" (unless connected time is 0, meaning the call was never answered)

### A call with two "End" CDR entries

This case may happen after some partial HA switchover of the Toolpack system:

* The CDR generating application (Gateway) remains alive, but looses it's connection with toolpack\_engine
* After a timeout, it destroys it's call contexts, and thus writes CDR "End" entries.
* Later, connection with toolpack\_engine is re-established, and some calls were still valid and connected
* The Gateway application re-synchronizes with these calls. These call continue normally until they're hung-up
* When hung-up, another "End" CDR entry is written

\==> In that case, billing can be done by using the "end time" of the second CDR entry, minus the "connected time" of the first CDR entry.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://prosbcdocs.telcobridges.com/telecom-references/telecom-concepts/incoherent-cdr-during-switchover.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
