From: Jessica Nilsson <jessica.j.nilsson(a)stericsson.com>
---
drivers/isimodem/call-forwarding.c | 31 +++++++++++++++++++++++++++----
1 files changed, 27 insertions(+), 4 deletions(-)
diff --git a/drivers/isimodem/call-forwarding.c b/drivers/isimodem/call-forwarding.c
index 89a03dc..74645c3 100644
--- a/drivers/isimodem/call-forwarding.c
+++ b/drivers/isimodem/call-forwarding.c
@@ -212,6 +212,7 @@ static void isi_registration(struct ofono_call_forwarding *cf, int
type,
int ss_code;
int num_filler;
char *ucs2 = NULL;
+ GIsiModem *modem;
unsigned char msg[100] = {
SS_SERVICE_REQ,
@@ -230,11 +231,17 @@ static void isi_registration(struct ofono_call_forwarding *cf, int
type,
/* Followed by number in UCS-2, zero sub address bytes, and 0
* to 3 bytes of filler */
- DBG("forwarding type %d class %d\n", type, cls);
if (cbd == NULL || fd == NULL || strlen(number->number) > 28)
goto error;
+ DBG("forwarding type %d class %d\n", type, cls);
+ modem = g_isi_client_modem(fd->client);
+
+ if (g_isi_modem_version_major(modem) == 2 &&
+ g_isi_modem_version_minor(modem) >= 0)
+ msg[10] = SS_UNDEFINED_TIME;
+
ss_code = forw_type_to_isi_code(type);
if (ss_code < 0)
goto error;
@@ -248,6 +255,10 @@ static void isi_registration(struct ofono_call_forwarding *cf, int
type,
msg[8] = 6 + 2 * strlen(number->number) + num_filler;
+ /* Time must not be set for any other than NoReply for ISI2.5 */
+ if (ss_code == SS_GSM_FORW_NO_REPLY)
+ msg[10] = time;
+
ucs2 = g_convert(number->number, strlen(number->number), "UCS-2BE",
"UTF-8//TRANSLIT", NULL, NULL, NULL);
if (ucs2 == NULL)
@@ -330,10 +341,12 @@ error:
static void query_resp_cb(const GIsiMessage *msg, void *data)
{
-
struct isi_cb_data *cbd = data;
ofono_call_forwarding_query_cb_t cb = cbd->cb;
+ struct ofono_call_forwarding *cf = cbd->user;
+ struct forw_data *fd = ofono_call_forwarding_get_data(cf);
GIsiSubBlockIter iter;
+ GIsiModem *modem;
struct ofono_call_forwarding_condition list = {
.status = 0,
@@ -366,8 +379,17 @@ static void query_resp_cb(const GIsiMessage *msg, void *data)
&number))
goto error;
- /* As in 27.007 section 7.11 */
- list.status = status & SS_GSM_ACTIVE;
+ modem = g_isi_client_modem(fd->client);
+
+ if (g_isi_modem_version_major(modem) == 2 &&
+ g_isi_modem_version_minor(modem) >= 0) {
+ list.status = status & (SS_GSM_ACTIVE |
+ SS_GSM_REGISTERED |
+ SS_GSM_PROVISIONED);
+ } else {
+ /* As in 27.007 section 7.11 */
+ list.status = status & SS_GSM_ACTIVE;
+ }
list.time = noreply;
list.phone_number.type = ton | 0x80;
@@ -447,6 +469,7 @@ static int isi_call_forwarding_probe(struct ofono_call_forwarding
*cf,
return -ENOMEM;
fd->client = g_isi_client_create(modem, PN_SS);
+
if (fd->client == NULL) {
g_free(fd);
return -ENOMEM;
--
1.7.3.5