* Get Call-ID header from SIP message * param msg SIP message * param callid Call ID * return 0 success, -1 failure */
| 1224 | * return 0 success, -1 failure |
| 1225 | */ |
| 1226 | int 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 |
no outgoing calls
no test coverage detected