Variable of one channel to other channel

Hi,

I am forwarding my request through originate command to other other and want to see the uniqueid of first channel…is it possible?

What is the first channel in this context?

[ibcontext]
exten =>66564875,1,Answer()
same => n,NoOp(${UNIQUEID})
same => n,Set(callid=113)
same => n,Set(__ncallid=113)
same => n,SIPAddHeader(X-ORIG-CALLID: ${UNIQUEID})
same => n,Set(SHARED(newcallid)=114)
same => n,Originate(Local/s@chanspy/njb,exten,eagi,s,1,${callid})

[eagi]
exten => s,1,Answer()
exten => s,n,NoOp( in eagi channel )
exten => s,n,NoOp(${SIP_HEADER(X-ORIG-CALLID)})
exten => s,n,NoOp(${SHARED(newcallid)})
exten => s,n,NoOp(${CALLERID})
exten => s,n,NoOp(${CONNECTEDLINE(num)})
exten => s,n,NoOp(${${ARG1}})
exten => s,n,NoOp(${callId})
exten => s,n,NoOp(${__ncallid})
exten => s,n,NoOp(${UNIQUEID})
exten => s,n,EAGI(speechToTextAgi.agi,1022)

Above are the code I take call under ibcontext then printing uniqueid and want to use that uniqueid in other context [eagi]…I tried with all the possible ways i think but no luck worked

Why don’t you just pass it by making it the extension that is dialed?

you me instead calling [eagi] just call the code of [eagi] under [ibcontext]

I meant use exten => _.,1,Answer() and send the call to an extension of ${UNIQUEID}, the result being that ${EXTEN} would contain the uniqueid in the eagi context. You would need to do some more work though - like come up with a more specific pattern match so ‘h’ doesn’t match.

so through this I would be able to get the same uniqueid in other context?

It would be passed to the originated Local channel.

I have to use originate function only because I am doing something wherein will pass first channel info to other scrip which will be running parallely to listen coustomer voice at every moment.

hence I have to send this request through originate function only