Tracking call between servers


I have seven Asterisk servers connected to each other with trunks, I am interested detect where each call begins, ends and that server passes a call. I’ve attempted using the CDR but I have problems to join the calls, since the uniqueid is generated by each server.

Is there any way you could identify univocally a call whether through one, two or three servers to be drafted?

Every Asterisk is a separate system, so I think it’s impossible to track the call through which server the call passed.

I would tackle the problem in a different way. Modify your call routing so the call can have only one path through the system. That way you will know exactly which path the call took to reach the end phone.

I assume trunks are SIP trunks.
One way is to use userfield of cdr on each system.
Have some unique value on your first server(probably ${UNIQUEID}!) and pass it to next server(s) using SIPAddHeader on trunk. Read the header on next system. Set this unique value in userfield for cdr on each system.

Hope this helps.
–Satish Barot

First Thanks for the replies.

In the case of the proposal given by dejanst, I have the problem that is being created by a process of Postgres. Should change their rules according to the rules of each of the asterisk server.
In the case of the proposal given by satish4asterisk: I’m already using the CDR, and most are SIP trunks (not all). I will investigate how to assign and read the SIPAddHeader value, then I tell them.

Many Thanks for the ideas!

I tried to find the location where you should add code “SIPAddHeader …” within the dial plan code. I’m using the FreePbx I have so much unwanted code. Do you know where in the dial plan must add the lines?

Thank you

We don’t know about the FreePBX dialplan. You may find help on but they may consider it is too far outside the intended usage.