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

Function rtpengine_get_call_flags

modules/rtpengine/rtpengine.c:4996–5036  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4994 } while (0)
4995
4996static str *rtpengine_get_call_flags(struct rtp_relay_session *sess,
4997 str *type, str *in_iface, str *out_iface,
4998 str *global_flags, str *flags, str *extra_flags)
4999{
5000 static str ret;
5001 char *p;
5002 str b;
5003
5004 ret.s = pkg_malloc((sess->callid? (9/* 'call-id= ' */ + sess->callid->len): 0) +
5005 (sess->from_tag? (10/* 'from-tag= ' */ + sess->from_tag->len): 0) +
5006 (sess->to_tag? (8/* 'to-tag= ' */ + sess->to_tag->len): 0) +
5007 (in_iface? (10/* 'in-iface= ' */ + in_iface->len): 0) +
5008 (out_iface? (11/* 'out-iface= ' */ + out_iface->len): 0) +
5009 (type? (1/* ' ' */ + type->len): 0) +
5010 (global_flags? (1/* ' ' */ + global_flags->len): 0) +
5011 (flags? (1/* ' ' */ + flags->len): 0) +
5012 (extra_flags? (1/* ' ' */ + extra_flags->len): 0) +
5013 (sess->branch != RTP_RELAY_ALL_BRANCHES? 20/* 'via-branch-param=br ' */ + INT2STR_MAX_LEN : 0));
5014 if (!ret.s)
5015 return NULL;
5016 p = ret.s;
5017 RTPE_APPEND_STRP("call-id", sess->callid);
5018 RTPE_APPEND_STRP("from-tag", sess->from_tag);
5019 RTPE_APPEND_STRP("to-tag", sess->to_tag);
5020 RTPE_APPEND_STRP("in-iface", in_iface);
5021 RTPE_APPEND_STRP("out-iface", out_iface);
5022 RTPE_APPEND_STR(type);
5023 RTPE_APPEND_STR(global_flags);
5024 RTPE_APPEND_STR(flags);
5025 RTPE_APPEND_STR(extra_flags);
5026 if (sess->branch != RTP_RELAY_ALL_BRANCHES) {
5027 memcpy(p, "via-branch-param=br", 19);
5028 p += 19;
5029
5030 b.s = int2str(sess->branch, &b.len);
5031 memcpy(p, b.s, b.len);
5032 p += b.len;
5033 }
5034 ret.len = p - ret.s;
5035 return &ret;
5036}
5037#undef RTPE_APPEND_STR
5038#undef RTPE_APPEND_STRP
5039

Callers 3

rtpengine_api_offerFunction · 0.85
rtpengine_api_answerFunction · 0.85
rtpengine_api_deleteFunction · 0.85

Calls 1

int2strFunction · 0.85

Tested by

no test coverage detected