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

Function rtpe_function_call_simple

modules/rtpengine/rtpengine.c:3053–3087  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3051
3052
3053static int rtpe_function_call_simple(struct sip_msg *msg, enum rtpe_operation op,
3054 str *flags_str, struct rtpe_set *set, str *node, pv_spec_t *spvar)
3055{
3056 bencode_buffer_t bencbuf;
3057 struct rtpe_ctx *ctx;
3058 bencode_item_t *ret;
3059
3060 if (set_rtpengine_set_from_avp(msg) == -1)
3061 return -1;
3062
3063 ret = rtpe_function_call(&bencbuf, msg, op, flags_str, NULL, spvar, set, node, NULL);
3064 if (!ret)
3065 return -1;
3066
3067 if (op == OP_DELETE && rtpengine_stats_used) {
3068 /* if statistics are to be used, store stats in the ctx, if possible */
3069 if ((ctx = rtpe_ctx_get())) {
3070 if (ctx->stats)
3071 rtpe_stats_free(ctx->stats); /* release the buffer */
3072 else
3073 ctx->stats = pkg_malloc(sizeof *ctx->stats);
3074 if (ctx->stats) {
3075 ctx->stats->buf = bencbuf;
3076 ctx->stats->dict = ret;
3077 ctx->stats->json.s = 0;
3078 /* return here to prevent buffer from being freed */
3079 return 1;
3080 } else
3081 LM_WARN("no more pkg memory - cannot cache stats!\n");
3082 }
3083 }
3084
3085 bencode_buffer_free(&bencbuf);
3086 return 1;
3087}
3088
3089static bencode_item_t *rtpe_function_call_ok(bencode_buffer_t *bencbuf, struct sip_msg *msg,
3090 enum rtpe_operation op, str *flags_str, str *body, pv_spec_t *spvar,

Callers 10

rtpengine_deleteFunction · 0.85
start_recording_fFunction · 0.85
stop_recording_fFunction · 0.85
pause_recording_fFunction · 0.85
rtpengine_blockmedia_fFunction · 0.85
rtpengine_unblockmedia_fFunction · 0.85
rtpengine_blockdtmf_fFunction · 0.85
rtpengine_unblockdtmf_fFunction · 0.85
rtpengine_stop_forward_fFunction · 0.85

Calls 5

rtpe_function_callFunction · 0.85
rtpe_ctx_getFunction · 0.85
rtpe_stats_freeFunction · 0.85
bencode_buffer_freeFunction · 0.85

Tested by

no test coverage detected