Browse code

kazoo : fix routing of reply events

success events should be routed to onreply_route[]
failure events should be routed to failure_route[]

(cherry picked from commit fb2eee3e175040fef5e76cbed11430976f62df32)
(cherry picked from commit d8ff1845c34a7f9d8e6911ae3d2055b122eb3b79)
(cherry picked from commit 4ce1fc01f916a0ee45aff75a18de67f318b14925)

Alan Evans authored on 24/06/2021 10:24:39 • Henning Westerholt committed on 22/10/2021 12:09:30
Showing 1 changed files
... ...
@@ -2440,24 +2440,24 @@ void kz_amqp_fire_connection_event(char *event, char* host, char* zone)
2440 2440
 
2441 2441
 void kz_amqp_cb_ok(kz_amqp_cmd_ptr cmd)
2442 2442
 {
2443
-	int n = route_lookup(&main_rt, cmd->cb_route);
2443
+	int n = route_lookup(&onreply_rt, cmd->cb_route);
2444 2444
 	if(n==-1) {
2445 2445
 		/* route block not found in the configuration file */
2446 2446
 		return;
2447 2447
 	}
2448
-	struct action *a = main_rt.rlist[n];
2448
+	struct action *a = onreply_rt.rlist[n];
2449 2449
 	tmb.t_continue(cmd->t_hash, cmd->t_label, a);
2450 2450
 	ksr_msg_env_reset();
2451 2451
 }
2452 2452
 
2453 2453
 void kz_amqp_cb_error(kz_amqp_cmd_ptr cmd)
2454 2454
 {
2455
-	int n = route_lookup(&main_rt, cmd->err_route);
2455
+	int n = route_lookup(&failure_rt, cmd->err_route);
2456 2456
 	if(n==-1) {
2457 2457
 		/* route block not found in the configuration file */
2458 2458
 		return;
2459 2459
 	}
2460
-	struct action *a = main_rt.rlist[n];
2460
+	struct action *a = failure_rt.rlist[n];
2461 2461
 	tmb.t_continue(cmd->t_hash, cmd->t_label, a);
2462 2462
 	ksr_msg_env_reset();
2463 2463
 }