How to get original channel inside local dialplan

Hi,

Please help me into getting parent channel id into my local channel

for example

[contA]
exten => s,1,Answer()
same => n,NoOp(${CHANNEL}) ; actual—CHANNEL
same => n,Originate(Local/s@chanspy/njb,exten,eagi,s,1)

[eagi]
exten => s,1,Answer()
same => n,NoOp(${CHANNEL})
same => n,NoOp(${actual—CHANNEL})

please help me in that

in this link https://wiki.asterisk.org/wiki/display/AST/Local+Channel+Modifiers
i read about njb WHERE b has the capeblity of holding actual channel but i don’t know how to use it.

Thanks in advance

What Asterisk version are you using? It says that b option was removed in v12.

Hi niksa,

Thanks for the reply i am using asterisk 11.25.1

or in asterisk 15 can i get a any unique value or variable which is common in both actual and local channel

I don’t think b option can help you. It concerns a channel created by the Local channel, and you want the original channel (if I understand correctly). Try Set(__actual-CHANNEL=${CHANNEL}) in contA context and see if you can read it in eagi context. It would work with Dial, I don’t know about Originate.

already tried but its not working

same => n,Originate(Local/s@chanspy/njb,exten,eagi,s,1)

change extension from eagi channel from s to . and access to the channel value using the ${EXTEN} variable on your eagi context

changes i made

same => n,Originate(Local/s@chanspy/njb,exten,eagi,.,1)

[eagi]
exten => .,1,Answer()

but its not working

What ambiorixg12 meant is:

[contA]
same => n,Originate(Local/${CHANNEL}@chanspy/njb,exten,eagi,.,1)

[eagi]
exten => .,1,Answer()
same => n,Set(actual-CHANNEL=${EXTEN})

1 Like

Note that Answer serves no useful purpose on the B side of originate. It is harmless, unlike on the B side of an incoming call, where it can result in the caller being billed for failed calls.

The A side is already up before the B side is started.