Skip to contentSkip to conversation

Voice call SS notifications

PATCH In review Andras Domokos 3 participants 14 messages Feb 9, 2011 – Feb 24, 2011

lore
Share & tools
lore
#0 lore raw

cover Voice call SS notifications

Here are the implementation proposal for handling some of the voice call related Supplementary Services notifications.

Implementation details:
- removed the +CSSI type SS notifications handling from the call-barring code
- expanded the SS notify functions with call number info, useful for modems capable of delivering it in the SS notifications
- expanded the SS callback functions with call number info and service code, useful in demultiplexing when a common callback function is defined for multiple service codes
- added +CSSU and +CSSI type SS notifications handling to the voicecall code

The API level detailed changes are explained in the doc files.

Andras Domokos (3):
call-barring: removed +CSSI type SS notifications
ssn: add code and call id to notifications
voicecall: handle voice call SS notifications

 drivers/atmodem/ssn.c |    4 +-
 include/ssn.h         |    7 +-
 include/types.h       |    2 +
 src/call-barring.c    |   74 ---------------
 src/ofono.h           |    6 +-
 src/ssn.c             |   11 +-
 src/voicecall.c       |  242 ++++++++++++++++++++++++++++++++++++++++++++++++-
 7 files changed, 257 insertions(+), 89 deletions(-)
#1 lore raw

RFC PATCH 1/3 call-barring: removed +CSSI type SS notifications

---
 src/call-barring.c |   74 ----------------------------------------------------
 1 files changed, 0 insertions(+), 74 deletions(-)
src/call-barring.c +0 -74
index 649826e..84ed277 100644
@@ -58,9 +58,6 @@ struct ofono_call_barring {
 	int ss_req_lock;
 	struct ofono_ssn *ssn;
 	struct ofono_ussd *ussd;
-	unsigned int incoming_bar_watch;
-	unsigned int outgoing_bar_watch;
-	unsigned int ssn_watch;
 	unsigned int ussd_watch;
 	const struct ofono_call_barring_driver *driver;
 	void *driver_data;
@@ -987,41 +984,10 @@ static GDBusMethodTable cb_methods[] = {
 };
 
 static GDBusSignalTable cb_signals[] = {
-	{ "IncomingBarringInEffect",	"" },
-	{ "OutgoingBarringInEffect",	"" },
 	{ "PropertyChanged",		"sv" },
 	{ }
 };
 
-static void call_barring_incoming_enabled_notify(int idx, void *userdata)
-{
-	struct ofono_call_barring *cb = userdata;
-	DBusConnection *conn = ofono_dbus_get_connection();
-	const char *path = __ofono_atom_get_path(cb->atom);
-
-	g_dbus_emit_signal(conn, path, OFONO_CALL_BARRING_INTERFACE,
-			"IncomingBarringInEffect", DBUS_TYPE_INVALID);
-}
-
-static void call_barring_outgoing_enabled_notify(int idx, void *userdata)
-{
-	struct ofono_call_barring *cb = userdata;
-	DBusConnection *conn = ofono_dbus_get_connection();
-	const char *path = __ofono_atom_get_path(cb->atom);
-	DBusMessage *signal;
-
-	signal = dbus_message_new_signal(path, OFONO_CALL_BARRING_INTERFACE,
-						"OutgoingBarringInEffect");
-
-	if (signal == NULL) {
-		ofono_error("Unable to allocate new %s.OutgoingBarringInEffect"
-				" signal", OFONO_CALL_BARRING_INTERFACE);
-		return;
-	}
-
-	g_dbus_send_message(conn, signal);
-}
-
 int ofono_call_barring_driver_register(const struct ofono_call_barring_driver *d)
 {
 	DBG("driver: %p, name: %s", d, d->name);
@@ -1054,14 +1020,6 @@ static void call_barring_unregister(struct ofono_atom *atom)
 	if (cb->ussd)
 		cb_unregister_ss_controls(cb);
 
-	if (cb->incoming_bar_watch)
-		__ofono_ssn_mo_watch_remove(cb->ssn, cb->incoming_bar_watch);
-	if (cb->outgoing_bar_watch)
-		__ofono_ssn_mt_watch_remove(cb->ssn, cb->outgoing_bar_watch);
-
-	if (cb->ssn_watch)
-		__ofono_modem_remove_atom_watch(modem, cb->ssn_watch);
-
 	if (cb->ussd_watch)
 		__ofono_modem_remove_atom_watch(modem, cb->ussd_watch);
 }
@@ -1116,29 +1074,6 @@ struct ofono_call_barring *ofono_call_barring_create(struct ofono_modem *modem,
 	return cb;
 }
 
-static void ssn_watch(struct ofono_atom *atom,
-			enum ofono_atom_watch_condition cond, void *data)
-{
-	struct ofono_call_barring *cb = data;
-
-	if (cond == OFONO_ATOM_WATCH_CONDITION_UNREGISTERED) {
-		cb->ssn = NULL;
-		cb->incoming_bar_watch = 0;
-		cb->outgoing_bar_watch = 0;
-		return;
-	}
-
-	cb->ssn = __ofono_atom_get_data(atom);
-
-	cb->incoming_bar_watch =
-		__ofono_ssn_mo_watch_add(cb->ssn, SS_MO_INCOMING_BARRING,
-				call_barring_incoming_enabled_notify, cb, NULL);
-
-	cb->outgoing_bar_watch =
-		__ofono_ssn_mo_watch_add(cb->ssn, SS_MO_OUTGOING_BARRING,
-				call_barring_outgoing_enabled_notify, cb, NULL);
-}
-
 static void ussd_watch(struct ofono_atom *atom,
 			enum ofono_atom_watch_condition cond, void *data)
 {
@@ -1158,7 +1093,6 @@ void ofono_call_barring_register(struct ofono_call_barring *cb)
 	DBusConnection *conn = ofono_dbus_get_connection();
 	const char *path = __ofono_atom_get_path(cb->atom);
 	struct ofono_modem *modem = __ofono_atom_get_modem(cb->atom);
-	struct ofono_atom *ssn_atom;
 	struct ofono_atom *ussd_atom;
 
 	if (!g_dbus_register_interface(conn, path,
@@ -1173,14 +1107,6 @@ void ofono_call_barring_register(struct ofono_call_barring *cb)
 
 	ofono_modem_add_interface(modem, OFONO_CALL_BARRING_INTERFACE);
 
-	cb->ssn_watch = __ofono_modem_add_atom_watch(modem, OFONO_ATOM_TYPE_SSN,
-					ssn_watch, cb, NULL);
-
-	ssn_atom = __ofono_modem_find_atom(modem, OFONO_ATOM_TYPE_SSN);
-
-	if (ssn_atom && __ofono_atom_get_registered(ssn_atom))
-		ssn_watch(ssn_atom, OFONO_ATOM_WATCH_CONDITION_REGISTERED, cb);
-
 	cb->ussd_watch = __ofono_modem_add_atom_watch(modem,
 					OFONO_ATOM_TYPE_USSD,
 					ussd_watch, cb, NULL);
Signature · 1 line
1.7.0.4
#2 lore raw

Re: [RFC PATCH 1/3] call-barring: removed +CSSI type SS notifications

Hi Andras

src/call-barring.c struct ofono_call_barring { · line 59

Quoted 11 lines · Andras Domokos
---
 src/call-barring.c |   74 ----------------------------------------------------
 1 files changed, 0 insertions(+), 74 deletions(-)
src/call-barring.c +0 -0
index 649826e..84ed277 100644
@@ -58,9 +58,6 @@ struct ofono_call_barring {
 	int ss_req_lock;
 	struct ofono_ssn *ssn;

You forgot to remove this part in your patch. I applied your patch and fixed this in a follow on patch.

src/call-barring.c struct ofono_call_barring { · line 63

Quoted 7 lines
src/call-barring.c +0 -3
 	struct ofono_ussd *ussd;
-	unsigned int incoming_bar_watch;
-	unsigned int outgoing_bar_watch;
-	unsigned int ssn_watch;
 	unsigned int ussd_watch;
 	const struct ofono_call_barring_driver *driver;
 	void *driver_data;

Regards,
-Denis

#3 lore raw

Re: [RFC PATCH 1/3] call-barring: removed +CSSI type SS notifications

Hi Denis,

Quoted 7 lines · ext Denis Kenzior

Hi Andras

Quoted 4 lines · Andras Domokos
---
  src/call-barring.c |   74 ----------------------------------------------------
  1 files changed, 0 insertions(+), 74 deletions(-)
Quoted 9 lines

src/call-barring.c struct ofono_call_barring { · line 59

Quoted 7 lines
src/call-barring.c +0 -0
index 649826e..84ed277 100644
@@ -58,9 +58,6 @@ struct ofono_call_barring {
  	int ss_req_lock;
  	struct ofono_ssn *ssn;

You forgot to remove this part in your patch. I applied your patch and fixed this in a follow on patch.

Indeed I did. Thanks a lot for the fix!

Quoted 9 lines

src/call-barring.c struct ofono_call_barring { · line 63

Quoted 7 lines
src/call-barring.c +0 -3
  	struct ofono_ussd *ussd;
-	unsigned int incoming_bar_watch;
-	unsigned int outgoing_bar_watch;
-	unsigned int ssn_watch;
  	unsigned int ussd_watch;
  	const struct ofono_call_barring_driver *driver;
  	void *driver_data;

Regards,
-Denis

Regards,
Andras

#4 lore raw

RFC PATCH 2/3 ssn: add code and call id to notifications

In reply to Andras Domokos
---
 drivers/atmodem/ssn.c |    4 ++--
 include/ssn.h         |    7 ++++---
 src/ofono.h           |    6 ++++--
 src/ssn.c             |   11 ++++++-----
 4 files changed, 16 insertions(+), 12 deletions(-)
drivers/atmodem/ssn.c +2 -2
index b7a9df4..b00871d 100644
@@ -56,7 +56,7 @@ static void cssi_notify(GAtResult *result, gpointer user_data)
 	if (!g_at_result_iter_next_number(&iter, &index))
 		index = 0;
 
-	ofono_ssn_cssi_notify(ssn, code1, index);
+	ofono_ssn_cssi_notify(ssn, 0, code1, index);
 }
 
 static void cssu_notify(GAtResult *result, gpointer user_data)
@@ -93,7 +93,7 @@ static void cssu_notify(GAtResult *result, gpointer user_data)
 		return;
 
 out:
-	ofono_ssn_cssu_notify(ssn, code2, index, &ph);
+	ofono_ssn_cssu_notify(ssn, 0, code2, index, &ph);
 }
 
 static void at_ssn_initialized(gboolean ok, GAtResult *result,
include/ssn.h +4 -3
index d640cad..ba3701b 100644
@@ -37,9 +37,10 @@ struct ofono_ssn_driver {
 };
 
 /* SSN notifications (CSSI and CSSU).  */
-void ofono_ssn_cssi_notify(struct ofono_ssn *ssn, int code, int index);
-void ofono_ssn_cssu_notify(struct ofono_ssn *ssn, int code, int index,
-				const struct ofono_phone_number *number);
+void ofono_ssn_cssi_notify(struct ofono_ssn *ssn, unsigned int id,
+				int code1, int index);
+void ofono_ssn_cssu_notify(struct ofono_ssn *ssn, unsigned int id, int code2,
+			int index, const struct ofono_phone_number *number);
 
 int ofono_ssn_driver_register(const struct ofono_ssn_driver *d);
 void ofono_ssn_driver_unregister(const struct ofono_ssn_driver *d);
src/ofono.h +4 -2
index 6ba0187..eafab21 100644
@@ -314,8 +314,10 @@ int __ofono_sms_sim_download(struct ofono_stk *stk, const struct sms *msg,
 
 #include <ofono/ssn.h>
 
-typedef void (*ofono_ssn_mo_notify_cb)(int index, void *user);
-typedef void (*ofono_ssn_mt_notify_cb)(int index,
+typedef void (*ofono_ssn_mo_notify_cb)(unsigned int id, int code1, int index,
+					void *user);
+
+typedef void (*ofono_ssn_mt_notify_cb)(unsigned int id, int code2, int index,
 					const struct ofono_phone_number *ph,
 					void *user);
 
src/ssn.c +6 -5
index 64c94b7..065e4fd 100644
@@ -112,7 +112,8 @@ gboolean __ofono_ssn_mt_watch_remove(struct ofono_ssn *ssn, unsigned int id)
 	return __ofono_watchlist_remove_item(ssn->mt_handler_list, id);
 }
 
-void ofono_ssn_cssi_notify(struct ofono_ssn *ssn, int code1, int index)
+void ofono_ssn_cssi_notify(struct ofono_ssn *ssn, unsigned int id,
+				int code1, int index)
 {
 	struct ssn_handler *h;
 	GSList *l;
@@ -123,12 +124,12 @@ void ofono_ssn_cssi_notify(struct ofono_ssn *ssn, int code1, int index)
 		notify = h->item.notify;
 
 		if (h->code == code1)
-			notify(index, h->item.notify_data);
+			notify(id, code1, index, h->item.notify_data);
 	}
 }
 
-void ofono_ssn_cssu_notify(struct ofono_ssn *ssn, int code2, int index,
-				const struct ofono_phone_number *ph)
+void ofono_ssn_cssu_notify(struct ofono_ssn *ssn, unsigned int id, int code2,
+				int index, const struct ofono_phone_number *ph)
 {
 	struct ssn_handler *h;
 	GSList *l;
@@ -139,7 +140,7 @@ void ofono_ssn_cssu_notify(struct ofono_ssn *ssn, int code2, int index,
 		notify = h->item.notify;
 
 		if (h->code == code2)
-			notify(index, ph, h->item.notify_data);
+			notify(id, code2, index, ph, h->item.notify_data);
 	}
 }
 
Signature · 1 line
1.7.0.4
#5 lore raw

Re: [RFC PATCH 2/3] ssn: add code and call id to notifications

Hi Andras,

Quoted 8 lines
include/ssn.h +0 -0
index d640cad..ba3701b 100644
@@ -37,9 +37,10 @@ struct ofono_ssn_driver {
 };
 
 /* SSN notifications (CSSI and CSSU).  */

include/ssn.h struct ofono_ssn_driver { · line 46

Quoted 10 lines
include/ssn.h +4 -3
-void ofono_ssn_cssi_notify(struct ofono_ssn *ssn, int code, int index);
-void ofono_ssn_cssu_notify(struct ofono_ssn *ssn, int code, int index,
-				const struct ofono_phone_number *number);
+void ofono_ssn_cssi_notify(struct ofono_ssn *ssn, unsigned int id,
+				int code1, int index);
+void ofono_ssn_cssu_notify(struct ofono_ssn *ssn, unsigned int id, int code2,
+			int index, const struct ofono_phone_number *number);
 
 int ofono_ssn_driver_register(const struct ofono_ssn_driver *d);
 void ofono_ssn_driver_unregister(const struct ofono_ssn_driver *d);

Right now I'm not seeing any users (or even potential ones) of the SSN atom besides voicecall. What do you think of removing the SSN atom and moving these to the voicecall atom?

The only one I'm not sure about is <code2> from 27.007:
6 forward check SS message received (can be received whenever)

Any idea what this one is about?

Regards,
-Denis

#6 lore raw

Re: [RFC PATCH 2/3] ssn: add code and call id to notifications

Hi Denis,

Quoted 18 lines · ext Denis Kenzior

Hi Andras,

Quoted 16 lines
include/ssn.h +4 -3
index d640cad..ba3701b 100644
@@ -37,9 +37,10 @@ struct ofono_ssn_driver {
  };
 
  /* SSN notifications (CSSI and CSSU).  */
-void ofono_ssn_cssi_notify(struct ofono_ssn *ssn, int code, int index);
-void ofono_ssn_cssu_notify(struct ofono_ssn *ssn, int code, int index,
-				const struct ofono_phone_number *number);
+void ofono_ssn_cssi_notify(struct ofono_ssn *ssn, unsigned int id,
+				int code1, int index);
+void ofono_ssn_cssu_notify(struct ofono_ssn *ssn, unsigned int id, int code2,
+			int index, const struct ofono_phone_number *number);
 
Quoted 5 lines

include/ssn.h struct ofono_ssn_driver { · line 46

Quoted 2 lines
include/ssn.h +0 -0
  int ofono_ssn_driver_register(const struct ofono_ssn_driver *d);
  void ofono_ssn_driver_unregister(const struct ofono_ssn_driver *d);

Right now I'm not seeing any users (or even potential ones) of the SSN atom besides voicecall. What do you think of removing the SSN atom and moving these to the voicecall atom?

Yes, we talked about removing the SSN atom, but I thought I would keep it for now, it can be removed any time later, anyways, doesn't save much removing it.

Quoted 5 lines

The only one I'm not sure about is<code2> from 27.007:
6 forward check SS message received (can be received whenever)

Any idea what this one is about?

Never encountered this message, and I am not sure what is it for. A patch for handling this message can be submitted later, if a real life case is found for it.

Quoted 2 lines

Regards,
-Denis

Regards,
Andras

#7 lore raw

Re: [RFC PATCH 2/3] ssn: add code and call id to notifications

Hi Denis/Andras,

Is this patch applied and available in the GIT?

Regards,
Sankar.

Quoted 57 lines · Andras Domokos

Hi Denis,

Quoted 20 lines · ext Denis Kenzior

Hi Andras,

diff --git a/include/ssn.h b/include/ssn.h

Quoted 17 lines

index d640cad..ba3701b 100644

include/ssn.h +4 -3
@@ -37,9 +37,10 @@ struct ofono_ssn_driver {
 };
 
 /* SSN notifications (CSSI and CSSU).  */
-void ofono_ssn_cssi_notify(struct ofono_ssn *ssn, int code, int index);
-void ofono_ssn_cssu_notify(struct ofono_ssn *ssn, int code, int index,
-                               const struct ofono_phone_number *number);
+void ofono_ssn_cssi_notify(struct ofono_ssn *ssn, unsigned int id,
+                               int code1, int index);
+void ofono_ssn_cssu_notify(struct ofono_ssn *ssn, unsigned int id, int
 code2,
+                       int index, const struct ofono_phone_number
 *number);
 
Quoted 7 lines
Quoted 3 lines

int ofono_ssn_driver_register(const struct ofono_ssn_driver *d); void ofono_ssn_driver_unregister(const struct ofono_ssn_driver *d);

Right now I'm not seeing any users (or even potential ones) of the SSN atom besides voicecall. What do you think of removing the SSN atom and moving these to the voicecall atom?

Yes, we talked about removing the SSN atom, but I thought I would keep it for now, it can be removed any time later, anyways, doesn't save much removing it.

The only one I'm not sure about is<code2> from 27.007:

Quoted 5 lines

6 forward check SS message received (can be received whenever)

Any idea what this one is about?

Never encountered this message, and I am not sure what is it for.

A patch for handling this message can be submitted later, if a real life case is found for it.

Regards,

Quoted 2 lines

-Denis

Regards,
Andras

_______________________________________________
ofono mailing list
ofono(a)ofono.org
http://lists.ofono.org/listinfo/ofono

#8 lore raw

Re: [RFC PATCH 2/3] ssn: add code and call id to notifications

Hi Denis and Sankar,

The call SS notification handling patches hasn't been (fully) applied, I think we need to do something about it.

Regards,
Andras

Quoted 77 lines · ext Sankar

Hi Denis/Andras,

Is this patch applied and available in the GIT?

Regards,
Sankar.

On Thu, Feb 10, 2011 at 2:42 PM, Andras Domokos <andras.domokos(a)nokia.com <mailto:[email protected]>> wrote:

Hi Denis,

On 02/10/2011 05:08 AM, ext Denis Kenzior wrote:

Hi Andras,

diff --git a/include/ssn.h b/include/ssn.h index d640cad..ba3701b 100644
--- a/include/ssn.h
+++ b/include/ssn.h
@@ -37,9 +37,10 @@ struct ofono_ssn_driver {
};

/* SSN notifications (CSSI and CSSU). */
-void ofono_ssn_cssi_notify(struct ofono_ssn *ssn, int code, int index);
-void ofono_ssn_cssu_notify(struct ofono_ssn *ssn, int code, int index,
- const struct
ofono_phone_number *number);
+void ofono_ssn_cssi_notify(struct ofono_ssn *ssn, unsigned int id,
+ int code1, int index);
+void ofono_ssn_cssu_notify(struct ofono_ssn *ssn, unsigned int id, int code2,
+ int index, const struct
ofono_phone_number *number);

int ofono_ssn_driver_register(const struct
ofono_ssn_driver *d);
void ofono_ssn_driver_unregister(const struct
ofono_ssn_driver *d);

Right now I'm not seeing any users (or even potential ones) of the SSN
atom besides voicecall. What do you think of removing the SSN atom and
moving these to the voicecall atom?

Yes, we talked about removing the SSN atom, but I thought I would keep it for now, it can be removed any time later, anyways, doesn't save much removing it.

The only one I'm not sure about is<code2> from 27.007:
6 forward check SS message received (can be received
whenever)

Any idea what this one is about?

Never encountered this message, and I am not sure what is it for. A patch for handling this message can be submitted later, if a real life case is found for it.

Regards,
-Denis

Regards,
Andras

_______________________________________________
ofono mailing list
ofono(a)ofono.org <mailto:[email protected]>
http://lists.ofono.org/listinfo/ofono

#9 lore raw

Re: [RFC PATCH 2/3] ssn: add code and call id to notifications

Hi Andras,

Please no top posting on this mailing list. You should know this by now.

Quoted 5 lines · Andras Domokos

Hi Denis and Sankar,

The call SS notification handling patches hasn't been (fully) applied, I think we need to do something about it.

I'd still like a version with the SSN atom removed.

Regards,
-Denis

#10 lore raw

Re: [RFC PATCH 2/3] ssn: add code and call id to notifications

Hi,

Quoted 3 lines · ext Denis Kenzior

Hi Andras,

Please no top posting on this mailing list. You should know this by now.

I am terribly sorry, I know I should have not done that.

Quoted 7 lines · Andras Domokos
Quoted 5 lines

Hi Denis and Sankar,

The call SS notification handling patches hasn't been (fully) applied, I think we need to do something about it.

I'd still like a version with the SSN atom removed.

OK, I am going to remove the SSN atom, not a big deal, but do you have any other issues at this point?

Quoted 2 lines

Regards,
-Denis

Regards,
Andras

#11 lore raw

Re: [RFC PATCH 2/3] ssn: add code and call id to notifications

Hi Andras,

Quoted 6 lines
Quoted 4 lines
Quoted 3 lines

The call SS notification handling patches hasn't been (fully) applied, I think we need to do something about it.

I'd still like a version with the SSN atom removed.

OK, I am going to remove the SSN atom, not a big deal, but do you have any other issues at this point?

Not right now. Your API proposal is already upstream, I just didn't like the ssn atom being kept around.

Regards,
-Denis

#12 lore raw

Re: [RFC PATCH 2/3] ssn: add code and call id to notifications

Hi Denis,

Quoted 10 lines · ext Denis Kenzior

Hi Andras,

Quoted 6 lines
Quoted 4 lines
Quoted 3 lines

The call SS notification handling patches hasn't been (fully) applied, I think we need to do something about it.

I'd still like a version with the SSN atom removed.

OK, I am going to remove the SSN atom, not a big deal, but do you have any other issues at this point?

Not right now. Your API proposal is already upstream, I just didn't like the ssn atom being kept around.

OK, I'll prepare the patches with the SSN atom removed.

Quoted 2 lines

Regards,
-Denis

Regards,
Andras

#13 lore raw

RFC PATCH 3/3 voicecall: handle voice call SS notifications

In reply to Andras Domokos
---
 include/types.h |    2 +
 src/voicecall.c |  242 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 241 insertions(+), 3 deletions(-)
include/types.h +2 -0
index d25f409..b639c8a 100644
@@ -96,6 +96,8 @@ struct ofono_call {
 	char name[OFONO_MAX_CALLER_NAME_LENGTH + 1];
 	int clip_validity;
 	int cnap_validity;
+	ofono_bool_t remote_held;
+	ofono_bool_t remote_multiparty;
 };
 
 struct ofono_network_time {
src/voicecall.c +239 -3

290 lines not on this page · raw message

Signature · 1 line
1.7.0.4