I am using confBridge in my asterisk for conferencing. I want to detect if number of user remain less than or equal to 1 in ongoing call then terminate the conference call.
I have tried this-
exten => ConfTest,1,System(asterisk -rx "confbridge kick ${DB(CONF/NUM)} ${DB(CONF/ConfTest)}")
exten => ConfTest,n,Set(DB(CONF/ConfTest)=${CHANNEL})
exten => ConfTest,n,Set(ID=${RAND(1,500)})
exten => ConfTest,n,Set(DB(CONF/NUM)=${ID})
exten => ConfTest,n,Set(target=ConfTest1)
exten => ConfTest,n,Originate(SIP/${target},app,confBridge,${ID},default_user)
exten => ConfTest,n,Set(target=ConfTest2)
exten => ConfTest,n,Originate(SIP/${target},app,confBridge,${ID},default_user)
exten => ConfTest,n,Macro(dialout-trunk-predial-hook-test)
exten => ConfTest,n,confbridge(${ID},,src_user)
exten => ConfTest,n,Answer()
exten => ConfTest,n,Set(i=1)
exten => ConfTest,n,While($[${i} = 1])
exten => ConfTest,n,GoToIf($[0${CONFBRIDGE_INFO(parties,${ID})} <= 1]?18:15)
exten => ConfTest,n,NoOp(number of participants in conference call = ${CONFBRIDGE_INFO(parties,${ID})})
exten => ConfTest,n,Wait(1000)
exten => ConfTest,n,EndWhile()
exten => ConfTest,n,System(asterisk -rx "confbridge kick ${DB(CONF/NUM)} ${DB(CONF/ConfTest))
here lines are not executing from while loop.
Is there any thing available to register hangup handler for all the channel involve in conference call. For example-
debianpc08*CLI> confbridge list 1
Channel User Profile Bridge Profile Menu CallerID
============================= ================ ================ ================ ================
SIP/ConfTest1-0000009c default_user default_bridge ConfTest1
SIP/ConfTest2-0000009d default_user default_bridge ConfTest2
SIP/ConfTest3-0000009b src_user default_bridge ConfTest3
here i want to register hangup handler for all the channels like SIP/ConfTest1-0000009c.
You can use default hangup handler(h-extension) to catch that