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

Function core2strar

modules/acc/acc.c:139–184  ·  view source on GitHub ↗

returns: * method name * from TAG * to TAG * callid * sip_code * sip_status * */

Source from the content-addressed store, hash-verified

137 * sip_status
138 * */
139static inline int core2strar( struct sip_msg *req, str *c_vals)
140{
141 struct to_body *ft_body;
142 struct hdr_field *from;
143 struct hdr_field *to;
144
145 /* method */
146 c_vals[0] = req->first_line.u.request.method;
147
148 /* from/to URI and TAG */
149 if (req->msg_flags&FL_REQ_UPSTREAM) {
150 LM_DBG("the flag UPSTREAM is set -> swap F/T\n"); \
151 from = acc_env.to;
152 to = req->from;
153 } else {
154 from = req->from;
155 to = acc_env.to;
156 }
157
158 if (from && (ft_body=get_ft_body(from)) && ft_body->tag_value.len) {
159 c_vals[1] = ft_body->tag_value;
160 } else {
161 SET_EMPTY_VAL(1);
162 }
163
164 if (to && (ft_body=get_ft_body(to)) && ft_body->tag_value.len) {
165 c_vals[2] = ft_body->tag_value;
166 } else {
167 SET_EMPTY_VAL(2);
168 }
169
170 /* Callid */
171 if (req->callid && req->callid->body.len)
172 c_vals[3] = req->callid->body;
173 else
174 SET_EMPTY_VAL(3);
175
176 /* SIP code */
177 c_vals[4] = acc_env.code_s;
178
179 c_vals[5] = acc_env.reason;
180
181 acc_env.ts = *get_msg_time(req);
182
183 return ACC_CORE_LEN;
184}
185
186
187/********************************************

Callers 5

acc_log_requestFunction · 0.85
acc_db_requestFunction · 0.85
acc_aaa_requestFunction · 0.85
acc_evi_requestFunction · 0.85
build_core_dlg_valuesFunction · 0.85

Calls 1

get_msg_timeFunction · 0.85

Tested by

no test coverage detected