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

Function b2b_msg_get_from

modules/b2b_logic/logic.c:267–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265}
266
267int b2b_msg_get_from(struct sip_msg* msg, str* from_uri, str* from_dname)
268{
269 struct to_body *pfrom;
270
271 pfrom = get_b2bl_from(msg);
272 if (pfrom)
273 {
274 *from_uri = pfrom->uri;
275 *from_dname = pfrom->display;
276 return 0;
277 }
278
279 /* examine the from header */
280 if (!msg || !msg->from || !msg->from->body.s)
281 {
282 LM_ERR("cannot find 'from' header!\n");
283 return -1;
284 }
285 if (msg->from->parsed == NULL)
286 {
287 if ( parse_from_header( msg )<0 )
288 {
289 LM_ERR("cannot parse From header\n");
290 return -1;
291 }
292 }
293 pfrom = (struct to_body*)msg->from->parsed;
294 *from_uri = pfrom->uri;
295 *from_dname = pfrom->display;
296
297 return 0;
298}
299
300int b2b_msg_get_maxfwd(struct sip_msg *msg)
301{

Callers 3

b2bl_bridge_msgFunction · 0.85

Calls 2

get_b2bl_fromFunction · 0.85
parse_from_headerFunction · 0.85

Tested by

no test coverage detected