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

Function rtpengine_stopmedia_f

modules/rtpengine/rtpengine.c:4702–4728  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4700}
4701
4702static int rtpengine_stopmedia_f(struct sip_msg* msg, str *flags,
4703 pv_spec_t *spvar, pv_spec_t *last_frame_pos)
4704{
4705 bencode_buffer_t bencbuf;
4706 bencode_item_t *dict;
4707 pv_value_t val;
4708
4709 if (set_rtpengine_set_from_avp(msg) == -1)
4710 return -1;
4711
4712 dict = rtpe_function_call_ok(&bencbuf, msg, OP_STOP_MEDIA, flags,
4713 NULL, spvar, NULL, NULL, NULL);
4714 if (!dict) {
4715 LM_ERR("could not stop media!\n");
4716 return -1;
4717 }
4718
4719 if (last_frame_pos) {
4720 memset(&val, 0, sizeof(pv_value_t));
4721 val.flags = PV_TYPE_INT|PV_VAL_INT;
4722 val.ri = bencode_dictionary_get_integer(dict, "last-frame-pos", -1);
4723 if (pv_set_value(msg, last_frame_pos, 0, &val) != 0)
4724 LM_ERR("failed to set last-frame-pos after stopping media!\n");
4725 }
4726 bencode_buffer_free(&bencbuf);
4727 return 1;
4728}
4729
4730static int rtpengine_blockmedia_f(struct sip_msg* msg, str *flags, pv_spec_t *spvar)
4731{

Callers

nothing calls this directly

Calls 5

rtpe_function_call_okFunction · 0.85
pv_set_valueFunction · 0.85
bencode_buffer_freeFunction · 0.85

Tested by

no test coverage detected