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

Function ospGetFrom

modules/osp/sipheader.c:291–311  ·  view source on GitHub ↗

* Get From header * param msg SIP message * param from From header * param bufsize Size of from header buffer * return 0 success, -1 failure */

Source from the content-addressed store, hash-verified

289 * return 0 success, -1 failure
290 */
291int ospGetFrom(
292 struct sip_msg* msg,
293 char* from,
294 int bufsize)
295{
296 int result = -1;
297
298 if ((from!= NULL) && (bufsize > 0)) {
299 from[0] = '\0';
300 if (msg->from != NULL) {
301 ospCopyStrToBuffer(&msg->from->body, from, bufsize);
302 result = 0;
303 } else {
304 LM_ERR("failed to find From header\n");
305 }
306 } else {
307 LM_ERR("bad parameters to parse From header\n");
308 }
309
310 return result;
311}
312
313/*
314 * Get display name from To header

Callers 1

ospRequestRoutingFunction · 0.85

Calls 1

ospCopyStrToBufferFunction · 0.85

Tested by

no test coverage detected