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

Function IDX

sdp_ops.c:54–73  ·  view source on GitHub ↗

fetch the value of a static/dynamic index */

Source from the content-addressed store, hash-verified

52
53/* fetch the value of a static/dynamic index */
54static inline int IDX(struct sip_msg *msg, struct sdp_pv_idx *idx)
55{
56 pv_value_t val;
57
58 if (!idx->is_pv_idx)
59 return idx->idx;
60
61 if (pv_get_spec_value(msg, &idx->idx_pv, &val) != 0) {
62 LM_ERR("failed to get idx spec value\n");
63 return -1;
64 }
65
66 if (!(val.flags & PV_VAL_INT)) {
67 LM_ERR("SDP idx spec contains non-INT value ('%.*s')\n",
68 val.rs.len, val.rs.s);
69 return -1;
70 }
71
72 return val.ri;
73}
74
75
76/* returns a string representation of the index (useful for debugging) */

Callers 8

sdp_ops_find_lineFunction · 0.85
pv_get_sdp_lineFunction · 0.85
pv_set_sdp_lineFunction · 0.85
pv_get_sdp_streamFunction · 0.85
pv_set_sdp_streamFunction · 0.85
pv_get_sdp_stream_idxFunction · 0.85
pv_get_sdp_sessionFunction · 0.85
pv_set_sdp_sessionFunction · 0.85

Calls 1

pv_get_spec_valueFunction · 0.85

Tested by

no test coverage detected