I’m trying to perform a remote SIP transfer using PJSIP ari.channel().redirect. According to the documentation, in order to perform the transfer, 3 things are needed from the originating call:
Call-ID
from-tag
to-tag
Using CHANNEL(pjsip,call-id) it is possible to get the call ID; however, I don’t seem to be able to obtain the from and to tags on the outbound channel.
The question is: how does one obtain the from and to tags on the outbound channel after a call has been established?
Background on the project:
Alice calls IVR
Alice selects option that requires an outbound call
The outbound call is placed to Bob
Bob receives a pre-recorded announcement based on IVR selection
Alice is connected to Bob without joining a bridge. <=== This is where the redirect is needed.
We are going to need to fetch the from and to tags on the outbound channel after the call is established. From what you said this does not exist today. Can you provide a bit of guidance on the best way to implement this? We are going to need to implement this in Asterisk. Any help/guidance is appreciated!
If you have specific questions then someone may be able to answer them on the asterisk-dev mailing list or IRC channel, otherwise stuff is contained and split up in PJSIP so you’d need to define exactly what you want/need to do, find the appropriate location, and go from there.
I finally found the way to get the tags. We were able to leverage the ARI using this rest endpoint /channels/{channelId}/variable by passing in the channel id and the variable CHANNEL(pjsip,local_tag) to get the “From tag” and CHANNEL(pjsip,remote_tag) to get the “To tag”. It appears that these 2 types for PJSIP are not mentioned in the docs. I hope helps someone!
@jcolp I do appreciate your quick and friendly responses on this issue! Keep fighting the good fight!