support of emergency call when SIM not inserted ?

2010-09-23 Thread Anthony CROLAIS
Hi all,
 
I am new to oFono.
It seems an important challenge to design a telephony system that will
support 
several 3GPP modems. I would like to participate.
 
I have read documentation (ofono-paper, coding-style, api for oFono
Interfaces).
I have started to cover source code: modem part, sim part...
 
I need a clarification about SIM:
Most GSM mobile phones can dial emergency calls even when the phone is
without a SIM card.
But it seems that oFono does not support an emergency call if the sim
driver is present but no SIM is inserted:
 
Indeed, if no sim is inserted, each access to SIM (e.g. read EF) 
via AT command is responded with +CME ERROR: 10.
Thus, sim initialization sequence can be sum-up like this:
1) sim_pin_check(sim) is called although the reading of SIM EF have
failed (EFicc, EFli, EFpl...).
2) SIM pin check procedure fails and sim_initialize_after_pin() is not
entered 
As a consequence, sim state variable is NEVER set to
OFONO_SIM_STATE_READY
As a consequence, modem state is NEVER set to MODEM_STATE_OFFLINE
3) Then, if modem Online property is set to ON, it fails because modem
state is still MODEM_STATE_PRE_SIM
= So the radio is not powered on and emergency call can not be
established.
 
So my question is:
I would like to know if support of emergency call when sim not
inserted is part of oFono requirements?
If yes, a detection of SIM presence seems necessary as well as a correct
online property management in that case.
A TO DO could be added (I can try to)
 
 
Thanks  regards,
 
Anthony Crolais
 
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: support of emergency call when SIM not inserted ?

2010-09-23 Thread Marcel Holtmann
Hi Anthony,

new rule for everybody, no more HTML emails on this mailing list.
Actually not really a new rule, but I forgot to enforce it. So please
fix your mail clients.

 I am new to oFono.
 It seems an important challenge to design a telephony system that will
 support 
 several 3GPP modems. I would like to participate.
  
 I have read documentation (ofono-paper, coding-style, api for oFono
 Interfaces).
 I have started to cover source code: modem part, sim part...
  
 I need a clarification about SIM:
 Most GSM mobile phones can dial emergency calls even when the phone is
 without a SIM card.
 But it seems that oFono does not support an emergency call if the sim
 driver is present but no SIM is inserted:

I have never tested it by myself, but this should actually work just
fine. The voice call driver is registered in the pre-SIM state and has
some special handling when no SIM is present.

If it does not work, then this is a bug.

Regards

Marcel


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


Re: support of emergency call when SIM not inserted ?

2010-09-23 Thread Pekka Pessi
Hi everyone,

2010/9/23 Marcel Holtmann mar...@holtmann.org:
 I need a clarification about SIM:
 Most GSM mobile phones can dial emergency calls even when the phone is
 without a SIM card.
 But it seems that oFono does not support an emergency call if the sim
 driver is present but no SIM is inserted:

 I have never tested it by myself, but this should actually work just
 fine. The voice call driver is registered in the pre-SIM state and has
 some special handling when no SIM is present.

 If it does not work, then this is a bug.

It definitely is a bug (or missing feature). Andras from our team is
working on it, he can probably post patches on emergency call
handling. Shortly, the modem will register to network if a emergency
call is to be dialed.

-- 
Pekka.Pessi mail at nokia.com
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: [PATCH] Fix test-sms.

2010-09-23 Thread Pekka Pessi
Hi Marcel,
 +if smsc:
 +     manager.SetProperty(ServiceCenterAddress, dbus.String(smsc))

 the SMSC is a global message manager property, I prefer to just have a
 test script that just modifies it. Using set-service-center-address
 would be way better then trying to include this in this test script.

What about the SRR? Should I move setting it to a separate script, too?

-- 
Pekka.Pessi mail at nokia.com
___
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono


Re: [PATCH] Fix valid_ussd_string()

2010-09-23 Thread Marcel Holtmann
Hi Pekka,

  this is not an acceptable patch. You are removing functionality and
  lengthy comment without providing a comment in the commit message from
  equal length and detail.
 
  We can not do it like this since 1 month later nobody remembers what has
  been done here and why. This needs proper documentation.
 
 Please care to explain what the reference to the 22.090 was doing
 here? A terminal simply do not care how the network routes the USSD.
 And from the network point of view, any string that can be encoded in
 the ussd-String of processUnstructuredSS-Request according to the
 rules of 23.038 is valid USSD string. Most of them fall in the cop-out
 of the case d in the 22.090 reference I removed. Like if I sent a USSD
 string Marcel to network, it is handled according to the case d.
 
 Denis explained to me what this function was supposed to do, and I
 tried to fix it according to the explanation. According to Denis, the
 function here determines which MMI dial strings are considered as USSD
 string (after structured supplementary service control codes are
 weeded out).
 
 I can put the explanation into the commit message (and fix the ussd
 atom part), if that is required.

yes, please add this to the commit message. Since I didn't even look
into the case if this is technical sound or not. The imbalance of
removed comments compare to commit message explaining what the patch
does struck me first. Hence my complaint.

Regards

Marcel


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


[PATCH] Add GPRS suspension to doc/features.txt

2010-09-23 Thread Pekka . Pessi
From: Pekka Pessi pekka.pe...@nokia.com

---
 doc/features.txt |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/doc/features.txt b/doc/features.txt
index 534b8de..601d58c 100644
--- a/doc/features.txt
+++ b/doc/features.txt
@@ -96,3 +96,10 @@ Short Messaging Service
   incoming messages is only generated when the SMS is fully assembled.  The
   hash used is SHA1.  This unique identifier is used to identify the SMS
   message to history plugins as well.
+
+
+GPRS
+
+
+- The packet data service may be temporarily suspended while a circuit
+  switched service such as voice call or SMS is active.
-- 
1.7.0.4

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


Re: support of emergency call when SIM not inserted ?

2010-09-23 Thread Denis Kenzior
Hi Anthony,

 
 I need a clarification about SIM:
 
 Most GSM mobile phones can dial emergency calls even when the phone is 
 without a SIM card.
 
 But it seems that oFono does not support an emergency call if the sim driver 
 is present but no SIM is inserted:
 

This used to be supported, but was broken by the new Online state
changes.  Basically we need a way to trigger Online state when an
emergency call is dialed, but remain in Offline state if the SIM is not
inserted / locked.

Please see the Emergency Calls section in the TODO list.

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


RE: support of emergency call when SIM not inserted ?

2010-09-23 Thread Anthony CROLAIS

Hi Denis,

It is Ok for me, thanks. 
I read the Emergency Calls section in the TODO but I though the scope was 
limited to a SIM lock. As you suggest, it can also be applied to the case 
when no sim is inserted.

Regards,
Anthony


-Message d'origine-
De : Denis Kenzior [mailto:denk...@gmail.com] 
Envoyé : jeudi 23 septembre 2010 17:14
À : ofono@ofono.org
Cc : Anthony CROLAIS
Objet : Re: support of emergency call when SIM not inserted ?

Hi Anthony,

 
 I need a clarification about SIM:
 
 Most GSM mobile phones can dial emergency calls even when the phone is 
 without a SIM card.
 
 But it seems that oFono does not support an emergency call if the sim driver 
 is present but no SIM is inserted:
 

This used to be supported, but was broken by the new Online state
changes.  Basically we need a way to trigger Online state when an
emergency call is dialed, but remain in Offline state if the SIM is not
inserted / locked.

Please see the Emergency Calls section in the TODO list.

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


[PATCH 1/2] Fix valid_ussd_string()

2010-09-23 Thread Pekka . Pessi
From: Pekka Pessi pekka.pe...@nokia.com

The valid_ussd_string() returns true if MMI input is to be sent as USSD.

The USSD routing is out of scope of oFono.  The cellular network routes
the USSD requests based on the rules laid out in the 22.090, however,
any string that can be encoded according to the rules of 23.038 is valid
USSD.
---
 src/common.c |   44 +++-
 src/common.h |2 +-
 src/ussd.c   |   13 -
 3 files changed, 32 insertions(+), 27 deletions(-)

diff --git a/src/common.c b/src/common.c
index 55c4b40..a399e4c 100644
--- a/src/common.c
+++ b/src/common.c
@@ -393,7 +393,7 @@ void string_to_phone_number(const char *str, struct 
ofono_phone_number *ph)
}
 }
 
-int valid_ussd_string(const char *str)
+gboolean valid_ussd_string(const char *str, gboolean call_in_progress)
 {
int len = strlen(str);
 
@@ -401,37 +401,31 @@ int valid_ussd_string(const char *str)
return FALSE;
 
/*
-* It is hard to understand exactly what constitutes a valid USSD string
-* According to 22.090:
-* Case a - 1, 2 or 3 digits from the set (*, #) followed by 1X(Y),
-* where X=any number 0‑4, Y=any number 0‑9, then, optionally *
-* followed by any number of any characters, and concluding with #SEND
+* Return true if an MMI input string is to be sent as USSD.
 *
-* Case b - 1, 2 or 3 digits from the set (*, #) followed by 1X(Y),
-* where X=any number 5‑9, Y=any number 0‑9, then, optionally *
-* followed by any number of any characters, and concluding with #SEND
+* Ater checking the well-known supplementary service control,
+* SIM control and manufacturer defined control codes, terminal
+* should check if the input should be sent as USSD according to
+* the following rules:
 *
-* Case c - 7(Y) SEND, where Y=any number 0‑9
+* 1) Terminated by '#'
+* 2) A short string of 1 or 2 digits
 *
-* Case d - All other formats
-*
-* According to 22.030 Figure 3.5.3.2 USSD strings can be:
-*
-* Supplementary service control
-* SIM control
-* Manufacturer defined
-* Terminated by '#'
-* Short String - This can be any 2 digit short string.  If the string
-*starts with a '1' and no calls are in progress then
-*this string is treated as a call setup request
-*
-* Everything else is not a valid USSD string
+* As an exception, if a 2 digit string starts with a '1' and
+* there are no calls in progress then this string is treated as
+* a call setup request instead.
 */
 
-   if (len != 2  str[len-1] != '#')
+   if (str[len-1] == '#')
+   return TRUE;
+
+   if (!call_in_progress  len == 2  str[0] != '1')
return FALSE;
 
-   return TRUE;
+   if (len = 2)
+   return TRUE;
+
+   return FALSE;
 }
 
 const char *ss_control_type_to_string(enum ss_control_type type)
diff --git a/src/common.h b/src/common.h
index c43e46d..8b5798a 100644
--- a/src/common.h
+++ b/src/common.h
@@ -130,7 +130,7 @@ void string_to_phone_number(const char *str, struct 
ofono_phone_number *ph);
 
 int mmi_service_code_to_bearer_class(int code);
 
-gboolean valid_ussd_string(const char *str);
+gboolean valid_ussd_string(const char *str, gboolean call_in_progress);
 
 gboolean parse_ss_control_string(char *str, int *ss_type,
char **sc, char **sia,
diff --git a/src/ussd.c b/src/ussd.c
index aad7d32..90df632 100644
--- a/src/ussd.c
+++ b/src/ussd.c
@@ -545,6 +545,9 @@ static DBusMessage *ussd_initiate(DBusConnection *conn, 
DBusMessage *msg,
void *data)
 {
struct ofono_ussd *ussd = data;
+   struct ofono_modem *modem = __ofono_atom_get_modem(ussd-atom);
+   struct ofono_atom *vca;
+   gboolean call_in_progress;
const char *str;
int dcs = 0x0f;
unsigned char buf[160];
@@ -564,8 +567,16 @@ static DBusMessage *ussd_initiate(DBusConnection *conn, 
DBusMessage *msg,
if (recognized_control_string(ussd, str, msg))
return NULL;
 
+   vca = __ofono_modem_find_atom(modem, OFONO_ATOM_TYPE_VOICECALL);
+   if (vca)
+   call_in_progress = __ofono_voicecall_is_busy(
+   __ofono_atom_get_data(vca),
+   OFONO_VOICECALL_INTERACTION_NONE);
+   else
+   call_in_progress = FALSE;
+
DBG(No.., checking if this is a USSD string);
-   if (!valid_ussd_string(str))
+   if (!valid_ussd_string(str, call_in_progress))
return __ofono_error_invalid_format(msg);
 
if (!ussd_encode(str, num_packed, buf))
-- 
1.7.0.4

___
ofono mailing 

[PATCH 2/2] Fix __ofono_voicecall_is_busy()

2010-09-23 Thread Pekka . Pessi
From: Pekka Pessi pekka.pe...@nokia.com

Return true if call is being dialed by stk, too.
---
 src/voicecall.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/voicecall.c b/src/voicecall.c
index f6ed988..b4017d1 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -2171,7 +2171,7 @@ int ofono_voicecall_get_next_callid(struct 
ofono_voicecall *vc)
 ofono_bool_t __ofono_voicecall_is_busy(struct ofono_voicecall *vc,
enum ofono_voicecall_interaction type)
 {
-   if (vc-pending)
+   if (vc-pending || vc-dial_req)
return TRUE;
 
switch (type) {
-- 
1.7.0.4

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


Re: [PATCH] Add GPRS suspension to doc/features.txt

2010-09-23 Thread Denis Kenzior
Hi Pekka,

On 09/23/2010 10:11 AM, pekka.pe...@nokia.com wrote:
 From: Pekka Pessi pekka.pe...@nokia.com
 
 ---
  doc/features.txt |7 +++
  1 files changed, 7 insertions(+), 0 deletions(-)

When marking a task done, please send a patch for both TODO and
doc/features.txt.  This is easier to track.

Also, your patch did not apply since you have not rebased.  Please make
sure to rebase before any patch submissions.  I had to fix both of these
issues manually with some nasty commit conflicts / squashing.

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


Re: [PATCH 1/2] Fix valid_ussd_string()

2010-09-23 Thread Denis Kenzior
Hi Pekka,

 -  * According to 22.030 Figure 3.5.3.2 USSD strings can be:
 -  *
 -  * Supplementary service control
 -  * SIM control
 -  * Manufacturer defined
 -  * Terminated by '#'
 -  * Short String - This can be any 2 digit short string.  If the string
 -  *starts with a '1' and no calls are in progress then
 -  *this string is treated as a call setup request
 -  *
 -  * Everything else is not a valid USSD string
 +  * As an exception, if a 2 digit string starts with a '1' and
 +  * there are no calls in progress then this string is treated as
 +  * a call setup request instead.

You are now removing any reference to 22.030 and simply stating the
'facts'.  I prefer that the spec trail be left in.  So at least these
comments should not be removed.

The rest looks fine to me.

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


Re: [PATCH 2/2] Fix __ofono_voicecall_is_busy()

2010-09-23 Thread Denis Kenzior
Hi Pekka,

 @@ -2171,7 +2171,7 @@ int ofono_voicecall_get_next_callid(struct 
 ofono_voicecall *vc)
  ofono_bool_t __ofono_voicecall_is_busy(struct ofono_voicecall *vc,
   enum ofono_voicecall_interaction type)
  {
 - if (vc-pending)
 + if (vc-pending || vc-dial_req)
   return TRUE;
  
   switch (type) {

This particular change breaks __ofono_voicecall_dial which would return
EBUSY in all cases as a result.

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


Please comment on callhistory API

2010-09-23 Thread rajyalakshmi bommaraju

Hello,
Attached Callhistory API , please send me your feedback on it, I will 
extend this include SmsHistory once callhistory API looks good.


Thanks
Raji

Callhistory 
Adapter-Agent


CallHistoryAdapter is a built in plugin for ofono. It uses 
CallHistoryAgent api exposed by dialer or client daemon to push voice call 
history information to client. CallHistoryAgent api is an service interface 
exposed by client over dbus. Plugin exposes CallHistoryAdapter interface that 
CallHistoryAgent registers and unregisters with. if the CallHistoryAgent 
registers with Adapter then plugin pushes the history information to dialer as 
soon as it receives from ofono, otherwise it caches the data in a disk file 
until agent registers, once agent registers plugin will read the data from the 
disk file and pushes all the records to it.


Adapter: 

it is going to register and unregister the agent. Calls the methods on the 
agent for delivering history information whent the agent is up and running. If 
the record cant be delivered that means agent method returns an error then it 
will be written to the disk file. If the agent is down it will persist history 
record in disk file.


CallHistoryAdapter hierarchy


Service : org.ofono
Interface   : org.ofono.CallHistoryAdapter
Object path : freely definable

Methods void RegisterAgent (objectpath)  

RegisterAgent method registers the agent object path. 
Methods on this agent will be called if history needs to push data.  

Possible Errors: [service].Error.InvalidArguments
 [service].Error.InvalidFormat
 [service].Error.InUse

void UnregisterAgent (objectpath) 

UnregisterAgent method unregister the already 
registered agent object path.

Possible Errors: [service].Error.InvalidArguments
 [service].Error.InvalidFormat
 [service].Error.InUse


CallHistoryAgent hierarchy
==

Service Name: Unique Name
Interface   : org.ofono.CallHistoryAgent
Objectpath  : Freely definable

Methods void SendHistory(array {struct 
{uint32,uint32,uint8,uint32,uint32} }) 

This method gets called by ofono to deliver one record 
of voice call history.

Possible Errors: [service].Error.Unsuccessful

void SendCachedHistory(array {struct 
{uint32,uint32,uint8,uint32,uint32} })

This method gets called by the ofono when 
CallHistoryAgent starts running. 
It delivers all the history records as an array of 
structures.

Possible Errors: [service].Error.Unsuccessful

void Release() 
Cleans up agent, assumes that agent is already 
unregistered, so not needed to unregister. 

CallHistory Record 

 
CallHistoryRecord {
uint32  uid;
uint8   voicecalltype;
charlineid[20];
uint32  starttime;
uint32  endtime;
}

voicecalltype {
outgoing = 0,
incoming = 1,
missed = 2
}

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


Re: Please comment on callhistory API

2010-09-23 Thread Marcel Holtmann
Hi Raji,

 Attached Callhistory API , please send me your feedback on it, I will 
 extend this include SmsHistory once callhistory API looks good.

please include such text in the email and not as attachment. We wanna
review it and not bother with just having to save it to disk first, then
copy it back into the response email to have to comment on it. I prefer
reading this and patches directly in my email client.

   Callhistory 
 Adapter-Agent
 
 
   CallHistoryAdapter is a built in plugin for ofono. It uses 
 CallHistoryAgent api exposed by dialer or client daemon to push voice call 
 history information to client. CallHistoryAgent api is an service interface 
 exposed by client over dbus. Plugin exposes CallHistoryAdapter interface that 
 CallHistoryAgent registers and unregisters with. if the CallHistoryAgent 
 registers with Adapter then plugin pushes the history information to dialer 
 as soon as it receives from ofono, otherwise it caches the data in a disk 
 file until agent registers, once agent registers plugin will read the data 
 from the disk file and pushes all the records to it.
 
 
 Adapter: 
 
 it is going to register and unregister the agent. Calls the methods on the 
 agent for delivering history information whent the agent is up and running. 
 If the record cant be delivered that means agent method returns an error then 
 it will be written to the disk file. If the agent is down it will persist 
 history record in disk file.
 
 
 CallHistoryAdapter hierarchy
 
 
 Service   : org.ofono
 Interface : org.ofono.CallHistoryAdapter
 Object path   : freely definable

What is Adapter meaning here. Just CallHistory would be fine. And makes
is more consistent with STK Agent.

The object path is not freely definable. You do have to pick one.

 Methods   void RegisterAgent (objectpath)  
 
   RegisterAgent method registers the agent object path. 
 Methods on this agent will be called if history needs to push data.  
 
   Possible Errors: [service].Error.InvalidArguments
[service].Error.InvalidFormat
[service].Error.InUse

What is InvalidFormat? Fair enough, you copied this from STK Agent and
it uses this for invalid object path. I don't even think this is needed
at all since the D-Bus system daemon will ensure this, but fair enough
leave that in since STK Agent is using it similar. Consistency is good.

   void UnregisterAgent (objectpath) 
 
   UnregisterAgent method unregister the already 
 registered agent object path.
 
   Possible Errors: [service].Error.InvalidArguments
[service].Error.InvalidFormat
[service].Error.InUse
 
 
 CallHistoryAgent hierarchy
 ==
 
 Service Name  : Unique Name
 Interface : org.ofono.CallHistoryAgent
 Objectpath: Freely definable
 
 Methods   void SendHistory(array {struct 
 {uint32,uint32,uint8,uint32,uint32} }) 
 
   This method gets called by ofono to deliver one record 
 of voice call history.
   
   Possible Errors: [service].Error.Unsuccessful

Yeah. No way. Use a dictionary. We are not modeling some weird memory
structure via D-Bus. That is not extendable at all.

   void SendCachedHistory(array {struct 
 {uint32,uint32,uint8,uint32,uint32} })
 
   This method gets called by the ofono when 
 CallHistoryAgent starts running. 
   It delivers all the history records as an array of 
 structures.
 
   Possible Errors: [service].Error.Unsuccessful

No.

One method for both here. If the client calls RegisterAgent then at that
point you start sending out the cached history. No need to make a
differentiation here. The client doesn't care. It just needs to get the
information.

   void Release() 
   Cleans up agent, assumes that agent is already 
 unregistered, so not needed to unregister. 
 
 CallHistory Record 
 
  
 CallHistoryRecord {
   uint32  uid;
   uint8   voicecalltype;
   charlineid[20];
   uint32  starttime;
   uint32  endtime;
 }
 
 voicecalltype {
   outgoing = 0,
   incoming = 1,
   missed = 2
 }

Define proper dictionary key/type values pair like we do for property or
use inside the Messaging API already. Consistency.

New immediate (class 0) SMS received. Info has Sender,
LocalSentTime, and SentTime information.  Sender
address is given in string format.  LocalSentTime and
SentTime are given in string form using ISO8601 format.

So it defines already LocalSentTime, SentTime and Sender.