In the dialplan, we are able to add a token to outgoing SIP requests’ RURI?
For instance when we send INVITE to AWS Chime, we have to do something like below:
I don’t know of a way to add to something to the request URI, however, you could add a new header to the SIP Invite (or modify an existing header) by using the PJSIP_HEADER function and a handler to affect the outbound channel.
For example, this would add the header “X-chime-join-token: join-token” to the SIP invite like this:
Maybe there is a way to change the Request URI, but I think it is the R-URI is very dependent on the dialog state of the target peer and simply inserting something could break the routing to the target (as mentioned, I do not know!).
Anyway, request URI generation is covered in RFC 3261 here:
@mlast77 thanks but if you need a separate header, your solution works well, but in this case, we have to put the token into RURI or To, which is not changeable through the PJSIP header func.
I will try the @jcolp solution and update it here.