| 128 | |
| 129 | |
| 130 | int ensure_global_context(void) |
| 131 | { |
| 132 | if (current_processing_ctx) |
| 133 | return 0; |
| 134 | |
| 135 | current_processing_ctx = context_alloc(CONTEXT_GLOBAL); |
| 136 | if (!current_processing_ctx) { |
| 137 | LM_ERR("oom\n"); |
| 138 | return -1; |
| 139 | } |
| 140 | |
| 141 | memset(current_processing_ctx, 0, context_size(CONTEXT_GLOBAL)); |
| 142 | return 0; |
| 143 | } |
| 144 | |
| 145 | |
| 146 | #define CTX_STACK_SIZE 8 |