static struct mi_root* mi_b2be_list(struct mi_root* cmd, void* param) { struct mi_root *rpl_tree; struct mi_node *rpl=NULL; rpl_tree = init_mi_tree( 200, MI_OK_S, MI_OK_LEN); if (rpl_tree==NULL) return NULL; rpl = &rpl_tree->node; if (server_htable) if (mi_print_b2be_dlg(rpl, server_htable, server_hsize)!=0) goto error; if (client_htable) if (mi_print_b2be_dlg(rpl, client_htable, client_hsize)!=0) goto error; return rpl_tree; error: LM_ERR("Unable to create reply\n"); free_mi_tree(rpl_tree); return NULL; }
static mi_response_t *mi_b2be_list(const mi_params_t *params, struct mi_handler *async_hdl) { mi_response_t *resp; mi_item_t *resp_arr; resp = init_mi_result_array(&resp_arr); if (!resp) return 0; if (server_htable) if (mi_print_b2be_dlg(resp_arr, server_htable, server_hsize)!=0) goto error; if (client_htable) if (mi_print_b2be_dlg(resp_arr, client_htable, client_hsize)!=0) goto error; return resp; error: LM_ERR("Unable to create response\n"); free_mi_response(resp); return NULL; }