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

Function w_rtpproxy_stop_recording

modules/rtpproxy/rtpproxy.c:4928–4965  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4926}
4927
4928static int w_rtpproxy_stop_recording(struct sip_msg *msg, str *callid,
4929 str *from_tag, str *to_tag, struct rtpp_node *node,
4930 pv_spec_p var, int medianum)
4931{
4932 struct rtpproxy_vcmd vstrec;
4933 RTPP_VCMD_INIT(vstrec, 10,
4934 {"N ", 2}, /*.vu[0] command R or C */
4935 {NULL, 0}, /*.vu[1] callid */
4936 {" ", 1}, /*.vu[2] separator */
4937 {NULL, 0}, /*.vu[3] from_tag */
4938 {";", 1}, /*.vu[4] medianum separator */
4939 {NULL, 0}, /*.vu[5] medianum */
4940 {" ", 1}, /*.vu[6] separator */
4941 {NULL, 0}, /*.vu[7] to_tag */
4942 {";", 1}, /*.vu[8] medianum separator */
4943 {NULL, 0} /*.vu[9] medianum */
4944 );
4945
4946 /* check if we support recording */
4947 if (!HAS_CAP(node, RECORD)) {
4948 LM_ERR("RTPProxy does not support recording!\n");
4949 goto error;
4950 }
4951
4952 STR2IOVEC(*callid, vstrec.vu[1]);
4953 STR2IOVEC(*from_tag, vstrec.vu[3]);
4954 if (to_tag)
4955 STR2IOVEC(*to_tag, vstrec.vu[7]);
4956
4957 vstrec.vu[5].iov_base = int2str(medianum, (int *)&vstrec.vu[5].iov_len);
4958 memcpy(&vstrec.vu[9], &vstrec.vu[5], sizeof *vstrec.vu);
4959 send_rtpp_command(node, &vstrec, vstrec.useritems);
4960
4961 return 1;
4962
4963error:
4964 return -1;
4965}
4966
4967static int rtpproxy_api_recording(str *callid, str *from_tag,
4968 str *to_tag, str *node, str *flags, str *destination, int medianum)

Callers 3

Calls 2

int2strFunction · 0.85
send_rtpp_commandFunction · 0.85

Tested by

no test coverage detected