MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / mod_init

Function mod_init

modules/jsonrpc/jsonrpc.c:116–141  ·  view source on GitHub ↗

* init module function */

Source from the content-addressed store, hash-verified

114 * init module function
115 */
116static int mod_init(void)
117{
118 LM_NOTICE("initializing JSON-RPC module ...\n");
119
120 if (jrpc_connect_timeout <= 0) {
121 LM_ERR("invalid value for connect timeout (%d)! "
122 "Please specify a positive value in milliseconds!\n", jrpc_connect_timeout);
123 return -1;
124 }
125
126 if (jrpc_write_timeout <= 0) {
127 LM_ERR("invalid value for write timeout (%d)! "
128 "Please specify a positive value in milliseconds!\n", jrpc_write_timeout);
129 return -1;
130 }
131
132 if (jrpc_read_timeout <= 0) {
133 LM_ERR("invalid value for read timeout (%d)! "
134 "Please specify a positive value in milliseconds!\n", jrpc_read_timeout);
135 return -1;
136 }
137
138 jsonrpc_id_index = my_pid() & USHRT_MAX;
139 jsonrpc_id_index |= rand() << sizeof(unsigned short);
140 return 0;
141}
142
143static union sockaddr_union *jsonrpc_get_dst(str *ip_port)
144{

Callers

nothing calls this directly

Calls 1

my_pidFunction · 0.85

Tested by

no test coverage detected