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

Function rtpengine_api_copy_offer

modules/rtpengine/rtpengine.c:5270–5291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5268}
5269
5270static int rtpengine_api_copy_offer(struct rtp_relay_session *sess,
5271 struct rtp_relay_server *server, void **_ctx, str *flags,
5272 unsigned int copy_flags, unsigned int streams, str *ret_body,
5273 struct rtp_relay_streams *ret_streams)
5274{
5275 str tmp;
5276 bencode_item_t *ret;
5277 ret = rtpengine_api_copy_op(sess, OP_SUBSCRIBE_REQUEST,
5278 server, *_ctx, flags, copy_flags, NULL);
5279 if (!ret)
5280 return -1;
5281 if (!bencode_dictionary_get_str_dup(ret, "sdp", ret_body))
5282 LM_ERR("failed to extract sdp body from proxy reply\n");
5283 if (ret_streams)
5284 rtpengine_copy_streams(bencode_dictionary_get(ret, "tag-medias"), ret_streams);
5285 if (!bencode_dictionary_get_str(ret, "to-tag", &tmp))
5286 LM_ERR("failed to extract to-tag from proxy reply\n");
5287 else
5288 *_ctx = rtpengine_new_subs(&tmp);
5289 bencode_buffer_free(bencode_item_buffer(ret));
5290 return 0;
5291}
5292
5293static int rtpengine_api_copy_answer(struct rtp_relay_session *sess,
5294 struct rtp_relay_server *server, void *subs, str *flags, str *body)

Callers

nothing calls this directly

Calls 8

rtpengine_api_copy_opFunction · 0.85
rtpengine_copy_streamsFunction · 0.85
bencode_dictionary_getFunction · 0.85
rtpengine_new_subsFunction · 0.85
bencode_buffer_freeFunction · 0.85
bencode_item_bufferFunction · 0.85

Tested by

no test coverage detected