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

Function init_extra_avps

usr_avp.c:73–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71
72
73int init_extra_avps(void)
74{
75 extra_lock = lock_alloc();
76 if (!extra_lock) {
77 LM_ERR("cannot allocate lock\n");
78 return -1;
79 }
80 if (!lock_init(extra_lock)) {
81 LM_ERR("cannot init lock\n");
82 return -1;
83 }
84 last_avp_index_shm = shm_malloc(sizeof(int));
85 if (!last_avp_index_shm) {
86 LM_ERR("not enough shm mem\n");
87 return -1;
88 }
89 *last_avp_index_shm = last_avp_index;
90 /* initialize map for dynamic avps */
91 avp_map_shm = map_create(AVLMAP_SHARED);
92 if (!avp_map_shm) {
93 LM_ERR("cannot create shared avp_map\n");
94 return -1;
95 }
96 return 0;
97}
98
99
100struct usr_avp* new_avp(unsigned short flags, int id, int_str val)

Callers

nothing calls this directly

Calls 3

lock_initFunction · 0.85
shm_mallocFunction · 0.85
map_createFunction · 0.85

Tested by

no test coverage detected