Re: [PATCH] Fix sending User Cancel response to Set Up Call.

2010-09-09 Thread Denis Kenzior
Hi Andrew,

On 09/08/2010 12:59 PM, Andrzej Zaborowski wrote:
 One of the clean-up commits changed the semantics of the dial request
 callback's parameter (NULL if call setup failed, non-NULL if success
 or user cancelled).
 ---
  src/stk.c   |2 +-
  src/voicecall.c |   14 ++
  2 files changed, 15 insertions(+), 1 deletions(-)
 
 diff --git a/src/stk.c b/src/stk.c
 index b469467..b6ed4c3 100644
 --- a/src/stk.c
 +++ b/src/stk.c
 @@ -1419,7 +1419,7 @@ static void call_setup_connected(struct ofono_call 
 *call, void *data)
   static struct ofono_error error = { .type = OFONO_ERROR_TYPE_FAILURE };
   static unsigned char facility_rejected_result[] = { 0x9d };
  
 - if (!call) {
 + if (!call || call-status == CALL_STATUS_DISCONNECTED) {

If the call has been disconnected by the user, shouldn't we be sending
USER_CANCEL?  At least that is what the old behavior implies.

   memset(rsp, 0, sizeof(rsp));
  
   rsp.result.type = STK_RESULT_TYPE_NETWORK_UNAVAILABLE;
 diff --git a/src/voicecall.c b/src/voicecall.c
 index 3bd4dff..e536089 100644
 --- a/src/voicecall.c
 +++ b/src/voicecall.c
 @@ -361,6 +361,16 @@ static DBusMessage *voicecall_deflect(DBusConnection 
 *conn,
   return NULL;
  }
  
 +static void dial_request_user_cancel(struct ofono_voicecall *vc,
 + struct voicecall *call)
 +{
 + if (!vc-dial_req)
 + return;
 +
 + if (!call || call == vc-dial_req-call)
 + dial_request_finish(vc-dial_req-call-vc, TRUE);
 +}
 +
  static DBusMessage *voicecall_hangup(DBusConnection *conn,
   DBusMessage *msg, void *data)
  {
 @@ -372,6 +382,8 @@ static DBusMessage *voicecall_hangup(DBusConnection *conn,
   if (vc-pending)
   return __ofono_error_busy(msg);
  
 + dial_request_user_cancel(vc, v);
 +

I don't see the need for this part, don't we already take care of this
in voicecall_set_call_status?

   switch (call-status) {
   case CALL_STATUS_DISCONNECTED:
   return __ofono_error_failed(msg);
 @@ -1278,6 +1290,8 @@ static DBusMessage *manager_hangup_all(DBusConnection 
 *conn,
   return reply;
   }
  
 + dial_request_user_cancel(vc, NULL);
 +

Same as above...

   vc-flags |= VOICECALLS_FLAG_MULTI_RELEASE;
  
   vc-pending = dbus_message_ref(msg);

Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: [PATCH] Fix sending User Cancel response to Set Up Call.

2010-09-09 Thread Andrzej Zaborowski
On 9 September 2010 16:37, Denis Kenzior denk...@gmail.com wrote:
 Hi Andrew,

 On 09/08/2010 12:59 PM, Andrzej Zaborowski wrote:
 One of the clean-up commits changed the semantics of the dial request
 callback's parameter (NULL if call setup failed, non-NULL if success
 or user cancelled).
 ---
  src/stk.c       |    2 +-
  src/voicecall.c |   14 ++
  2 files changed, 15 insertions(+), 1 deletions(-)

 diff --git a/src/stk.c b/src/stk.c
 index b469467..b6ed4c3 100644
 --- a/src/stk.c
 +++ b/src/stk.c
 @@ -1419,7 +1419,7 @@ static void call_setup_connected(struct ofono_call 
 *call, void *data)
       static struct ofono_error error = { .type = OFONO_ERROR_TYPE_FAILURE };
       static unsigned char facility_rejected_result[] = { 0x9d };

 -     if (!call) {
 +     if (!call || call-status == CALL_STATUS_DISCONNECTED) {

 If the call has been disconnected by the user, shouldn't we be sending
 USER_CANCEL?  At least that is what the old behavior implies.

In that case yes, but if it's disconnected because connecting failed,
then we report this to the card.

I noticed that 
http://git.kernel.org/?p=network/ofono/ofono.git;a=commitdiff;h=ed562ba2b04b56b9a688d40906bb783027c4a1e6
changed the behaviour slightly (but the old behaviour was probably
wrong too).


               memset(rsp, 0, sizeof(rsp));

               rsp.result.type = STK_RESULT_TYPE_NETWORK_UNAVAILABLE;
 diff --git a/src/voicecall.c b/src/voicecall.c
 index 3bd4dff..e536089 100644
 --- a/src/voicecall.c
 +++ b/src/voicecall.c
 @@ -361,6 +361,16 @@ static DBusMessage *voicecall_deflect(DBusConnection 
 *conn,
       return NULL;
  }

 +static void dial_request_user_cancel(struct ofono_voicecall *vc,
 +                                     struct voicecall *call)
 +{
 +     if (!vc-dial_req)
 +             return;
 +
 +     if (!call || call == vc-dial_req-call)
 +             dial_request_finish(vc-dial_req-call-vc, TRUE);
 +}
 +
  static DBusMessage *voicecall_hangup(DBusConnection *conn,
                                       DBusMessage *msg, void *data)
  {
 @@ -372,6 +382,8 @@ static DBusMessage *voicecall_hangup(DBusConnection 
 *conn,
       if (vc-pending)
               return __ofono_error_busy(msg);

 +     dial_request_user_cancel(vc, v);
 +

 I don't see the need for this part, don't we already take care of this
 in voicecall_set_call_status?

At that point we can't tell where it was a network error / busy signal
/ etc, or the user cancelled the call (which has a different result
value sent to sim).


       switch (call-status) {
       case CALL_STATUS_DISCONNECTED:
               return __ofono_error_failed(msg);
 @@ -1278,6 +1290,8 @@ static DBusMessage *manager_hangup_all(DBusConnection 
 *conn,
               return reply;
       }

 +     dial_request_user_cancel(vc, NULL);
 +

 Same as above...

       vc-flags |= VOICECALLS_FLAG_MULTI_RELEASE;

       vc-pending = dbus_message_ref(msg);

 Regards,
 -Denis
 ___
 ofono mailing list
 ofono@ofono.org
 http://lists.ofono.org/listinfo/ofono


Regards,
Andrew
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: [PATCH] Fix sending User Cancel response to Set Up Call.

2010-09-09 Thread Denis Kenzior
Hi Andrew,

On 09/08/2010 12:59 PM, Andrzej Zaborowski wrote:
 One of the clean-up commits changed the semantics of the dial request
 callback's parameter (NULL if call setup failed, non-NULL if success
 or user cancelled).

Patch has been applied, thanks.

Regards,
-Denis
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono