Get Call Unique ID in real time?

Does anyone know if it’s possible to get the UID of a call in real time?

I know you get fetch the UID from the CDR GraphQL API but that doesn’t populate until after both parties hang up.

Does the sangoma CRM API, or the Rest API give the UID in real time? (I don’t have experience in AMI or the asterisk API but if this would work please let me know)

I’m wanting to do a URL request when an incoming call comes in that will log the UID for use in our own database. I need the UID at the beginning of the call not once everyone has hung up.

Any thoughts on how to get this?

The channel’s uniqueid is generated when the channel is created. You can pull the variable ${UNIQUEID} via the AMI GetVar action as long as you know the channel name.

If you have a listener for AMI events, the uniqueid is passed in all the events.