diff --git a/src/main.c b/src/main.c index 959602ebb37..95a7c9e0017 100644 --- a/src/main.c +++ b/src/main.c @@ -204,7 +204,8 @@ Options:\n\ #ifdef STATS " -s file File where to write internal statistics on SIGUSR1\n" #endif -" --subst=exp set a subst preprocessor directive\n\ +" --server-id=num set the value for server_id\n\ + --subst=exp set a subst preprocessor directive\n\ --substdef=exp set a substdef preprocessor directive\n\ --substdefs=exp set a substdefs preprocessor directive\n" #ifdef USE_SCTP @@ -1906,6 +1907,7 @@ int main(int argc, char** argv) {"subst", required_argument, 0, KARGOPTVAL + 1}, {"substdef", required_argument, 0, KARGOPTVAL + 2}, {"substdefs", required_argument, 0, KARGOPTVAL + 3}, + {"server-id", required_argument, 0, KARGOPTVAL + 4}, {0, 0, 0, 0 } }; @@ -2157,6 +2159,13 @@ int main(int argc, char** argv) goto error; } break; + case KARGOPTVAL+4: + server_id=(int)strtol(optarg, &tmp, 10); + if ((tmp==0) || (*tmp)){ + LM_ERR("bad server_id value: %s\n", optarg); + goto error; + } + break; /* special cases */ case '?':