Browse Source

core: exit() is now equivalent to exit 1

exit or exit() no longer drop messages by default. They now end
the script with return==1 (instead of 0).
Note that exit 0 is equivalent with DROP in non-kamailio mode and
in most routes, but this kind of usage is deprecated (use drop
instead of exit 0).
Andrei Pelinescu-Onciul 15 years ago
parent
commit
9954a52e8f
1 changed files with 4 additions and 2 deletions
  1. 4 2
      cfg.y

+ 4 - 2
cfg.y

@@ -3239,7 +3239,8 @@ ret_cmd:
 						(void*)(DROP_R_F|EXIT_R_F)); set_cfg_pos($$);
 	}
 	| EXIT LPAREN RPAREN		{
-		$$=mk_action(DROP_T, 2, NUMBER_ST, 0, NUMBER_ST, (void*)EXIT_R_F);
+		$$=mk_action(DROP_T, 2, NUMBER_ST, (void*)1, NUMBER_ST,
+						(void*)EXIT_R_F);
 		set_cfg_pos($$);
 	}
 	| EXIT rval_expr	{
@@ -3247,7 +3248,8 @@ ret_cmd:
 		set_cfg_pos($$);
 	}
 	| EXIT				{
-		$$=mk_action(DROP_T, 2, NUMBER_ST, 0, NUMBER_ST, (void*)EXIT_R_F);
+		$$=mk_action(DROP_T, 2, NUMBER_ST, (void*)1, NUMBER_ST,
+						(void*)EXIT_R_F);
 		set_cfg_pos($$);
 	}
 	| RETURN			{