* The initialization function, called when the module is loaded by * the script. This function is called only once. * * Bind to the dialog module and setup the callbacks. Also initialize * the shared memory to store our interninal information in. */
| 113 | * the shared memory to store our interninal information in. |
| 114 | */ |
| 115 | static int mod_init(void) |
| 116 | { |
| 117 | qos_flag = get_flag_id_by_name(FLAG_TYPE_MSG, qos_flag_str, 0); |
| 118 | |
| 119 | if (qos_flag == -1) { |
| 120 | LM_ERR("no qos flag set!!\n"); |
| 121 | return -1; |
| 122 | } |
| 123 | else if (qos_flag > MAX_FLAG) { |
| 124 | LM_ERR("invalid qos flag %d!!\n", qos_flag); |
| 125 | return -1; |
| 126 | } |
| 127 | |
| 128 | /* init callbacks */ |
| 129 | if (init_qos_callbacks()!=0) { |
| 130 | LM_ERR("cannot init callbacks\n"); |
| 131 | return -1; |
| 132 | } |
| 133 | |
| 134 | /* Register the main (static) dialog call back. */ |
| 135 | if (load_dlg_api(&dialog_st) != 0) { |
| 136 | LM_ERR("Can't load dialog hooks\n"); |
| 137 | return(-1); |
| 138 | } |
| 139 | |
| 140 | /* Load dialog hooks */ |
| 141 | dialog_st.register_dlgcb(NULL, DLGCB_CREATED, qos_dialog_created_CB, NULL, NULL); |
| 142 | |
| 143 | /* |
| 144 | * We are GOOD-TO-GO. |
| 145 | */ |
| 146 | return 0; |
| 147 | } |
| 148 | |
| 149 | static void mod_destroy(void) |
| 150 | { |
nothing calls this directly
no test coverage detected