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

Function ospGetCallId

modules/osp/sipheader.c:1226–1246  ·  view source on GitHub ↗

* Get Call-ID header from SIP message * param msg SIP message * param callid Call ID * return 0 success, -1 failure */

Source from the content-addressed store, hash-verified

1224 * return 0 success, -1 failure
1225 */
1226int ospGetCallId(
1227 struct sip_msg* msg,
1228 OSPT_CALL_ID** callid)
1229{
1230 struct hdr_field* hf;
1231 int result = -1;
1232
1233 hf = (struct hdr_field*)msg->callid;
1234 if (hf != NULL) {
1235 *callid = OSPPCallIdNew(hf->body.len, (unsigned char*)hf->body.s);
1236 if (*callid) {
1237 result = 0;
1238 } else {
1239 LM_ERR("failed to allocate OSPCALLID object for '%.*s'\n", hf->body.len, hf->body.s);
1240 }
1241 } else {
1242 LM_ERR("failed to find Call-ID header\n");
1243 }
1244
1245 return result;
1246}
1247
1248/*
1249 * Get route parameters from the 1st Route or Request-Line

Callers 3

ospReportUsageFunction · 0.85
ospValidateHeaderFunction · 0.85
ospRequestRoutingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected