Hi,
We are using asterisk 20.x. Please help us to understand the below points,
Can we use the value of Call-Id (which is available in SIP communications ) to uniquely identify a particular call session. If yes, how can we get this Call-Id as well from AMI Events? Any additional details need to be configured in dialplan or other configuration files ?
The scenario was, we are using asterisk to get real time audio streams of both caller and callee. Then this realtime audio streams will be sent to an external service or system to generate the corresponding transcripts. There may be a set of other call sessions happening in parallel. So we are trying to identify from which call session, a particular audio streams are getting generated. So that external service can put the corresponding real time transcripts in the same bucket (for a particular call session).
If we use the extension number/caller phone number as the key for keeping the transcripts, then there is a chance to get these transcripts added to a wrong bucket ( in the case of the same caller and callee are making the call at the second time or third time).
So, to uniquely identify each call session, which field or property can be used as a “session Id”.
Asterisk provides a channel uniqueid, which is internally how it uniquely identifies things. You could get the SIP Call-ID as you’ve mentioned. It’s up to you.
AMI provides the Getvar action[1] to get a dialplan variable or function. This could be used to the get Call-ID using CHANNEL[2]. Or an event emitted in the dialplan using UserEvent[3] with it. If you have not spent time looking through the AMI actions, dialplan functions, and applications it is highly advantageous to do so - as many things exist and can be put together.