I have tried different formats like “PJSIP/+12223334444@asterisk0” and “endpoint:pjsip/+12223334444@asterisk0” however when I use these formats the API just fails silently. I receive a 200/no exceptions from the ARI client and no redirect is issued.
What is the correct format for using the channels.redirect() API to get a properly formatted Refer-To header?
given in the RFC you quote. The examples are not exhaustive. In particular they don’t include domain only URIs, but such are perfectly valid.
What I do remember, when I used it, is that you had to specify what you wanted in the header, without any endpoint/peer name. It looks as though it might now be coping with some endpoint/AOR cases, but you may well have to use a literal URI (with full domain name) in more complex cases. I can’t remember if the scheme had to be present, in the URI.
I do see that the RFC does support the existing format actually. My issue is that when the proxy tries to Refer to the second asterisk the To is populated with the contents of the refer-header, and the other asterisk does not like that there is no user param in the To.
My issue is that I am limited to passing some endpoint via ARI as opposed to using a redirect in AMI/AGI where I saw examples of describing the context, from,to etc.
I never found a solution to this. I used our SIP Proxy to edit the header instead so that the the number was in the Refer-To: Header. I think this is only a limitation of using the ARI redirect functionality as I see other interfaces provided more arguments.