From 0e101a4c48e6a27f3f0a71eab434d8590bc0560a Mon Sep 17 00:00:00 2001 From: Grzegorz Sluja Date: Wed, 8 Sep 2021 11:24:24 +0200 Subject: [PATCH] VoiceService: Get CallStatus values using new dedicated ubus call The new ubus call has been created in asterisk to get proper CallStatus values for line: ubus call asterisk call_status '{ "line" : X }' Use it to get proper values according to TR-104 definitions. --- dmtree/tr104/servicesvoiceservicecallcontrol.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/dmtree/tr104/servicesvoiceservicecallcontrol.c b/dmtree/tr104/servicesvoiceservicecallcontrol.c index c482c1ec..1d1a03b8 100644 --- a/dmtree/tr104/servicesvoiceservicecallcontrol.c +++ b/dmtree/tr104/servicesvoiceservicecallcontrol.c @@ -247,18 +247,9 @@ static int get_ServicesVoiceServiceCallControlLine_CallStatus(char *refparam, st char line_str[16]; snprintf(line_str, sizeof(line_str), "%d", line_num); - dmubus_call("endpt", "status", UBUS_ARGS{{"line", line_str, Integer}}, 1, &res); + dmubus_call("asterisk", "call_status", UBUS_ARGS{{"line", line_str, Integer}}, 1, &res); if (res) { - /* - * Convert the status to a value specified in TR-104. - * - * Note that the current status provided by UBUS "endpt status" can not be mapped to those values - * specified in TR-104. - * - * TODO: the corresponding UBUS RPC will be enhanced in order to provide more TR-104 compliant values - */ - char *offhook = dmjson_get_value(res, 1, "offhook"); - *value = *offhook == '1' ? "Connected" : "Idle"; + *value = dmjson_get_value(res, 1, "call_status"); } else { BBF_DEBUG("dmubus_call() failed\n"); }