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

Function add_event

modules/freeswitch/fs_api.c:447–469  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

445}
446
447struct fs_event *add_event(fs_evs *sock, const str *name)
448{
449 struct fs_event *event;
450
451 event = shm_malloc(sizeof *event);
452 if (!event) {
453 LM_ERR("oom\n");
454 return NULL;
455 }
456 memset(event, 0, sizeof *event);
457
458 if (dup_common_tag(name, &event->name) != 0) {
459 shm_free(event);
460 LM_ERR("oom\n");
461 return NULL;
462 }
463
464 event->action = FS_EVENT_SUB;
465 INIT_LIST_HEAD(&event->subscriptions);
466
467 list_add_tail(&event->list, &sock->events);
468 return event;
469}
470
471struct fs_event *get_event(fs_evs *sock, const str *name)
472{

Callers 1

evs_subFunction · 0.70

Calls 5

shm_mallocFunction · 0.85
dup_common_tagFunction · 0.85
shm_freeFunction · 0.85
INIT_LIST_HEADFunction · 0.85
list_add_tailFunction · 0.85

Tested by

no test coverage detected