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

Function get_dummy_sip_msg

action.c:1373–1409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1371}
1372
1373struct sip_msg* get_dummy_sip_msg(void)
1374{
1375 struct sip_msg* req;
1376
1377 if (dummy_static_req == NULL || dummy_static_in_used) {
1378 /* if the static request is not yet allocated, or the static
1379 * request is already in used (nested calls?), we better allocate
1380 * a new structure */
1381 LM_DBG("allocating new sip msg\n");
1382 req = (struct sip_msg*)pkg_malloc(sizeof(struct sip_msg));
1383 if(req == NULL)
1384 {
1385 LM_ERR("No more memory\n");
1386 return NULL;
1387 }
1388 memset( req, 0, sizeof(struct sip_msg));
1389
1390 req->buf = (char*)_sip_msg_buf;
1391 req->len = strlen(_sip_msg_buf);
1392 req->rcv.src_ip.af = AF_INET;
1393 req->rcv.dst_ip.af = AF_INET;
1394
1395 parse_msg((char*)_sip_msg_buf, strlen(_sip_msg_buf), req);
1396 parse_headers( req, HDR_EOH_F, 0);
1397 if (dummy_static_req==NULL) {
1398 dummy_static_req = req;
1399 dummy_static_in_used = 1;
1400 LM_DBG("setting as static to %p\n",req);
1401 }
1402 } else {
1403 /* reuse the static request */
1404 req = dummy_static_req;
1405 LM_DBG("reusing the static sip msg %p\n",req);
1406 }
1407
1408 return req;
1409}
1410
1411void release_dummy_sip_msg( struct sip_msg* req)
1412{

Callers 15

async_launch_resumeFunction · 0.85
async_script_launchFunction · 0.85
run_startup_routeFunction · 0.85
route_timer_fFunction · 0.85
run_msrp_auth_routeFunction · 0.85
run_msrp_socket_routeFunction · 0.85
run_dfks_routeFunction · 0.85
handle_ebr_ipcFunction · 0.85
hep_msg_receivedFunction · 0.85
kafka_report_statusFunction · 0.85
rtpengine_api_deleteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected