Hi
After more intensive testing, I narrowed the issue down.
CPE A => Kamailio+dialog => CPE B
CPE A is sending an INVITE with a session timer too smal for CPE B.
CPE B replies with 422.
This causes the dialog module to trigger the 'call failed' event and attempt to delete the dialog data.
CPA A does not consider the call failed. It repeats the INVITE with CSEQ + 1 and with the session timer as desired by CPE B.
The call is then processed as if in dialog, but some, strangely not all, dialog variables are lost.
I fear the repeated invite with identical callID and from_tag causes a race condition in handling the dialog variables.
I see there are two attempts by the dialog module to write a CDR with the same callID. After processing the 422 and when the call ends while processing BYE.