2011-10-11 09:18:38

by Dmitriy Paliy

[permalink] [raw]
Subject: [PATCH BlueZ] Fix call status in +CLCC for maemo6 telephony

If list current calls is requested when there is second incoming call
and csd call status is CSD_CALL_STATUS_PROCEEDING, then returned 'state
of the call' value in +CLCC is 4 (incoming, MT call), which is incorrect.
Indication than proceeds from incoming to waiting state.

This patch sets the corresponding value to 5 (waiting, MT call) in
maemo6 telephony driver for the second call.
---
audio/telephony-maemo6.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/audio/telephony-maemo6.c b/audio/telephony-maemo6.c
index 102daeb..13bb198 100644
--- a/audio/telephony-maemo6.c
+++ b/audio/telephony-maemo6.c
@@ -932,8 +932,12 @@ static int csd_status_to_hfp(struct csd_call *call)
/* PROCEEDING can happen in outgoing/incoming */
if (call->originating)
return CALL_STATUS_DIALING;
- else
- return CALL_STATUS_INCOMING;
+ else {
+ if (g_slist_length(active_calls) > 0)
+ return CALL_STATUS_WAITING;
+ else
+ return CALL_STATUS_INCOMING;
+ }
case CSD_CALL_STATUS_COMING:
return CALL_STATUS_INCOMING;
case CSD_CALL_STATUS_MO_ALERTING:
--
1.7.4.1



2011-10-11 11:02:05

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [PATCH BlueZ] Fix call status in +CLCC for maemo6 telephony

Hi,

On Tue, Oct 11, 2011 at 1:57 PM, Luiz Augusto von Dentz
<[email protected]> wrote:
> Also, I guess the number of active calls must be > 1 to be on waiting, isn't it?

Please ignore this, the call won't be active so > 0 is correct.


--
Luiz Augusto von Dentz

2011-10-11 10:57:43

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [PATCH BlueZ] Fix call status in +CLCC for maemo6 telephony

Hi Dmitriy,

On Tue, Oct 11, 2011 at 1:13 PM, Dmitriy Paliy <[email protected]> wrote:
> Hi Luiz,
>
> On Tue, Oct 11, 2011 at 12:44 PM, Luiz Augusto von Dentz
> <[email protected]> wrote:
>> Hi Dmitriy,
>>
>> On Tue, Oct 11, 2011 at 12:18 PM, Dmitriy Paliy <[email protected]> wrote:
>>> If list current calls is requested when there is second incoming call
>>> and csd call status is CSD_CALL_STATUS_PROCEEDING, then returned 'state
>>> of the call' value in +CLCC is 4 (incoming, MT call), which is incorrect.
>>> Indication than proceeds from incoming to waiting state.
>>>
>>> This patch sets the corresponding value to 5 (waiting, MT call) in
>>> maemo6 telephony driver for the second call.
>>> ---
>>> ?audio/telephony-maemo6.c | ? ?8 ++++++--
>>> ?1 files changed, 6 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/audio/telephony-maemo6.c b/audio/telephony-maemo6.c
>>> index 102daeb..13bb198 100644
>>> --- a/audio/telephony-maemo6.c
>>> +++ b/audio/telephony-maemo6.c
>>> @@ -932,8 +932,12 @@ static int csd_status_to_hfp(struct csd_call *call)
>>> ? ? ? ? ? ? ? ?/* PROCEEDING can happen in outgoing/incoming */
>>> ? ? ? ? ? ? ? ?if (call->originating)
>>> ? ? ? ? ? ? ? ? ? ? ? ?return CALL_STATUS_DIALING;
>>> - ? ? ? ? ? ? ? else
>>> - ? ? ? ? ? ? ? ? ? ? ? return CALL_STATUS_INCOMING;
>>> + ? ? ? ? ? ? ? else {
>>> + ? ? ? ? ? ? ? ? ? ? ? if (g_slist_length(active_calls) > 0)
>>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? return CALL_STATUS_WAITING;
>>> + ? ? ? ? ? ? ? ? ? ? ? else
>>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? return CALL_STATUS_INCOMING;
>>> + ? ? ? ? ? ? ? }
>>
>> I guess you could have else if (g_slist_length(active_calls) > 0)
>> which is less indentation, other than that looks ok.
>
> In this way it looks grouped in better way to my taste, since there
> are two cases (incoming and dialing), and those have sub-cases. Note,
> that dialing may have also two sub-cases in theory (2: dialling, 3:
> alerting). Such structure
> if (call->originating)
> ...
> else if (g_slist_length(active_calls) > 0)
> ...
> else
> looks more confusing. What do you think?

Actually since we are returning we probably don't need this amount of
else, so something like the following should be equivalent:

- else
- return CALL_STATUS_INCOMING;
+
+ if (g_slist_length(active_calls) > 0)
+ return CALL_STATUS_WAITING;
+
+ return CALL_STATUS_INCOMING;

Also, I guess the number of active calls must be > 1 to be on waiting, isn't it?

--
Luiz Augusto von Dentz

2011-10-11 10:13:18

by Dmitriy Paliy

[permalink] [raw]
Subject: Re: [PATCH BlueZ] Fix call status in +CLCC for maemo6 telephony

Hi Luiz,

On Tue, Oct 11, 2011 at 12:44 PM, Luiz Augusto von Dentz
<[email protected]> wrote:
> Hi Dmitriy,
>
> On Tue, Oct 11, 2011 at 12:18 PM, Dmitriy Paliy <[email protected]> wrote:
>> If list current calls is requested when there is second incoming call
>> and csd call status is CSD_CALL_STATUS_PROCEEDING, then returned 'state
>> of the call' value in +CLCC is 4 (incoming, MT call), which is incorrect.
>> Indication than proceeds from incoming to waiting state.
>>
>> This patch sets the corresponding value to 5 (waiting, MT call) in
>> maemo6 telephony driver for the second call.
>> ---
>> ?audio/telephony-maemo6.c | ? ?8 ++++++--
>> ?1 files changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/audio/telephony-maemo6.c b/audio/telephony-maemo6.c
>> index 102daeb..13bb198 100644
>> --- a/audio/telephony-maemo6.c
>> +++ b/audio/telephony-maemo6.c
>> @@ -932,8 +932,12 @@ static int csd_status_to_hfp(struct csd_call *call)
>> ? ? ? ? ? ? ? ?/* PROCEEDING can happen in outgoing/incoming */
>> ? ? ? ? ? ? ? ?if (call->originating)
>> ? ? ? ? ? ? ? ? ? ? ? ?return CALL_STATUS_DIALING;
>> - ? ? ? ? ? ? ? else
>> - ? ? ? ? ? ? ? ? ? ? ? return CALL_STATUS_INCOMING;
>> + ? ? ? ? ? ? ? else {
>> + ? ? ? ? ? ? ? ? ? ? ? if (g_slist_length(active_calls) > 0)
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? return CALL_STATUS_WAITING;
>> + ? ? ? ? ? ? ? ? ? ? ? else
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? return CALL_STATUS_INCOMING;
>> + ? ? ? ? ? ? ? }
>
> I guess you could have else if (g_slist_length(active_calls) > 0)
> which is less indentation, other than that looks ok.

In this way it looks grouped in better way to my taste, since there
are two cases (incoming and dialing), and those have sub-cases. Note,
that dialing may have also two sub-cases in theory (2: dialling, 3:
alerting). Such structure
if (call->originating)
...
else if (g_slist_length(active_calls) > 0)
...
else
looks more confusing. What do you think?

Dmitriy

2011-10-11 09:44:42

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [PATCH BlueZ] Fix call status in +CLCC for maemo6 telephony

Hi Dmitriy,

On Tue, Oct 11, 2011 at 12:18 PM, Dmitriy Paliy <[email protected]> wrote:
> If list current calls is requested when there is second incoming call
> and csd call status is CSD_CALL_STATUS_PROCEEDING, then returned 'state
> of the call' value in +CLCC is 4 (incoming, MT call), which is incorrect.
> Indication than proceeds from incoming to waiting state.
>
> This patch sets the corresponding value to 5 (waiting, MT call) in
> maemo6 telephony driver for the second call.
> ---
> ?audio/telephony-maemo6.c | ? ?8 ++++++--
> ?1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/audio/telephony-maemo6.c b/audio/telephony-maemo6.c
> index 102daeb..13bb198 100644
> --- a/audio/telephony-maemo6.c
> +++ b/audio/telephony-maemo6.c
> @@ -932,8 +932,12 @@ static int csd_status_to_hfp(struct csd_call *call)
> ? ? ? ? ? ? ? ?/* PROCEEDING can happen in outgoing/incoming */
> ? ? ? ? ? ? ? ?if (call->originating)
> ? ? ? ? ? ? ? ? ? ? ? ?return CALL_STATUS_DIALING;
> - ? ? ? ? ? ? ? else
> - ? ? ? ? ? ? ? ? ? ? ? return CALL_STATUS_INCOMING;
> + ? ? ? ? ? ? ? else {
> + ? ? ? ? ? ? ? ? ? ? ? if (g_slist_length(active_calls) > 0)
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? return CALL_STATUS_WAITING;
> + ? ? ? ? ? ? ? ? ? ? ? else
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? return CALL_STATUS_INCOMING;
> + ? ? ? ? ? ? ? }

I guess you could have else if (g_slist_length(active_calls) > 0)
which is less indentation, other than that looks ok.


--
Luiz Augusto von Dentz