Is the SHARED function right for me?

So I need to be able to make sure a caller id is not already in use. On the IRC I was directed to the SHARED function. Good start but I can not seem to wrap my head around this. It seems that if I set a SHARED var to the caller id and then in another channel look back to see if it is set, that is what I am looking for.

From the docs it seems that that SHARED name space will just be overwritten buy the next channel that come along and writes to it.

So can someone help me understand the best way to do this?

Thanks!!