Module: kamailio
Branch: master
Commit: 6ca77883afc5cb91e20fc71252ed10de519a9549
URL:
https://github.com/kamailio/kamailio/commit/6ca77883afc5cb91e20fc71252ed10d…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-05-16T19:42:50+02:00
core: allow setting server id via --server-id command line param
---
Modified: src/main.c
---
Diff:
https://github.com/kamailio/kamailio/commit/6ca77883afc5cb91e20fc71252ed10d…
Patch:
https://github.com/kamailio/kamailio/commit/6ca77883afc5cb91e20fc71252ed10d…
---
diff --git a/src/main.c b/src/main.c
index 959602ebb3..95a7c9e001 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 '?':