ARI - Get Call-Id on Dialed Channel

Hello, I hope all of you are having a nice day.

I have a quick question. Is there a way to get the SIP call-Id generated by Asterisk when I dial a channel in ARI?

So far I have been unable to get it.

Have you tried get variable on the channel function?

You will need to use chan_pjsip, but you should already be doing that.

Yes, I try using the following as parameter:

PJSIP_HEADER(read,Call-ID)

But get the error: Unable to read provided function.

(I can get the Call-ID of an inbound call in this way, but not for outbound calls)

Should that work? If it is the case, I will try to see if there is not some other problem. I am calling that function after the channel is already in the Stasis Application.

That is the PJSIP_HEADER dialplan function, not the CHANNEL dialplan function. As linked the CHANNEL dialplan function can get it no matter if it is inbound or outbound.

Understood, thank you very much!