Function call to check if conference exists by its "conference" number

I am one piece of logic short of some code to manage multiple conferences. Is there a way to check for the existence of a conference by its conference number? I have seen a way to check to see the number of participants but that will not work in this case - I need to know if it exists in the system. I tried using ${EXTENSION_STATE(${CONF})} but that always returns “UNKNOWN” - I presume because this is not an extension per se but a conference. It seems like a parallel method should exist for conferences but I’m not coming up with anything. Help appreciated.

At the Asterisk CLI do:

*CLI> core show hint 800
[email protected]      : confbridge:800        State:Idle            Presence:not_set         Watchers  0

to get the device name, then use the name provided by that output to do:

exten => s,n,Noop(Conference Status: ${DEVICE_STATE(confbridge:800)})

Asterisk console:

    -- Executing [[email protected]:2] NoOp("SIP/2002-000000bb", "device 800: INUSE") in new stack

You could also start with from asterisk CLI:-

database show CONFERENCE

hence a test for conference NNN’s existence would be in effect

database show CONFERENCE/NNN

and very specifically

database get CONFERENCE NNN/exten

which you can used/tested in a dialplan with asterisk dbget cmd

Thank you for the help. This looks like a good idea. I can certainly use the cli but it’s not clear how in a dialplan to use DBget() or what is now DB(). It asks for an argument in the format “family/key”. I have a conference number 404 but when I try “conference/404” as the data it returns null. In the asterisk db itself (using phpmyadmin), the table “meetme” stores the numbers in a field called “exten” so I tried “conference/exten” but it still returns null. So how do I either obtain data from the database or at least check for the existence of specific data?

Well, asterisk only concerns itself with sqlite3 asteriskdb the family you are using is CONFERENCE the key to test would be (somewhat redundantly) NNN/exten.


exten => x,1,Set(CONFEXISTS=${DB(CONFERENCE/NNN/exten)})
exten => x,n,noop(conference NNN/exten : ${CONFEXISTS})

Thank you both very much. Dicko, your solution dropped right into my code. Have a great weekend.