Voice call SS notifications (3rd version)
cover Voice call SS notifications (3rd version)
Implementation proposal for handling some of the voice call related Supplementary Services (SS) notifications.
Implementation details:
- removed SSN atom
- (re)implemented voice call SS notification handling framework
- added voice call SS notification handling to AT modem driver (+CSSU and +CSSI notifications)
Andras Domokos (3):
ssn: remove SSN atom completely
voicecall: add SSN handling functions
atmodem: add SSN handling
Makefile.am | 6 +- drivers/atmodem/atmodem.c | 2 - drivers/atmodem/atmodem.h | 3 - drivers/atmodem/ssn.c | 147 ------------------------- drivers/atmodem/voicecall.c | 61 +++++++++++ drivers/isimodem/isimodem.c | 2 - drivers/isimodem/isimodem.h | 3 - drivers/isimodem/ssn.c | 95 ----------------- include/ssn.h | 61 ----------- include/types.h | 2 + include/voicecall.h | 6 + plugins/calypso.c | 2 - plugins/g1.c | 2 - plugins/huawei.c | 2 - plugins/ifx.c | 2 - plugins/isiusb.c | 2 - plugins/linktop.c | 2 - plugins/n900.c | 2 - plugins/phonesim.c | 2 - plugins/ste.c | 2 - plugins/tc65.c | 2 - plugins/u8500.c | 2 - plugins/wavecom.c | 2 - src/ofono.h | 17 --- src/ssn.c | 247 ------------------------------------------- src/voicecall.c | 156 +++++++++++++++++++++++++++ 26 files changed, 227 insertions(+), 605 deletions(-) delete mode 100644 drivers/atmodem/ssn.c delete mode 100644 drivers/isimodem/ssn.c delete mode 100644 include/ssn.h delete mode 100644 src/ssn.c
RFC PATCH 1/3 ssn: remove SSN atom completely
--- Makefile.am | 6 +- drivers/atmodem/atmodem.c | 2 - drivers/atmodem/atmodem.h | 3 - drivers/atmodem/ssn.c | 147 ------------------------- drivers/isimodem/isimodem.c | 2 - drivers/isimodem/isimodem.h | 3 - drivers/isimodem/ssn.c | 95 ----------------- include/ssn.h | 61 ----------- plugins/calypso.c | 2 - plugins/g1.c | 2 - plugins/huawei.c | 2 - plugins/ifx.c | 2 - plugins/isiusb.c | 2 - plugins/linktop.c | 2 - plugins/n900.c | 2 - plugins/phonesim.c | 2 - plugins/ste.c | 2 - plugins/tc65.c | 2 - plugins/u8500.c | 2 - plugins/wavecom.c | 2 - src/ofono.h | 17 --- src/ssn.c | 247 ------------------------------------------- 22 files changed, 2 insertions(+), 605 deletions(-) delete mode 100644 drivers/atmodem/ssn.c delete mode 100644 drivers/isimodem/ssn.c delete mode 100644 include/ssn.h delete mode 100644 src/ssn.c
Makefile.am +2 -4
@@ -5,7 +5,7 @@ pkginclude_HEADERS = include/log.h include/plugin.h include/history.h \ include/dbus.h include/modem.h include/types.h \ include/call-barring.h include/call-forwarding.h \ include/call-meter.h include/call-settings.h \ - include/phonebook.h include/ssn.h include/ussd.h \ + include/phonebook.h include/ussd.h \ include/sms.h include/sim.h include/message-waiting.h \ include/netreg.h include/voicecall.h include/devinfo.h \ include/cbs.h include/call-volume.h \
@@ -126,7 +126,6 @@ builtin_sources += $(gisi_sources) \ drivers/isimodem/cbs.c \ drivers/isimodem/sim.c \ drivers/isimodem/sim.h \ - drivers/isimodem/ssn.c \ drivers/isimodem/ussd.c \ drivers/isimodem/call-forwarding.c \ drivers/isimodem/call-settings.c \
@@ -172,7 +171,6 @@ builtin_sources += $(gatchat_sources) \ drivers/atmodem/voicecall.c \ drivers/atmodem/call-barring.c \ drivers/atmodem/phonebook.c \ - drivers/atmodem/ssn.c \ drivers/atmodem/devinfo.c \ drivers/atmodem/call-volume.c \ drivers/atmodem/vendor.h \
@@ -372,7 +370,7 @@ src_ofonod_SOURCES = $(gdbus_sources) $(builtin_sources) src/ofono.ver \ src/network.c src/voicecall.c src/ussd.c src/sms.c \ src/call-settings.c src/call-forwarding.c \ src/call-meter.c src/smsutil.h src/smsutil.c \ - src/ssn.c src/call-barring.c src/sim.c src/stk.c \ + src/call-barring.c src/sim.c src/stk.c \ src/phonebook.c src/history.c src/message-waiting.c \ src/simutil.h src/simutil.c src/storage.h \ src/storage.c src/cbs.c src/watch.c src/call-volume.c \
drivers/atmodem/atmodem.c +0 -2
@@ -41,7 +41,6 @@ static int atmodem_init(void)at_call_meter_init ();at_call_settings_init ();at_phonebook_init (); -at_ssn_init ();at_ussd_init ();at_sms_init ();at_sim_init ();
@@ -63,7 +62,6 @@ static void atmodem_exit(void)at_sim_exit ();at_sms_exit ();at_ussd_exit (); -at_ssn_exit ();at_phonebook_exit ();at_call_settings_exit ();at_call_meter_exit ();
drivers/atmodem/atmodem.h +0 -3
@@ -54,9 +54,6 @@ extern void at_sms_exit(void);extern void at_phonebook_init (void );extern void at_phonebook_exit (void ); -extern void at_ssn_init (void ); -extern void at_ssn_exit (void ); -extern void at_devinfo_init (void );extern void at_devinfo_exit (void );
drivers/atmodem/ssn.c deleted +0 -147
147 lines not on this page · raw message
drivers/isimodem/isimodem.c +0 -2
@@ -44,7 +44,6 @@ static int isimodem_init(void)isi_sms_init ();isi_cbs_init ();isi_sim_init (); -isi_ssn_init ();isi_ussd_init ();isi_call_forwarding_init ();isi_call_settings_init ();
@@ -67,7 +66,6 @@ static void isimodem_exit(void)isi_sms_exit ();isi_cbs_exit ();isi_sim_exit (); -isi_ssn_exit ();isi_ussd_exit ();isi_call_forwarding_exit ();isi_call_settings_exit ();
drivers/isimodem/isimodem.h +0 -3
@@ -43,9 +43,6 @@ extern void isi_sim_exit(void);extern void isi_ussd_init (void );extern void isi_ussd_exit (void ); -extern void isi_ssn_init (void ); -extern void isi_ssn_exit (void ); -extern void isi_call_forwarding_init (void );extern void isi_call_forwarding_exit (void );
drivers/isimodem/ssn.c deleted +0 -95
95 lines not on this page · raw message
include/ssn.h deleted +0 -61
61 lines not on this page · raw message
plugins/calypso.c +0 -2
@@ -52,7 +52,6 @@#include <ofono/phonebook.h> #include <ofono/sim.h> #include <ofono/sms.h> -#include <ofono/ssn.h> #include <ofono/ussd.h> #include <ofono/voicecall.h> #include <ofono/stk.h>
@@ -534,7 +533,6 @@ static void calypso_post_sim(struct ofono_modem *modem) data->dlcs[NETREG_DLC]);ofono_call_meter_create (modem,0 ,"atmodem" , data->dlcs[AUX_DLC ]);ofono_call_barring_create (modem,0 ,"atmodem" , data->dlcs[AUX_DLC ]); -ofono_ssn_create (modem,0 ,"atmodem" , data->dlcs[AUX_DLC ]);ofono_call_volume_create (modem,0 ,"atmodem" , data->dlcs[AUX_DLC ]); mw =ofono_message_waiting_create (modem);
plugins/g1.c +0 -2
@@ -45,7 +45,6 @@#include <ofono/phonebook.h> #include <ofono/sim.h> #include <ofono/sms.h> -#include <ofono/ssn.h> #include <ofono/ussd.h> #include <ofono/voicecall.h>
@@ -184,7 +183,6 @@ static void g1_post_sim(struct ofono_modem *modem)ofono_netreg_create (modem,0 ,"atmodem" , chat);ofono_call_meter_create (modem,0 ,"atmodem" , chat);ofono_call_barring_create (modem,0 ,"atmodem" , chat); -ofono_ssn_create (modem,0 ,"atmodem" , chat);ofono_sms_create (modem,OFONO_VENDOR_QUALCOMM_MSM ,"atmodem" , chat);ofono_phonebook_create (modem,0 ,"atmodem" , chat);
plugins/huawei.c +0 -2
@@ -48,7 +48,6 @@#include <ofono/call-forwarding.h> #include <ofono/call-settings.h> #include <ofono/call-barring.h> -#include <ofono/ssn.h> #include <ofono/phonebook.h> #include <ofono/message-waiting.h> #include <ofono/log.h>
@@ -685,7 +684,6 @@ static void huawei_post_online(struct ofono_modem *modem)ofono_call_forwarding_create (modem,0 ,"atmodem" , data->pcui);ofono_call_settings_create (modem,0 ,"atmodem" , data->pcui);ofono_call_barring_create (modem,0 ,"atmodem" , data->pcui); -ofono_ssn_create (modem,0 ,"atmodem" , data->pcui); mw =ofono_message_waiting_create (modem);if (mw)
plugins/ifx.c +0 -2
@@ -47,7 +47,6 @@#include <ofono/call-settings.h> #include <ofono/call-volume.h> #include <ofono/message-waiting.h> -#include <ofono/ssn.h> #include <ofono/sim.h> #include <ofono/cbs.h> #include <ofono/sms.h>
@@ -717,7 +716,6 @@ static void ifx_post_online(struct ofono_modem *modem)ofono_cbs_create (modem,0 ,"atmodem" , data->dlcs[AUX_DLC ]);ofono_ussd_create (modem,0 ,"atmodem" , data->dlcs[AUX_DLC ]); -ofono_ssn_create (modem,0 ,"atmodem" , data->dlcs[AUX_DLC ]);ofono_call_settings_create (modem,0 ,"atmodem" , data->dlcs[AUX_DLC ]);ofono_call_meter_create (modem,0 ,"atmodem" , data->dlcs[AUX_DLC ]);ofono_call_barring_create (modem,0 ,"atmodem" , data->dlcs[AUX_DLC ]);
plugins/isiusb.c +0 -2
@@ -46,7 +46,6 @@#include <ofono/cbs.h> #include <ofono/sim.h> #include <ofono/ussd.h> -#include <ofono/ssn.h> #include <ofono/call-forwarding.h> #include <ofono/call-settings.h> #include <ofono/call-barring.h>
@@ -428,7 +427,6 @@ static void isiusb_post_online(struct ofono_modem *modem)ofono_netreg_create (modem,0 ,"wgmodem2.5" , isi->modem);ofono_sms_create (modem,0 ,"isimodem" , isi->modem);ofono_cbs_create (modem,0 ,"isimodem" , isi->modem); -ofono_ssn_create (modem,0 ,"isimodem" , isi->modem);ofono_ussd_create (modem,0 ,"isimodem" , isi->modem);ofono_call_settings_create (modem,0 ,"isimodem" , isi->modem);ofono_call_barring_create (modem,0 ,"isimodem" , isi->modem);
plugins/linktop.c +0 -2
@@ -44,7 +44,6 @@#include <ofono/sim.h> #include <ofono/cbs.h> #include <ofono/sms.h> -#include <ofono/ssn.h> #include <ofono/ussd.h> #include <ofono/call-volume.h> #include <ofono/voicecall.h>
@@ -313,7 +312,6 @@ static void linktop_post_online(struct ofono_modem *modem)ofono_netreg_create (modem,OFONO_VENDOR_MBM ,"atmodem" , data->control);ofono_call_meter_create (modem,0 ,"atmodem" , data->control);ofono_call_barring_create (modem,0 ,"atmodem" , data->control); -ofono_ssn_create (modem,0 ,"atmodem" , data->control);ofono_call_volume_create (modem,0 ,"atmodem" , data->control);ofono_cbs_create (modem,0 ,"atmodem" , data->control);
plugins/n900.c +0 -2
@@ -45,7 +45,6 @@#include <ofono/cbs.h> #include <ofono/sim.h> #include <ofono/ussd.h> -#include <ofono/ssn.h> #include <ofono/call-forwarding.h> #include <ofono/call-settings.h> #include <ofono/call-barring.h>
@@ -509,7 +508,6 @@ static void n900_post_online(struct ofono_modem *modem)ofono_netreg_create (modem,0 ,"isimodem" , isi->modem);ofono_sms_create (modem,0 ,"isimodem" , isi->modem);ofono_cbs_create (modem,0 ,"isimodem" , isi->modem); -ofono_ssn_create (modem,0 ,"isimodem" , isi->modem);ofono_ussd_create (modem,0 ,"isimodem" , isi->modem);ofono_call_settings_create (modem,0 ,"isimodem" , isi->modem);ofono_call_barring_create (modem,0 ,"isimodem" , isi->modem);
plugins/phonesim.c +0 -2
@@ -54,7 +54,6 @@#include <ofono/sim.h> #include <ofono/stk.h> #include <ofono/sms.h> -#include <ofono/ssn.h> #include <ofono/ussd.h> #include <ofono/voicecall.h> #include <ofono/gprs.h>
@@ -651,7 +650,6 @@ static void phonesim_post_online(struct ofono_modem *modem)ofono_call_meter_create (modem,0 ,"atmodem" , data->chat);ofono_call_barring_create (modem,0 ,"atmodem" , data->chat); -ofono_ssn_create (modem,0 ,"atmodem" , data->chat);ofono_call_volume_create (modem,0 ,"atmodem" , data->chat);if (!data->calypso)
plugins/ste.c +0 -2
@@ -50,7 +50,6 @@#include <ofono/sim.h> #include <ofono/cbs.h> #include <ofono/sms.h> -#include <ofono/ssn.h> #include <ofono/ussd.h> #include <ofono/call-volume.h> #include <ofono/voicecall.h>
@@ -430,7 +429,6 @@ static void ste_post_online(struct ofono_modem *modem)ofono_netreg_create (modem,OFONO_VENDOR_MBM ,"atmodem" , data->chat);ofono_call_meter_create (modem,0 ,"atmodem" , data->chat);ofono_call_barring_create (modem,0 ,"atmodem" , data->chat); -ofono_ssn_create (modem,0 ,"atmodem" , data->chat);ofono_call_volume_create (modem,0 ,"atmodem" , data->chat);ofono_cbs_create (modem,0 ,"atmodem" , data->chat);
plugins/tc65.c +0 -2
@@ -44,7 +44,6 @@#include <ofono/phonebook.h> #include <ofono/sim.h> #include <ofono/sms.h> -#include <ofono/ssn.h> #include <ofono/ussd.h> #include <ofono/voicecall.h>
@@ -208,7 +207,6 @@ static void tc65_post_online(struct ofono_modem *modem)ofono_netreg_create (modem,0 ,"atmodem" , chat);ofono_call_meter_create (modem,0 ,"atmodem" , chat);ofono_call_barring_create (modem,0 ,"atmodem" , chat); -ofono_ssn_create (modem,0 ,"atmodem" , chat); gprs =ofono_gprs_create (modem,0 ,"atmodem" , chat); gc =ofono_gprs_context_create (modem,0 ,"atmodem" , chat);
plugins/u8500.c +0 -2
@@ -48,7 +48,6 @@#include <ofono/cbs.h> #include <ofono/sim.h> #include <ofono/ussd.h> -#include <ofono/ssn.h> #include <ofono/call-forwarding.h> #include <ofono/call-settings.h> #include <ofono/call-barring.h>
@@ -460,7 +459,6 @@ static void u8500_post_online(struct ofono_modem *modem)ofono_netreg_create (modem,0 ,"wgmodem2.5" , isi->modem);ofono_sms_create (modem,0 ,"isimodem" , isi->modem);ofono_cbs_create (modem,0 ,"isimodem" , isi->modem); -ofono_ssn_create (modem,0 ,"isimodem" , isi->modem);ofono_ussd_create (modem,0 ,"isimodem" , isi->modem);ofono_call_settings_create (modem,0 ,"isimodem" , isi->modem);ofono_call_barring_create (modem,0 ,"isimodem" , isi->modem);
plugins/wavecom.c +0 -2
@@ -44,7 +44,6 @@#include <ofono/phonebook.h> #include <ofono/sim.h> #include <ofono/sms.h> -#include <ofono/ssn.h> #include <ofono/ussd.h> #include <ofono/voicecall.h>
@@ -156,7 +155,6 @@ static void wavecom_post_sim(struct ofono_modem *modem)ofono_netreg_create (modem,0 ,"atmodem" , chat);ofono_call_meter_create (modem,0 ,"atmodem" , chat);ofono_call_barring_create (modem,0 ,"atmodem" , chat); -ofono_ssn_create (modem,0 ,"atmodem" , chat);ofono_sms_create (modem,0 ,"atmodem" , chat);ofono_phonebook_create (modem,0 ,"atmodem" , chat);
src/ofono.h +0 -17
@@ -346,23 +346,6 @@ struct sms;int __ofono_sms_sim_download (struct ofono_stk *stk,const struct sms *msg,__ofono_sms_sim_download_cb_t cb,void *data); -#include <ofono/ssn.h> - -typedef void (*ofono_ssn_mo_notify_cb )(int index,void *user); -typedef void (*ofono_ssn_mt_notify_cb )(int index, -const struct ofono_phone_number *ph, -void *user); - -unsigned int __ofono_ssn_mo_watch_add (struct ofono_ssn *ssn,int code1, -ofono_ssn_mo_notify_cb cb,void *user, -ofono_destroy_func destroy); -gboolean __ofono_ssn_mo_watch_remove (struct ofono_ssn *ssn,unsigned int id); - -unsigned int __ofono_ssn_mt_watch_add (struct ofono_ssn *ssn,int code2, -ofono_ssn_mt_notify_cb cb,void *user, -ofono_destroy_func destroy); -gboolean __ofono_ssn_mt_watch_remove (struct ofono_ssn *ssn,unsigned int id); -#include <ofono/ussd.h> typedef gboolean (*ofono_ussd_ssc_cb_t)(int type,
src/ssn.c deleted +0 -247
247 lines not on this page · raw message
Signature · 1 line
1.7.0.4
Re: [RFC PATCH 1/3] ssn: remove SSN atom completely
Hi Andras,
Quoted 20 lines · Andras Domokos
--- Makefile.am | 6 +- drivers/atmodem/atmodem.c | 2 - drivers/atmodem/atmodem.h | 3 - drivers/atmodem/ssn.c | 147 ------------------------- drivers/isimodem/isimodem.c | 2 - drivers/isimodem/isimodem.h | 3 - drivers/isimodem/ssn.c | 95 ----------------- include/ssn.h | 61 ----------- plugins/calypso.c | 2 - plugins/g1.c | 2 - plugins/huawei.c | 2 - plugins/ifx.c | 2 - plugins/isiusb.c | 2 - plugins/linktop.c | 2 - plugins/n900.c | 2 - plugins/phonesim.c | 2 - plugins/ste.c | 2 - plugins/tc65.c | 2 - plugins/u8500.c | 2 -
Quoted 9 lines
plugins/wavecom.c | 2 - src/ofono.h | 17 --- src/ssn.c | 247 ------------------------------------------- 22 files changed, 2 insertions(+), 605 deletions(-) delete mode 100644 drivers/atmodem/ssn.c delete mode 100644 drivers/isimodem/ssn.c delete mode 100644 include/ssn.h delete mode 100644 src/ssn.c
Patch looks good but no longer applies due to changes that Aki pushed recently.
Regards,
-Denis
Re: [RFC PATCH 1/3] ssn: remove SSN atom completely
Hi Denis,
Quoted 32 lines · ext Denis Kenzior
Hi Andras,
Quoted 24 lines · Andras Domokos
--- Makefile.am | 6 +- drivers/atmodem/atmodem.c | 2 - drivers/atmodem/atmodem.h | 3 - drivers/atmodem/ssn.c | 147 ------------------------- drivers/isimodem/isimodem.c | 2 - drivers/isimodem/isimodem.h | 3 - drivers/isimodem/ssn.c | 95 ----------------- include/ssn.h | 61 ----------- plugins/calypso.c | 2 - plugins/g1.c | 2 - plugins/huawei.c | 2 - plugins/ifx.c | 2 - plugins/isiusb.c | 2 - plugins/linktop.c | 2 - plugins/n900.c | 2 - plugins/phonesim.c | 2 - plugins/ste.c | 2 - plugins/tc65.c | 2 - plugins/u8500.c | 2 - plugins/wavecom.c | 2 - src/ofono.h | 17 --- src/ssn.c | 247 ------------------------------------------- 22 files changed, 2 insertions(+), 605 deletions(-)Quoted 5 lines
delete mode 100644
drivers/atmodem/ssn.c
delete mode 100644drivers/isimodem/ssn.c
delete mode 100644include/ssn.h
delete mode 100644src/ssn.c
Quoted 2 lines
Patch looks good but no longer applies due to changes that Aki pushed recently.
I will correct the problem.
Quoted 2 lines
Regards,
-Denis
Regards,
Andras
RFC PATCH 2/3 voicecall: add SSN handling functions
In reply to Andras Domokos--- include/types.h | 2 + include/voicecall.h | 6 ++ src/voicecall.c | 156 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 164 insertions(+), 0 deletions(-)
include/types.h +2 -0
@@ -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 {
include/voicecall.h +6 -0
@@ -160,6 +160,12 @@ void ofono_voicecall_set_data(struct ofono_voicecall *vc, void *data);void *ofono_voicecall_get_data (struct ofono_voicecall *vc);int ofono_voicecall_get_next_callid (struct ofono_voicecall *vc); +void ofono_voicecall_ssn_mo_notify (struct ofono_voicecall *vc,unsigned int id, +int code,int index); +void ofono_voicecall_ssn_mt_notify (struct ofono_voicecall *vc,unsigned int id, +int code,int index, +const struct ofono_phone_number *ph); + #ifdef __cplusplus }#endif
src/voicecall.c +156 -0
171 lines not on this page · raw message
Signature · 1 line
1.7.0.4
Re: [RFC PATCH 2/3] voicecall: add SSN handling functions
Hi Andras,
Quoted 6 lines · Andras Domokos
--- include/types.h | 2 + include/voicecall.h | 6 ++ src/voicecall.c | 156 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 164 insertions(+), 0 deletions(-)
Please make sure to split this patch into several in accordance to our patch submission guidelines. See HACKING document, specifically the 'Submitting Patches' section.
include/types.h struct ofono_call { · line 100
Quoted 10 lines
include/types.h +2
-0@@ -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;
I really don't like these being here. Lets put them onto the struct voicecall object in src/voicecall.c. The logic for setting remote_held and remote_multiparty is something that belongs in the core and should not be exposed to the driver.
Quoted 8 lines
include/types.h +0
-0};struct ofono_network_time {include/voicecall.h +0
-0
include/voicecall.h void ofono_voicecall_set_data(struct ofono_voicecall *vc, void *data); · line 168
Quoted 9 lines
include/voicecall.h +6
-0@@ -160,6 +160,12 @@ void ofono_voicecall_set_data(struct ofono_voicecall *vc, void *data);void *ofono_voicecall_get_data (struct ofono_voicecall *vc);int ofono_voicecall_get_next_callid (struct ofono_voicecall *vc); +void ofono_voicecall_ssn_mo_notify (struct ofono_voicecall *vc,unsigned int id, +int code,int index); +void ofono_voicecall_ssn_mt_notify (struct ofono_voicecall *vc,unsigned int id, +int code,int index, +const struct ofono_phone_number *ph); +
Looks good, but as I mentioned this should be a separate patch.
Quoted 69 lines
include/voicecall.h +0
-0#ifdef __cplusplus }#endif src/voicecall.c +44
-0@@ -400,6 +400,12 @@ static void append_voicecall_properties(struct voicecall *v,ofono_dbus_dict_append (dict,"Multiparty" ,DBUS_TYPE_BOOLEAN , &mpty); +ofono_dbus_dict_append (dict,"RemoteHeld" ,DBUS_TYPE_BOOLEAN , + &call->remote_held); + +ofono_dbus_dict_append (dict,"RemoteMultiparty" ,DBUS_TYPE_BOOLEAN , + &call->remote_multiparty); +if (v->message)ofono_dbus_dict_append (dict,"Information" ,DBUS_TYPE_STRING , &v->message);@@ -1869,6 +1875,8 @@ static GDBusMethodTable manager_methods[] = { };static GDBusSignalTable manager_signals[] = { + {"Forwarded" ,"s" }, + {"BarringActive" ,"s" }, {"PropertyChanged" ,"sv" }, {"CallAdded" ,"oa{sv}" }, {"CallRemoved" ,"o" },@@ -2684,3 +2692,151 @@ void __ofono_voicecall_tone_cancel(struct ofono_voicecall *vc, int id)tone_request_run (vc); } } + +static void ssn_mt_forwarded_notify (struct ofono_voicecall *vc, +unsigned int id,int code, +const struct ofono_phone_number *ph) +{ +DBusConnection *conn =ofono_dbus_get_connection (); +const char *path =__ofono_atom_get_path (vc->atom); +char *info ="incoming" ; + +g_dbus_emit_signal (conn, path,OFONO_VOICECALL_MANAGER_INTERFACE , +"Forwarded" , +DBUS_TYPE_STRING , &info, +DBUS_TYPE_INVALID ); +} + +static struct voicecall *voicecall_select (struct ofono_voicecall *vc, +unsigned int id,int code) +{ +struct voicecall *v =NULL ; +GSList *l; + +for (l = vc->call_list; l; l = l->next) { +struct voicecall *v1 = l->data; + +if (id ==0 &&g_slist_length (vc->call_list) ==1 ) { +if (code ==SS_MT_VOICECALL_RETRIEVED && + v1->call->remote_held == TRUE) { + v = v1; +break ; + }else if (code ==SS_MT_VOICECALL_ON_HOLD && + v1->call->remote_held == FALSE) { + v = v1; +break ; + }else if (code ==SS_MT_MULTIPARTY_VOICECALL && + v1->call->remote_multiparty == FALSE) { + v = v1;
src/voicecall.c void __ofono_voicecall_tone_cancel(struct ofono_voicecall *vc, int id) · line 2740
Quoted 10 lines
src/voicecall.c +10
-0+break ; + } + }else if (v1->call->id == id) { + v = v1; +break ; + } + } + +return v; +}
I suspect this might be easier to understand if it was re-written to use g_slist_find_custom instead of jumbling unrelated logic (with a similar implementation) into a single function.
Quoted 49 lines
src/voicecall.c +49
-0+ +static void ssn_mt_remote_held_notify (struct ofono_voicecall *vc, +unsigned int id,int code, +const struct ofono_phone_number *ph) +{ +struct voicecall *v =voicecall_select (vc, id, code); +DBusConnection *conn =ofono_dbus_get_connection (); +const char *path; + +if (v ==NULL ) +return ; + +if (code ==SS_MT_VOICECALL_ON_HOLD ) + v->call->remote_held = TRUE; +else + v->call->remote_held = FALSE; + + path =voicecall_build_path (vc, v->call); + +ofono_dbus_signal_property_changed (conn, path, +OFONO_VOICECALL_INTERFACE , +"RemoteHeld" ,DBUS_TYPE_BOOLEAN , + &v->call->remote_held); +} + +static void ssn_mt_remote_multiparty_notify (struct ofono_voicecall *vc, +unsigned int id,int code, +const struct ofono_phone_number *ph) +{ +struct voicecall *v =voicecall_select (vc, id, code); +DBusConnection *conn =ofono_dbus_get_connection (); +const char *path; + +if (v ==NULL ) +return ; + + v->call->remote_multiparty = TRUE; + + path =voicecall_build_path (vc, v->call); + +ofono_dbus_signal_property_changed (conn, path, +OFONO_VOICECALL_INTERFACE , +"RemoteMultiparty" ,DBUS_TYPE_BOOLEAN , + &v->call->remote_multiparty); +} + +void ofono_voicecall_ssn_mt_notify (struct ofono_voicecall *vc, +unsigned int id,int code,int index, +const struct ofono_phone_number *ph)
src/voicecall.c void __ofono_voicecall_tone_cancel(struct ofono_voicecall *vc, int id) · line 2799
Quoted 10 lines
src/voicecall.c +10
-0+{ + +if (code ==SS_MT_CALL_FORWARDED ) +ssn_mt_forwarded_notify (vc, id, code, ph); +else if (code ==SS_MT_VOICECALL_ON_HOLD ) +ssn_mt_remote_held_notify (vc, id, code, ph); +else if (code ==SS_MT_VOICECALL_RETRIEVED ) +ssn_mt_remote_held_notify (vc, id, code, ph); +else if (code ==SS_MT_MULTIPARTY_VOICECALL ) +ssn_mt_remote_multiparty_notify (vc, id, code, ph);
Please use a switch/case here
Quoted 32 lines
src/voicecall.c +32
-0+} + +static void ssn_mo_call_barred_notify (struct ofono_voicecall *vc, +unsigned int id,int code) +{ +DBusConnection *conn =ofono_dbus_get_connection (); +const char *path =__ofono_atom_get_path (vc->atom); +const char *info; + +if (code ==SS_MO_INCOMING_BARRING ) + info ="remote" ; +else + info ="local" ; + +g_dbus_emit_signal (conn, path,OFONO_VOICECALL_MANAGER_INTERFACE , +"BarringActive" , +DBUS_TYPE_STRING , &info, +DBUS_TYPE_INVALID ); +} + +static void ssn_mo_forwarded_notify (struct ofono_voicecall *vc, +unsigned int id,int code) +{ +DBusConnection *conn =ofono_dbus_get_connection (); +const char *path =__ofono_atom_get_path (vc->atom); +char *info ="outgoing" ; + +g_dbus_emit_signal (conn, path,OFONO_VOICECALL_MANAGER_INTERFACE , +"Forwarded" , +DBUS_TYPE_STRING , &info, +DBUS_TYPE_INVALID ); +}
src/voicecall.c void __ofono_voicecall_tone_cancel(struct ofono_voicecall *vc, int id) · line 2841
Quoted 10 lines
src/voicecall.c +10
-0+ +void ofono_voicecall_ssn_mo_notify (struct ofono_voicecall *vc, +unsigned int id,int code,int index) +{ +if (code ==SS_MO_OUTGOING_BARRING ) +ssn_mo_call_barred_notify (vc, id, code); +else if (code ==SS_MO_INCOMING_BARRING ) +ssn_mo_call_barred_notify (vc, id, code); +else if (code ==SS_MO_CALL_FORWARDED ) +ssn_mo_forwarded_notify (vc, id, code);
Please use a switch/case here. It is much easier to read and extend.
src/voicecall.c void __ofono_voicecall_tone_cancel(struct ofono_voicecall *vc, int id) · line 2842
Quoted 1 line
src/voicecall.c +1
-0+}
Regards,
-Denis
Re: [RFC PATCH 2/3] voicecall: add SSN handling functions
Hi Denis,
Quoted 9 lines · ext Denis Kenzior
Hi Andras,
Quoted 6 lines · Andras Domokos
--- include/types.h | 2 + include/voicecall.h | 6 ++ src/voicecall.c | 156 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 164 insertions(+), 0 deletions(-)
Quoted 3 lines
Please make sure to split this patch into several in accordance to our patch submission guidelines. See HACKING document, specifically the 'Submitting Patches' section.
OK, I'll split up the patch according to the HACKING principles.
Quoted 6 lines
Quoted 6 lines
include/types.h +0
-0@@ -96,6 +96,8 @@ struct ofono_call {char name[OFONO_MAX_CALLER_NAME_LENGTH +1 ];
Quoted 8 lines
include/types.h struct ofono_call { · line 100
Quoted 4 lines
include/types.h +2
-0int clip_validity;int cnap_validity; +ofono_bool_t remote_held; +ofono_bool_t remote_multiparty;I really don't like these being here. Lets put them onto the struct voicecall object in
src/voicecall.c. The logic for settingremote_heldandremote_multipartyis something that belongs in the core and should not be exposed to the driver.
You are right, this informations have little to do with the drivers, makes more sense to have them in the voicecall struct.
Quoted 11 lines
Quoted 11 lines
include/types.h +0
-0};struct ofono_network_time {include/voicecall.h +0
-0@@ -160,6 +160,12 @@ void ofono_voicecall_set_data(struct ofono_voicecall *vc, void *data);void *ofono_voicecall_get_data (struct ofono_voicecall *vc);int ofono_voicecall_get_next_callid (struct ofono_voicecall *vc);
Quoted 8 lines
include/voicecall.h void ofono_voicecall_set_data(struct ofono_voicecall *vc, void *data); · line 168
Quoted 6 lines
include/voicecall.h +6
-0+void ofono_voicecall_ssn_mo_notify (struct ofono_voicecall *vc,unsigned int id, +int code,int index); +void ofono_voicecall_ssn_mt_notify (struct ofono_voicecall *vc,unsigned int id, +int code,int index, +const struct ofono_phone_number *ph); +Looks good, but as I mentioned this should be a separate patch.
I'll create a separate patch for each top level directory.
Quoted 74 lines
Quoted 74 lines
include/voicecall.h +0
-0#ifdef __cplusplus }#endif src/voicecall.c +49
-0@@ -400,6 +400,12 @@ static void append_voicecall_properties(struct voicecall *v,ofono_dbus_dict_append (dict,"Multiparty" ,DBUS_TYPE_BOOLEAN ,&mpty); +ofono_dbus_dict_append (dict,"RemoteHeld" ,DBUS_TYPE_BOOLEAN , + &call->remote_held); + +ofono_dbus_dict_append (dict,"RemoteMultiparty" ,DBUS_TYPE_BOOLEAN , + &call->remote_multiparty); +if (v->message)ofono_dbus_dict_append (dict,"Information" ,DBUS_TYPE_STRING ,&v->message);@@ -1869,6 +1875,8 @@ static GDBusMethodTable manager_methods[] = { };static GDBusSignalTable manager_signals[] = { + {"Forwarded" ,"s" }, + {"BarringActive" ,"s" }, {"PropertyChanged" ,"sv" }, {"CallAdded" ,"oa{sv}" }, {"CallRemoved" ,"o" },@@ -2684,3 +2692,151 @@ void __ofono_voicecall_tone_cancel(struct ofono_voicecall *vc, int id)tone_request_run (vc); } } + +static void ssn_mt_forwarded_notify (struct ofono_voicecall *vc, +unsigned int id,int code, +const struct ofono_phone_number *ph) +{ +DBusConnection *conn =ofono_dbus_get_connection (); +const char *path =__ofono_atom_get_path (vc->atom); +char *info ="incoming" ; + +g_dbus_emit_signal (conn, path,OFONO_VOICECALL_MANAGER_INTERFACE , +"Forwarded" , +DBUS_TYPE_STRING ,&info, +DBUS_TYPE_INVALID ); +} + +static struct voicecall *voicecall_select (struct ofono_voicecall *vc, +unsigned int id,int code) +{ +struct voicecall *v =NULL ; +GSList *l; + +for (l = vc->call_list; l; l = l->next) { +struct voicecall *v1 = l->data; + +if (id ==0 &&g_slist_length (vc->call_list) ==1 ) { +if (code ==SS_MT_VOICECALL_RETRIEVED && + v1->call->remote_held == TRUE) { + v = v1; +break ; + }else if (code ==SS_MT_VOICECALL_ON_HOLD && + v1->call->remote_held == FALSE) { + v = v1; +break ; + }else if (code ==SS_MT_MULTIPARTY_VOICECALL && + v1->call->remote_multiparty == FALSE) { + v = v1; +break ; + } + }else if (v1->call->id == id) { + v = v1; +break ;
Quoted 8 lines
src/voicecall.c void __ofono_voicecall_tone_cancel(struct ofono_voicecall *vc, int id) · line 2740
Quoted 5 lines
src/voicecall.c +5
-0+ } + } + +return v; +}I suspect this might be easier to understand if it was re-written to use
g_slist_find_custominstead of jumbling unrelated logic (with a similar implementation) into a single function.
Maybe a "g_slist_find_custom" function base implementation would make the code look more neat. I'll make the changes.
Quoted 52 lines
Quoted 52 lines
src/voicecall.c +52
-0+ +static void ssn_mt_remote_held_notify (struct ofono_voicecall *vc, +unsigned int id,int code, +const struct ofono_phone_number *ph) +{ +struct voicecall *v =voicecall_select (vc, id, code); +DBusConnection *conn =ofono_dbus_get_connection (); +const char *path; + +if (v ==NULL ) +return ; + +if (code ==SS_MT_VOICECALL_ON_HOLD ) + v->call->remote_held = TRUE; +else + v->call->remote_held = FALSE; + + path =voicecall_build_path (vc, v->call); + +ofono_dbus_signal_property_changed (conn, path, +OFONO_VOICECALL_INTERFACE , +"RemoteHeld" ,DBUS_TYPE_BOOLEAN , + &v->call->remote_held); +} + +static void ssn_mt_remote_multiparty_notify (struct ofono_voicecall *vc, +unsigned int id,int code, +const struct ofono_phone_number *ph) +{ +struct voicecall *v =voicecall_select (vc, id, code); +DBusConnection *conn =ofono_dbus_get_connection (); +const char *path; + +if (v ==NULL ) +return ; + + v->call->remote_multiparty = TRUE; + + path =voicecall_build_path (vc, v->call); + +ofono_dbus_signal_property_changed (conn, path, +OFONO_VOICECALL_INTERFACE , +"RemoteMultiparty" ,DBUS_TYPE_BOOLEAN , + &v->call->remote_multiparty); +} + +void ofono_voicecall_ssn_mt_notify (struct ofono_voicecall *vc, +unsigned int id,int code,int index, +const struct ofono_phone_number *ph) +{ + +if (code ==SS_MT_CALL_FORWARDED )
Quoted 9 lines
src/voicecall.c void __ofono_voicecall_tone_cancel(struct ofono_voicecall *vc, int id) · line 2799
Quoted 7 lines
src/voicecall.c +7
-0+ssn_mt_forwarded_notify (vc, id, code, ph); + else if (code == SS_MT_VOICECALL_ON_HOLD) + ssn_mt_remote_held_notify(vc, id, code, ph); + else if (code == SS_MT_VOICECALL_RETRIEVED) + ssn_mt_remote_held_notify(vc, id, code, ph); + else if (code == SS_MT_MULTIPARTY_VOICECALL) + ssn_mt_remote_multiparty_notify(vc, id, code, ph);Please use a switch/case here
OK, no problem.
Quoted 35 lines
Quoted 35 lines
src/voicecall.c +35
-0+} + +static void ssn_mo_call_barred_notify (struct ofono_voicecall *vc, +unsigned int id,int code) +{ +DBusConnection *conn =ofono_dbus_get_connection (); +const char *path =__ofono_atom_get_path (vc->atom); +const char *info; + +if (code ==SS_MO_INCOMING_BARRING ) + info ="remote" ; +else + info ="local" ; + +g_dbus_emit_signal (conn, path,OFONO_VOICECALL_MANAGER_INTERFACE , +"BarringActive" , +DBUS_TYPE_STRING ,&info, +DBUS_TYPE_INVALID ); +} + +static void ssn_mo_forwarded_notify (struct ofono_voicecall *vc, +unsigned int id,int code) +{ +DBusConnection *conn =ofono_dbus_get_connection (); +const char *path =__ofono_atom_get_path (vc->atom); +char *info ="outgoing" ; + +g_dbus_emit_signal (conn, path,OFONO_VOICECALL_MANAGER_INTERFACE , +"Forwarded" , +DBUS_TYPE_STRING ,&info, +DBUS_TYPE_INVALID ); +} + +void ofono_voicecall_ssn_mo_notify (struct ofono_voicecall *vc, +unsigned int id,int code,int index)
Quoted 8 lines
src/voicecall.c void __ofono_voicecall_tone_cancel(struct ofono_voicecall *vc, int id) · line 2841
Quoted 7 lines
src/voicecall.c +7
-0+{ +if (code ==SS_MO_OUTGOING_BARRING ) +ssn_mo_call_barred_notify (vc, id, code); +else if (code ==SS_MO_INCOMING_BARRING ) +ssn_mo_call_barred_notify (vc, id, code); +else if (code ==SS_MO_CALL_FORWARDED ) +ssn_mo_forwarded_notify (vc, id, code);Please use a switch/case here. It is much easier to read and extend.
OK, I'll do it.
Quoted 3 lines
src/voicecall.c void __ofono_voicecall_tone_cancel(struct ofono_voicecall *vc, int id) · line 2842
Quoted 1 line
src/voicecall.c +1
-0+}Regards,
-Denis
Regards,
Andras
RFC PATCH 3/3 atmodem: add SSN handling
In reply to Andras Domokos--- drivers/atmodem/voicecall.c | 61 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 61 insertions(+), 0 deletions(-)
drivers/atmodem/voicecall.c +61 -0
@@ -967,6 +967,63 @@ static void busy_notify(GAtResult *result, gpointer user_data) clcc_poll_cb, vc, NULL); } +static void cssi_notify (GAtResult *result,gpointer user_data) +{ +struct ofono_voicecall *vc = user_data; +GAtResultIter iter; +int code, index; + +g_at_result_iter_init (&iter, result); + +if (!g_at_result_iter_next (&iter,"+CSSI:" )) +return ; + +if (!g_at_result_iter_next_number (&iter, &code)) +return ; + +if (!g_at_result_iter_next_number (&iter, &index)) + index =0 ; + +ofono_voicecall_ssn_mo_notify (vc,0 , code, index); +} + +static void cssu_notify (GAtResult *result,gpointer user_data) +{ +struct ofono_voicecall *vc = user_data; +GAtResultIter iter; +int code; +int index =-1 ; +const char *num; +struct ofono_phone_number ph; + + ph.number[0 ] ='\0' ; + ph.type =129 ; + +g_at_result_iter_init (&iter, result); + +if (!g_at_result_iter_next (&iter,"+CSSU:" )) +return ; + +if (!g_at_result_iter_next_number (&iter, &code)) +return ; + +/* This field is optional, if we can't read it, try to skip it */ +if (!g_at_result_iter_next_number (&iter, &index) && + !g_at_result_iter_skip_next (&iter)) + goto out; + +if (!g_at_result_iter_next_string (&iter, &num)) + goto out; + +strncpy (ph.number, num,OFONO_MAX_PHONE_NUMBER_LENGTH ); + +if (!g_at_result_iter_next_number (&iter, &ph.type)) +return ; + +out: +ofono_voicecall_ssn_mt_notify (vc,0 , code, index, &ph); +} +static void vtd_query_cb (gboolean ok,GAtResult *result,gpointer user_data) {struct ofono_voicecall *vc = user_data;
@@ -1015,6 +1072,9 @@ static void at_voicecall_initialized(gboolean ok, GAtResult *result,/* Populate the call list */ g_at_chat_send (vd->chat,"AT+CLCC" , clcc_prefix, clcc_cb, vc,NULL ); + +g_at_chat_register (vd->chat,"+CSSI:" , cssi_notify, FALSE, vc,NULL ); +g_at_chat_register (vd->chat,"+CSSU:" , cssu_notify, FALSE, vc,NULL ); } static int at_voicecall_probe(struct ofono_voicecall *vc, unsigned int vendor,
@@ -1038,6 +1098,7 @@ static int at_voicecall_probe(struct ofono_voicecall *vc, unsigned int vendor,g_at_chat_send (vd->chat,"AT+CDIP=1" ,NULL ,NULL ,NULL ,NULL );g_at_chat_send (vd->chat,"AT+CNAP=1" ,NULL ,NULL ,NULL ,NULL );g_at_chat_send (vd->chat,"AT+COLP=1" ,NULL ,NULL ,NULL ,NULL ); +g_at_chat_send (vd->chat,"AT+CSSN=1,1" ,NULL ,NULL ,NULL ,NULL );g_at_chat_send (vd->chat,"AT+VTD?" ,NULL , vtd_query_cb, vc,NULL ); g_at_chat_send(vd->chat, "AT+CCWA=1", NULL,
Signature · 1 line
1.7.0.4