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

Function push_new_global_context

context.c:150–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148static unsigned int ctx_stack_idx = 0;
149
150int push_new_global_context(void)
151{
152 if (ctx_stack_idx==CTX_STACK_SIZE) {
153 LM_ERR("too many stacked contexts (%d)\n",ctx_stack_idx);
154 return 0;
155 }
156
157 ctx_stack[ctx_stack_idx++] = current_processing_ctx;
158
159 current_processing_ctx = context_alloc(CONTEXT_GLOBAL);
160 if (!current_processing_ctx) {
161 LM_ERR("oom\n");
162 current_processing_ctx = ctx_stack[--ctx_stack_idx];
163 return 0;
164 }
165
166 memset(current_processing_ctx, 0, context_size(CONTEXT_GLOBAL));
167 return 1;
168}
169
170int pop_pushed_global_context(void)
171{

Callers 2

send_registerFunction · 0.85
term_entityFunction · 0.85

Calls 1

context_allocFunction · 0.85

Tested by

no test coverage detected