Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RR parameter on sequential requests #425

Merged
merged 3 commits into from
Dec 3, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions modules/dialog/dlg_handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -1398,6 +1398,10 @@ void dlg_onroute(struct sip_msg* req, str *route_params, void *param)

/* within dialog request */
run_dlg_callbacks( DLGCB_REQ_WITHIN, dlg, req, NULL, dir, 0);
if (add_dlg_rr_param( req, dlg->h_entry, dlg->h_id)<0 ) {
LM_ERR("failed to add RR param\n");
goto done;
}

if ( (event!=DLG_EVENT_REQACK) &&
(dlg->cbs.types)&DLGCB_RESPONSE_WITHIN ) {
Expand Down
17 changes: 17 additions & 0 deletions modules/uac/replace.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,7 @@ int restore_uri( struct sip_msg *msg, str *rr_param, str* restore_avp, int check
{
struct lump* l;
str param_val;
str add_to_rr = {0, 0};
struct to_body* old_body;
str old_uri;
str new_uri;
Expand Down Expand Up @@ -540,6 +541,20 @@ int restore_uri( struct sip_msg *msg, str *rr_param, str* restore_avp, int check
goto failed;
}

add_to_rr.s = pkg_malloc(2+rr_param->len+param_val.len);
if ( add_to_rr.s==0 ) {
add_to_rr.len = 0;
LM_ERR("no more pkg mem\n");
goto failed;
}
add_to_rr.len = sprintf(add_to_rr.s, ";%.*s=%.*s", rr_param->len,rr_param->s,param_val.len,param_val.s);

if ( uac_rrb.add_rr_param(msg, &add_to_rr)!=0 ) {
LM_ERR("add_RR_param failed\n");
goto failed;
}
pkg_free(add_to_rr.s);

/* dencrypt parameter ;) */
if (uac_passwd.len)
for( i=0 ; i<new_uri.len ; i++)
Expand Down Expand Up @@ -635,6 +650,8 @@ int restore_uri( struct sip_msg *msg, str *rr_param, str* restore_avp, int check
failed1:
pkg_free(new_uri.s);
failed:
if(add_to_rr.s)
pkg_free(add_to_rr.s);
return -1;
}

Expand Down