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

Function state_changed_event_init

modules/dialog/dlg_hash.c:1051–1100  ·  view source on GitHub ↗

* create DLG_STATE_CHANGED_EVENT */

Source from the content-addressed store, hash-verified

1049 * create DLG_STATE_CHANGED_EVENT
1050 */
1051int state_changed_event_init(void)
1052{
1053 /* publish the event */
1054 ei_st_ch_id = evi_publish_event(ei_st_ch_name);
1055 if (ei_st_ch_id == EVI_ERROR) {
1056 LM_ERR("cannot register dialog state changed event\n");
1057 return -1;
1058 }
1059
1060 event_params = pkg_malloc(sizeof(evi_params_t));
1061 if (event_params == NULL) {
1062 LM_ERR("no more pkg mem\n");
1063 return -1;
1064 }
1065 memset(event_params, 0, sizeof(evi_params_t));
1066
1067 id_p = evi_param_create(event_params, &ei_id);
1068 if (id_p == NULL)
1069 goto create_error;
1070
1071 db_id_p = evi_param_create(event_params, &ei_db_id);
1072 if (db_id_p == NULL)
1073 goto create_error;
1074
1075 cid_p = evi_param_create(event_params, &ei_c_id);
1076 if (cid_p == NULL)
1077 goto create_error;
1078
1079 fromt_p = evi_param_create(event_params, &ei_from_tag);
1080 if (fromt_p == NULL)
1081 goto create_error;
1082
1083 tot_p = evi_param_create(event_params, &ei_to_tag);
1084 if (tot_p == NULL)
1085 goto create_error;
1086
1087 ostate_p = evi_param_create(event_params, &ei_old_state);
1088 if (ostate_p == NULL)
1089 goto create_error;
1090
1091 nstate_p = evi_param_create(event_params, &ei_new_state);
1092 if (nstate_p == NULL)
1093 goto create_error;
1094
1095 return 0;
1096
1097create_error:
1098 LM_ERR("cannot create event parameter\n");
1099 return -1;
1100}
1101
1102/*
1103 * destroy DLG_STATE_CHANGED event

Callers 1

mod_initFunction · 0.85

Calls 2

evi_publish_eventFunction · 0.85
evi_param_createFunction · 0.85

Tested by

no test coverage detected