I defined a gosub(same with AGI too) in a Queue to find BRIDGEPEER on a connected Queue call but as you see it is empty.
it seem Asterisk fire Gosub,AGI before assigning BRIDGEPEER value?
if there any way to find BRIDGEPEER (member) for a channel ?


exten => 10,n,Queue(test,sh)
exten => s,1,NoOp(${BRIDGEPEER})

CLI output:
– Called 105
– SIP/105-00000007 is ringing
– Local/105@Test-d600;1 is ringing
– SIP/105-00000007 answered Local/105@Test-d600;2
– Local/105@Test-d600;1 answered SIP/104-00000006
– Stopped music on hold on SIP/104-00000006
– Executing [s@sh:1] NoOp(“Local/105@Test-d600;1”, “”) in new stack
– Auto fallthrough, channel ‘Local/105@Test-d600;1’ status is ‘UNKNOWN’
– Locally bridging SIP/104-00000006 and SIP/105-00000007

BRIDGEPEER is set by the code that does the bridging, which is not part of the queue module. It doesn’t look like it would be difficult to modify the code - cut and past coding techniques should be fairly safe.

Thanks for your reply.
I am trying to catch member channel here and it is amazing for me why agi and gosub doing different in Queue.
Here you can result of CHANNEL function in one Queue :
– Executing [s@sh:1] NoOp(“SIP/103-00000027”, “[color=#00BF00]SIP/103-00000027[/color]”) in new stack
agi-queue.agi: [color=#FF0000]SIP/104-00000025[/color]

as you see one one them showing caller(AGI) and one of them showing callee(gosub) channel !!!