Browse code

kazoo : fix routing of reply events

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

Alan Evans authored on 24/06/2021 10:24:39
Showing 1 changed files
... ...
@@ -2498,24 +2498,24 @@ void kz_amqp_fire_connection_event(char *event, char* host, char* zone)
2498 2498
 
2499 2499
 void kz_amqp_cb_ok(kz_amqp_cmd_ptr cmd)
2500 2500
 {
2501
-	int n = route_lookup(&main_rt, cmd->cb_route);
2501
+	int n = route_lookup(&onreply_rt, cmd->cb_route);
2502 2502
 	if(n==-1) {
2503 2503
 		/* route block not found in the configuration file */
2504 2504
 		return;
2505 2505
 	}
2506
-	struct action *a = main_rt.rlist[n];
2506
+	struct action *a = onreply_rt.rlist[n];
2507 2507
 	tmb.t_continue(cmd->t_hash, cmd->t_label, a);
2508 2508
 	ksr_msg_env_reset();
2509 2509
 }
2510 2510
 
2511 2511
 void kz_amqp_cb_error(kz_amqp_cmd_ptr cmd)
2512 2512
 {
2513
-	int n = route_lookup(&main_rt, cmd->err_route);
2513
+	int n = route_lookup(&failure_rt, cmd->err_route);
2514 2514
 	if(n==-1) {
2515 2515
 		/* route block not found in the configuration file */
2516 2516
 		return;
2517 2517
 	}
2518
-	struct action *a = main_rt.rlist[n];
2518
+	struct action *a = failure_rt.rlist[n];
2519 2519
 	tmb.t_continue(cmd->t_hash, cmd->t_label, a);
2520 2520
 	ksr_msg_env_reset();
2521 2521
 }