Skip to content

Commit

Permalink
Proper stack of the AVP list when running the dialog specific routes
Browse files Browse the repository at this point in the history
Fixes #2464
Credits go to Ben Newlin for reporting and assisting with the fixing.

(cherry picked from commit 7193c5d)
  • Loading branch information
bogdan-iancu committed Nov 15, 2021
1 parent 6284500 commit 7b01449
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions modules/dialog/dlg_handlers.c
Expand Up @@ -122,6 +122,8 @@ int run_dlg_script_route(struct dlg_cell *dlg, int rt_idx)
static struct sip_msg* fake_msg= NULL;
context_p old_ctx, *new_ctx;
int old_route_type;
struct usr_avp **old_avps;
struct usr_avp *local_avps = NULL;

/************* pre-run sequance ****************/

Expand All @@ -130,6 +132,8 @@ int run_dlg_script_route(struct dlg_cell *dlg, int rt_idx)
return -1;
}

old_avps = set_avp_list( &local_avps );

swap_route_type(old_route_type, REQUEST_ROUTE);

/************* actual run sequance ****************/
Expand All @@ -147,8 +151,9 @@ int run_dlg_script_route(struct dlg_cell *dlg, int rt_idx)
context_destroy(CONTEXT_GLOBAL, *new_ctx);
current_processing_ctx = old_ctx;

/* remove all added AVP - here we use all the time the default AVP list */
reset_avps( );
/* remove all added AVP and restore the original list */
set_avp_list( old_avps );
destroy_avp_list( &local_avps );

return 0;
}
Expand Down

0 comments on commit 7b01449

Please sign in to comment.