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

Function rtpproxy_api_offer

modules/rtpproxy/rtpproxy.c:5240–5308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5238}
5239
5240static int rtpproxy_api_offer(struct rtp_relay_session *sess,
5241 struct rtp_relay_server *server, str *body,
5242 str *ip, str *type, str *in_iface, str *out_iface,
5243 str *global_flags, str *flags, str *extra_flags)
5244{
5245 int ret = -1;
5246 int unlock = 0;
5247 pv_value_t val;
5248 struct rtpp_set *rset = NULL;
5249 struct rtpp_args args;
5250 struct sip_msg *msg = NULL;
5251
5252 memset(&args, '\0', sizeof(args));
5253
5254 if (!rtpproxy_fill_call_args(sess, &args, ip, type,
5255 in_iface, out_iface, global_flags, flags, extra_flags, 1))
5256 return -1;
5257
5258 if (!server->node.s) {
5259 if (server->set != -1) {
5260 rset = select_rtpp_set(server->set);
5261 if (!rset) {
5262 LM_WARN("RTPProxy set %d\n not available! Using default %d...\n",
5263 server->set, default_rtpp_set_no);
5264 rset = *default_rtpp_set;
5265 }
5266 } else {
5267 rset = *default_rtpp_set;
5268 }
5269 server->set = rset->id_set;
5270 } else {
5271 if (nh_lock)
5272 lock_start_read(nh_lock);
5273
5274 rset = select_rtpp_set(server->set);
5275 args.node = get_rtpp_node(&server->node, rset);
5276 /* if we're not using a node, we don't need the lock */
5277 if (!args.node && nh_lock)
5278 lock_stop_read(nh_lock);
5279 else
5280 unlock = 1;
5281 }
5282
5283 args.set = rset;
5284 args.offer = 1;
5285 msg = (sess->msg?sess->msg:get_dummy_sip_msg());
5286
5287 val.rs.len = 0;
5288 val.rs.s = "";
5289 val.flags = PV_VAL_STR;
5290 pv_set_value(msg, &media_pvar, (int)EQ_T, &val);
5291
5292 ret = rtpproxy_offer_answer(msg, &args, &media_pvar, NULL, body, NULL);
5293 if (nh_lock && unlock)
5294 lock_stop_read(nh_lock);
5295 if (ret < 0) {
5296 LM_ERR("could not engage rtpproxy offer!\n");
5297 goto exit;

Callers

nothing calls this directly

Calls 11

rtpproxy_fill_call_argsFunction · 0.85
select_rtpp_setFunction · 0.85
get_rtpp_nodeFunction · 0.85
get_dummy_sip_msgFunction · 0.85
pv_set_valueFunction · 0.85
rtpproxy_offer_answerFunction · 0.85
pv_get_spec_valueFunction · 0.85
fill_rtpproxy_nodeFunction · 0.85
is_dummy_sip_msgFunction · 0.85
release_dummy_sip_msgFunction · 0.85
rtpproxy_free_call_argsFunction · 0.85

Tested by

no test coverage detected