Browse code

- new configuration option server_id added, this option can be used to discriminate servers within a cluster, to be used by modules like acc_db and usrloc

Jan Janak authored on 14/04/2008 01:46:03
Showing 5 changed files
... ...
@@ -138,6 +138,10 @@ core:
138 138
                between the short name and long name in cache as CNAME record
139 139
 
140 140
 new config variables:
141
+  server_id = number - A configurable unique server id that can be used to
142
+                       discriminate server instances within a cluster of
143
+                       servers when all other information, such as IP adddresses
144
+                       are same.
141 145
   loadpath = <modules path> - directory where to load the modules from (-L
142 146
      equivalent); modules can be loaded simply by specifying their name
143 147
      (loadmodule "maxfwd")
... ...
@@ -343,6 +343,8 @@ STUN_REFRESH_INTERVAL "stun_refresh_interval"
343 343
 STUN_ALLOW_STUN "stun_allow_stun"
344 344
 STUN_ALLOW_FP "stun_allow_fp"
345 345
 
346
+SERVER_ID     "server_id"
347
+
346 348
 CFG_DESCRIPTION		"description"|"descr"|"desc"
347 349
 
348 350
 LOADMODULE	loadmodule
... ...
@@ -652,6 +654,7 @@ EAT_ABLE	[\ \t\b\r]
652 652
 									return PMTU_DISCOVERY; }
653 653
 <INITIAL>{KILL_TIMEOUT}			{	count(); yylval.strval=yytext;
654 654
 									return KILL_TIMEOUT; }
655
+<INITIAL>{SERVER_ID}  { count(); yylval.strval=yytext; return SERVER_ID;}
655 656
 <INITIAL>{CFG_DESCRIPTION}	{ count(); yylval.strval=yytext; return CFG_DESCRIPTION; }
656 657
 <INITIAL>{LOADMODULE}	{ count(); yylval.strval=yytext; return LOADMODULE; }
657 658
 <INITIAL>{LOADPATH}		{ count(); yylval.strval=yytext; return LOADPATH; }
... ...
@@ -386,6 +386,7 @@ static struct socket_id* mk_listen_id(char*, int, int);
386 386
 %token PMTU_DISCOVERY
387 387
 %token KILL_TIMEOUT
388 388
 %token CFG_DESCRIPTION
389
+%token SERVER_ID
389 390
 
390 391
 %token FLAGS_DECL
391 392
 %token AVPFLAGS_DECL
... ...
@@ -1112,6 +1113,7 @@ assign_stm:
1112 1112
 	| STUN_ALLOW_STUN EQUAL error{ yyerror("number expected"); }
1113 1113
 	| STUN_ALLOW_FP EQUAL NUMBER { IF_STUN(stun_allow_fp=$3) ; }
1114 1114
 	| STUN_ALLOW_FP EQUAL error{ yyerror("number expected"); }
1115
+    | SERVER_ID EQUAL NUMBER { server_id=$3; }
1115 1116
 	| cfg_var
1116 1117
 	| error EQUAL { yyerror("unknown config variable"); }
1117 1118
 	;
... ...
@@ -56,6 +56,8 @@ extern char* pid_file;
56 56
 extern char* pgid_file;
57 57
 extern int own_pgid; /* whether or not we have our own pgid (and it's ok to use kill(0, sig) */
58 58
 
59
+extern int server_id; /* A unique ID of the SIP server */
60
+
59 61
 extern struct socket_info* bind_address; /* pointer to the crt. proc.
60 62
 											listening address */
61 63
 extern struct socket_info* sendipv4; /* ipv4 socket to use when msg.
... ...
@@ -339,6 +339,8 @@ int sock_uid= -1;
339 339
 int sock_gid= -1;
340 340
 int sock_mode= S_IRUSR| S_IWUSR| S_IRGRP| S_IWGRP; /* rw-rw---- */
341 341
 
342
+int server_id = 0; /* Configurable unique ID of the server */
343
+
342 344
 /* more config stuff */
343 345
 int disable_core_dump=0; /* by default enabled */
344 346
 int open_files_limit=-1; /* don't touch it by default */