Unique ID status

Is there any AMI or AGI command that I give UniqueID and its return its channel status or just say that this uniqueID is valid or not (the call exist or not)?

thanks a lot

There is no ast_channel_get_by… function in main/channel.c for unqique ID.

What problem are you trying to solve? You may find that the unique ID isn’t as stable as you assume.

Hi david,

I have Unique ID of a call and I want to know that this call is still exist or not.

Unique IDs don’t identify calls; they identify channels.

You repeated your proposed solution (which is not possible without adding code to main/channel.c), rather than explaining why you want to look up a channel by unique-ID.

Hi david,

I have a database table that contains online calls in my system(contains: channel,unique-id,caller-id,…),
when a new call come to the system I add a new record to this table,
when channel hanged(h extension), I delete the record from online call table.

sometimes (its very rare) that I can’t get hangup (like asterisk restart) and records remain in table.

I want to write a script that checks if channel is not exist in the system, removes it from table(this script run every minute).
I use “Status AMI” to check if channel exist or not.

but today I find out that when system is very busy, its possible that channel name is repeated in one minute.
I know that unique-id never could be repeated in every minute that script checks it.

(sorry for my poor english)

The same unique id can have different channel names during a call.

What technology are you using? Currently supported versions do not have this problem for SIP channels, which I believe are the ones that used to have that problem.

Generally you would track creation and destruction of channels using AMI.

Hi david,
I use SIP technology.
I know that unique id can have different channel names during a call.
but if some function tells me that this unique-id is not valid then I will know that this record in my online table is fake.

I think, if I use “core show channels concise” command it will return all channels unique-id and I can check with this output. is it correct?

Probably, but you would need to check the source code, or try it and the information will be out of date by the time it reaches you.

If unique-id will be unique at least for one minute it will solve my problem even if the data is out of date.