[OpenSIPS-Users] uac_replace_to on failure routes

John Komara john.komara at mongoosemetrics.com
Wed Sep 10 16:38:40 CEST 2014

That worked. I appreciate the response.

Before each attempt to complete the call to a destination in the
dispatcher list I called t_on_branch(), replaced the IP in the To: field
with uac_replace_to(), then popped back into the request route or failure

Thank you,


On 9/9/14, 3:35 AM, "Kristian F. Høgh" <kfh.opensips at kfh.dk> wrote:

>Hi John,
>You should call uac_replace_to() from branch route.
>use t_on_branch() on (initial) INVITE in request- and failure route
>From http://www.opensips.org/html/docs/modules/1.11.x/uac.html#id293640
>IMPORTANT: calling the function more than once per branch will lead to
>inconsistent changes over the request.
>Be sure you do the change only ONCE per branch.
>Note that calling the function from REQUEST ROUTE affects all the
>branches!, so 
>no other change will be possible in the future.
>For per branch changes use BRANCH and FAILURE route.
>Kristian Høgh.
>On Monday 08 September 2014 20:30:53 John Komara wrote:
>> I have a requirement where I need to replace the To field. I am using
>> uac_replace_to(); to do this. It works great. I am using the dispatcher
>> module. I am using t_on_failure(); to try the next destination in the
>> group. It hits a failure_route that then sends it to the "next_dest"
>> There I am calling ds_next_dst(); to pick the next destination in the
>> group. After the destination has been selected I called
>> again. This is where I run into my problem.
>> The To: field now has both the first and second destination in the To:
>> field. (i.e. sip:5555555555 at at I
>> see that when uac_replace_to(); is called for the second time (in the
>> "next_dest" route) that it is trying to store the vst parameter in the
>> dialog:
>> DBG:dispatcher:ds_next_dst: using [sip:]
>> DBG:dispatcher:ds_next_dst: using [sip:]
>> DBG:uac:replace_uri: uri to replace [sip:5555555555 at]
>> DBG:uac:replace_uri: replacement uri is [sip:5555555555 at]
>> DBG:dialog:new_dlg_val: inserting <vst>=<sip:5555555555 at>
>> DBG:uac:replace_uri: stored <vst> param in dialog
>> DBG:dialog:new_dlg_val: inserting <739824>=<sip:5555555555 at>
>> I need the To: field to be updated on each failure with the new
>> I tried calling record_route(); after each uac_replace_to(); call as
>> This resulted in an additional rr added to the header with no vst
>>field. I
>> am not sure where to go from here. Am I approaching this the right way?
>> there a better way to do this?
>> Link to config: http://pastebin.com/UgzgqeF8
>> Thanks in advance,
>> John
>Users mailing list
>Users at lists.opensips.org

More information about the Users mailing list