Skip to content

Commit

Permalink
[async] fix setting restoring type route after running report route f…
Browse files Browse the repository at this point in the history
…or launch()

Fixes #3034

(cherry picked from commit c0af4fe)
  • Loading branch information
bogdan-iancu committed Mar 17, 2023
1 parent 89d03ea commit 444f026
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions async.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ int async_launch_resume(int fd, void *param)
{
struct sip_msg *req;
async_launch_ctx *ctx = (async_launch_ctx *)param;
int bk_rt;

LM_DBG("resume for a launch job\n");

Expand Down Expand Up @@ -222,9 +223,10 @@ int async_launch_resume(int fd, void *param)

if (ctx->report_route!=-1) {
LM_DBG("runinng report route for a launch job\n");
set_route_type( REQUEST_ROUTE );
swap_route_type( bk_rt, REQUEST_ROUTE);
run_top_route( sroutes->request[ctx->report_route], req);

set_route_type( bk_rt );
/* remove all added AVP */
reset_avps( );
}
Expand All @@ -248,6 +250,7 @@ int async_script_launch(struct sip_msg *msg, struct action* a,
struct usr_avp *report_avps = NULL, **bak_avps = NULL;
async_launch_ctx *ctx;
int fd;
int bk_rt;

/* run the function (the action) and get back from it the FD,
* resume function and param */
Expand Down Expand Up @@ -335,11 +338,12 @@ int async_script_launch(struct sip_msg *msg, struct action* a,
return -1;
}

set_route_type( REQUEST_ROUTE );
bak_avps = set_avp_list(&report_avps);
swap_route_type( bk_rt, REQUEST_ROUTE);

run_top_route( sroutes->request[report_route], req);

set_route_type( bk_rt );
destroy_avp_list(&report_avps);
set_avp_list(bak_avps);

Expand Down

0 comments on commit 444f026

Please sign in to comment.