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

Function rtpproxy_api_copy_answer

modules/rtpproxy/rtpproxy.c:5957–5995  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5955}
5956
5957static int rtpproxy_api_copy_answer(struct rtp_relay_session *sess,
5958 struct rtp_relay_server *server, void *_ctx, str *flags, str *body)
5959{
5960 int ret = -1;
5961 struct rtpp_args args;
5962 struct rtpp_set *rset = NULL;
5963
5964 memset(&args, '\0', sizeof(args));
5965
5966 if (!rtpproxy_fill_call_args(sess, &args, NULL, NULL,
5967 NULL, NULL, NULL, flags, NULL, 1))
5968 return -1;
5969
5970 if (!server->node.s) {
5971 LM_ERR("no RTPProxy node to use!\n");
5972 return -1;
5973 }
5974
5975 if (nh_lock)
5976 lock_start_read(nh_lock);
5977
5978 rset = select_rtpp_set(server->set);
5979 args.node = get_rtpp_node(&server->node, rset);
5980
5981 if (!args.node)
5982 args.node = select_rtpp_node(sess->msg,
5983 args.callid, rset, NULL, 0);
5984 if (!args.node) {
5985 LM_ERR("no available proxies\n");
5986 goto error;
5987 }
5988
5989 ret = rtpproxy_handle_recording(_ctx, &args, flags, body);
5990error:
5991 if (nh_lock)
5992 lock_stop_read(nh_lock);
5993 rtpproxy_free_call_args(&args);
5994 return ret;
5995}
5996
5997static int rtpproxy_stop_recording_leg(struct rtpproxy_copy_ctx *ctx,
5998 struct rtpp_args *args, str *flags, int leg)

Callers

nothing calls this directly

Calls 6

rtpproxy_fill_call_argsFunction · 0.85
select_rtpp_setFunction · 0.85
get_rtpp_nodeFunction · 0.85
select_rtpp_nodeFunction · 0.85
rtpproxy_free_call_argsFunction · 0.85

Tested by

no test coverage detected