Lines Matching full:clients
50 * clients | * channel |
149 if (ctrl->clients[i].token == c_token) { in sip_svc_get_c_idx()
176 ctrl->clients[c_idx].id = c_idx; in sip_svc_register()
177 ctrl->clients[c_idx].token = sip_svc_generate_c_token(); in sip_svc_register()
178 ctrl->clients[c_idx].state = SIP_SVC_CLIENT_ST_IDLE; in sip_svc_register()
179 ctrl->clients[c_idx].priv_data = priv_data; in sip_svc_register()
181 LOG_INF("Register the client channel 0x%x", ctrl->clients[c_idx].token); in sip_svc_register()
182 return ctrl->clients[c_idx].token; in sip_svc_register()
212 if (ctrl->clients[c_idx].id == SIP_SVC_ID_INVALID) { in sip_svc_unregister()
217 if (ctrl->clients[c_idx].active_trans_cnt != 0) { in sip_svc_unregister()
222 if (ctrl->clients[c_idx].state != SIP_SVC_CLIENT_ST_IDLE) { in sip_svc_unregister()
227 LOG_INF("Unregister the client channel 0x%x", ctrl->clients[c_idx].token); in sip_svc_unregister()
228 ctrl->clients[c_idx].id = SIP_SVC_ID_INVALID; in sip_svc_unregister()
229 ctrl->clients[c_idx].state = SIP_SVC_CLIENT_ST_INVALID; in sip_svc_unregister()
230 ctrl->clients[c_idx].token = SIP_SVC_ID_INVALID; in sip_svc_unregister()
231 ctrl->clients[c_idx].priv_data = NULL; in sip_svc_unregister()
303 if (ctrl->clients[c_idx].state == SIP_SVC_CLIENT_ST_OPEN) { in sip_svc_open()
311 if (ctrl->clients[c_idx].state != SIP_SVC_CLIENT_ST_IDLE) { in sip_svc_open()
330 ctrl->clients[c_idx].state = SIP_SVC_CLIENT_ST_OPEN; in sip_svc_open()
374 if (ctrl->clients[c_idx].state != SIP_SVC_CLIENT_ST_OPEN) { in sip_svc_close()
375 LOG_ERR("Client is in wrong state %d", ctrl->clients[c_idx].state); in sip_svc_close()
380 if (ctrl->clients[c_idx].active_trans_cnt != 0) { in sip_svc_close()
381 ctrl->clients[c_idx].state = SIP_SVC_CLIENT_ST_ABORT; in sip_svc_close()
383 ctrl->clients[c_idx].state = SIP_SVC_CLIENT_ST_IDLE; in sip_svc_close()
391 LOG_INF("Close the client channel 0x%x", ctrl->clients[c_idx].token); in sip_svc_close()
427 __ASSERT(ctrl->clients[c_idx].active_trans_cnt != 0, in sip_svc_callback()
429 --ctrl->clients[c_idx].active_trans_cnt; in sip_svc_callback()
431 if (ctrl->clients[c_idx].state == SIP_SVC_CLIENT_ST_OPEN && trans_id_item->arg1) { in sip_svc_callback()
433 ((sip_svc_cb_fn)(trans_id_item->arg1))(ctrl->clients[c_idx].token, response); in sip_svc_callback()
447 sip_svc_id_mgr_free(ctrl->clients[c_idx].trans_idx_pool, in sip_svc_callback()
450 if (ctrl->clients[c_idx].active_trans_cnt != 0) { in sip_svc_callback()
455 if (ctrl->clients[c_idx].state == SIP_SVC_CLIENT_ST_ABORT) { in sip_svc_callback()
456 ctrl->clients[c_idx].state = SIP_SVC_CLIENT_ST_IDLE; in sip_svc_callback()
701 if (ctrl->clients[c_idx].state != SIP_SVC_CLIENT_ST_OPEN) { in sip_svc_send()
707 trans_idx = sip_svc_id_mgr_alloc(ctrl->clients[c_idx].trans_idx_pool); in sip_svc_send()
718 sip_svc_id_mgr_free(ctrl->clients[c_idx].trans_idx_pool, trans_idx); in sip_svc_send()
734 sip_svc_id_mgr_free(ctrl->clients[c_idx].trans_idx_pool, trans_idx); in sip_svc_send()
744 sip_svc_id_mgr_free(ctrl->clients[c_idx].trans_idx_pool, trans_idx); in sip_svc_send()
748 ++ctrl->clients[c_idx].active_trans_cnt; in sip_svc_send()
753 sip_svc_id_mgr_free(ctrl->clients[c_idx].trans_idx_pool, trans_idx); in sip_svc_send()
790 return ctrl->clients[c_idx].priv_data; in sip_svc_get_priv_data()
868 ctrl->clients = k_malloc(ctrl->num_clients * sizeof(struct sip_svc_client)); in sip_svc_subsys_init()
869 if (ctrl->clients == NULL) { in sip_svc_subsys_init()
877 memset(ctrl->clients, 0, ctrl->num_clients * sizeof(struct sip_svc_client)); in sip_svc_subsys_init()
885 client = &ctrl->clients[i]; in sip_svc_subsys_init()
903 k_free(ctrl->clients); in sip_svc_subsys_init()
907 client = &ctrl->clients[i]; in sip_svc_subsys_init()