[PATCH v2 6/9] cdmagen: Add CDMA MO Call Support
by Dara Spieker-Doyle
---
Makefile.am | 3 +
plugins/cdmagen.c | 274 +++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 277 insertions(+), 0 deletions(-)
create mode 100644 plugins/cdmagen.c
diff --git a/Makefile.am b/Makefile.am
index 50e893f..9949bcc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -293,6 +293,9 @@ builtin_sources += plugins/ste.c
builtin_modules += caif
builtin_sources += plugins/caif.c
+
+builtin_modules += cdmagen
+builtin_sources += plugins/cdmagen.c
endif
if MAINTAINER_MODE
diff --git a/plugins/cdmagen.c b/plugins/cdmagen.c
new file mode 100644
index 0000000..4ec4614
--- /dev/null
+++ b/plugins/cdmagen.c
@@ -0,0 +1,274 @@
+/*
+ * This file is part of oFono - Open Source Telephony
+ *
+ * Copyright (C) 2010 Nokia Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdlib.h>
+#include <errno.h>
+#include <termios.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include <glib.h>
+#include <gatchat.h>
+#include <gattty.h>
+
+#define OFONO_API_SUBJECT_TO_CHANGE
+#include <ofono/plugin.h>
+#include <ofono/log.h>
+#include <ofono/modem.h>
+
+#include <ofono/cdma-voicecall.h>
+#include <drivers/atmodem/atutil.h>
+
+#include "common.h"
+
+struct cdmagen_data {
+ GAtChat *chat;
+ ofono_bool_t online;
+ ofono_bool_t registration_status;
+};
+
+static void cdmagen_debug(const char *str, void *data)
+{
+ const char *prefix = data;
+
+ ofono_info("%s%s", prefix, str);
+}
+
+static int cdmagen_probe(struct ofono_modem *modem)
+{
+ struct cdmagen_data *data;
+
+ DBG("%p", modem);
+
+ data = g_try_new0(struct cdmagen_data, 1);
+ if (data == NULL)
+ return -ENOMEM;
+
+ ofono_modem_set_data(modem, data);
+
+ return 0;
+}
+
+static void cdmagen_remove(struct ofono_modem *modem)
+{
+ struct cdmagen_data *data = ofono_modem_get_data(modem);
+
+ DBG("%p", modem);
+
+ ofono_modem_set_data(modem, NULL);
+
+ if (data->chat)
+ g_at_chat_unref(data->chat);
+
+ g_free(data);
+}
+
+static GAtChat *create_port(const char *device)
+{
+ GAtSyntax *syntax;
+ GIOChannel *channel;
+ GAtChat *chat;
+
+ channel = g_at_tty_open(device, NULL);
+ if (channel == NULL)
+ return NULL;
+
+ syntax = g_at_syntax_new_gsmv1();
+
+ chat = g_at_chat_new(channel, syntax);
+ g_at_syntax_unref(syntax);
+ g_io_channel_unref(channel);
+
+ if (chat == NULL)
+ return NULL;
+
+ return chat;
+}
+
+static GAtChat *open_device(struct ofono_modem *modem,
+ const char *key, char *debug)
+{
+ const char *device;
+ GAtChat *chat;
+
+ device = ofono_modem_get_string(modem, key);
+ if (device == NULL)
+ return NULL;
+
+ DBG("%s %s", key, device);
+
+ chat = create_port(device);
+ if (chat == NULL)
+ return NULL;
+
+ g_at_chat_add_terminator(chat, "COMMAND NOT SUPPORT", -1, FALSE);
+
+ if (getenv("OFONO_AT_DEBUG"))
+ g_at_chat_set_debug(chat, cdmagen_debug, debug);
+
+ return chat;
+}
+
+static void cdmagen_disconnect(gpointer user_data)
+{
+ struct ofono_modem *modem = user_data;
+ struct cdmagen_data *data = ofono_modem_get_data(modem);
+
+ DBG("%p", modem);
+
+ g_at_chat_unref(data->chat);
+ data->chat = NULL;
+
+ data->chat = open_device(modem, "Device", "CDMA Device: ");
+ if (data->chat == NULL)
+ return;
+
+ g_at_chat_set_disconnect_function(data->chat,
+ cdmagen_disconnect, modem);
+}
+
+/* power up hardware */
+static int cdmagen_enable(struct ofono_modem *modem)
+{
+ struct cdmagen_data *data = ofono_modem_get_data(modem);
+
+ DBG("%p", modem);
+
+ ofono_modem_set_boolean(modem, "no_sim_required", TRUE);
+
+ data->chat = open_device(modem, "Device", "CDMA Device: ");
+ if (data->chat == NULL)
+ return -EINVAL;
+
+ g_at_chat_set_disconnect_function(data->chat,
+ cdmagen_disconnect, modem);
+
+ if (getenv("OFONO_AT_DEBUG"))
+ g_at_chat_set_debug(data->chat, cdmagen_debug,
+ "CDMA Generic: ");
+
+ return 0;
+}
+
+static int cdmagen_disable(struct ofono_modem *modem)
+{
+ struct cdmagen_data *data = ofono_modem_get_data(modem);
+
+ DBG("%p", modem);
+
+ if (data->chat) {
+ g_at_chat_cancel_all(data->chat);
+ g_at_chat_unregister_all(data->chat);
+ g_at_chat_unref(data->chat);
+ data->chat = NULL;
+ }
+
+ return 0;
+}
+
+static void cdmagen_pre_sim(struct ofono_modem *modem)
+{
+ struct cdmagen_data *data = ofono_modem_get_data(modem);
+
+ ofono_cdma_voicecall_manager_create(modem, 0, "cdmamodem",
+ data->chat);
+}
+
+static void cdmagen_post_sim(struct ofono_modem *modem)
+{
+}
+
+static gboolean cdmagen_set_online_cb(gpointer cb_data)
+{
+ struct cb_data *cbd = cb_data;
+ ofono_modem_online_cb_t cb = cbd->cb;
+
+ CALLBACK_WITH_SUCCESS(cb, cbd->data);
+
+ g_free(cbd);
+
+ /* do not call again */
+ return FALSE;
+}
+
+static void cdmagen_set_online(struct ofono_modem *modem, ofono_bool_t online,
+ ofono_modem_online_cb_t cb, void *user_data)
+{
+ struct cdmagen_data *data = ofono_modem_get_data(modem);
+ struct cb_data *cbd = cb_data_new(cb, user_data);
+
+ DBG("modem %p %s", modem, online ? "online" : "offline");
+
+ if (cbd == NULL)
+ goto error;
+
+ data->online = online;
+
+ if (online)
+ data->registration_status =
+ NETWORK_REGISTRATION_STATUS_REGISTERED;
+
+ cdmagen_set_online_cb(cbd);
+ return;
+
+error:
+ g_free(cbd);
+
+ CALLBACK_WITH_FAILURE(cb, cbd->data);
+}
+
+static void cdmagen_post_online(struct ofono_modem *modem)
+{
+ DBG("%p", modem);
+}
+
+static struct ofono_modem_driver cdmagen_driver = {
+ .name = "cdmagen",
+ .probe = cdmagen_probe,
+ .remove = cdmagen_remove,
+ .enable = cdmagen_enable,
+ .disable = cdmagen_disable,
+ .pre_sim = cdmagen_pre_sim,
+ .post_sim = cdmagen_post_sim,
+ .set_online = cdmagen_set_online,
+ .post_online = cdmagen_post_online,
+};
+
+static int cdmagen_init(void)
+{
+ return ofono_modem_driver_register(&cdmagen_driver);
+}
+
+static void cdmagen_exit(void)
+{
+ ofono_modem_driver_unregister(&cdmagen_driver);
+}
+
+OFONO_PLUGIN_DEFINE(cdmagen, "Generic CDMA AT Modem", VERSION,
+ OFONO_PLUGIN_PRIORITY_DEFAULT,
+ cdmagen_init, cdmagen_exit)
--
1.7.0.4
11 years, 9 months
[PATCH v2 0/9] Add CDMA MO Call Support
by Dara Spieker-Doyle
Submitting new versions for review comments.
This set of patches introduces the foundation for CDMA Voicecall support in
oFono. They cover making a simple MO call over a CDMA network, including call
state management, LineIdentification, dialing and hanging up through the
cdma-voicecall atom DBus interface.
Currently, the implemented call states available are "dialing" and
"disconnected", initiated on dialing and hanging up, and the LineIdentification
property is updated only upon dialing. The StartTime for when a call would become
"active" has been implemented, but is untested until support for call state
transition changes is implemented. This is future work.
AT command support for dial and hangup is provided with a cdma-atmodem driver.
Also included in these patches are test scripts and a CDMA generic hardware
plugin (cdmagen) to support testing of these features.
These patches have been tested against the Nokia 7205 CDMA device in a tethered
mode.
Limitations
-----------
The Nokia 7205 device does not support an AT interface for reporting request
responses, such as the call status and remote/network disconnect reasons, so
these are currently untested.
Dara Spieker-Doyle (9):
dbus: Add CDMA Voicecall Interface
types: Add CDMA Phone Number
cdma-voicecall: Add CDMA MO Call Support
cdma-voicecall: Add CDMA MO Call Support
cdmamodem: Add CDMA MO Call Support
cdmagen: Add CDMA MO Call Support
ofono-rules: Add cdmagen device
udev: Add cdmagen
test: Add CDMA MO Call Support
Makefile.am | 20 ++-
configure.ac | 5 +
drivers/cdmamodem/cdmamodem.c | 48 +++++
drivers/cdmamodem/cdmamodem.h | 25 +++
drivers/cdmamodem/voicecall.c | 190 ++++++++++++++++++
include/cdma-voicecall.h | 89 ++++++++
include/dbus.h | 3 +
include/types.h | 8 +
plugins/cdmagen.c | 274 +++++++++++++++++++++++++
plugins/ofono.rules | 4 +
plugins/udev.c | 21 ++
src/cdma-voicecall.c | 444 +++++++++++++++++++++++++++++++++++++++++
src/common.c | 41 ++++
src/common.h | 6 +
src/ofono.h | 3 +
test/cdma-dial-number | 24 +++
test/cdma-hangup | 20 ++
test/cdma-list-call | 30 +++
18 files changed, 1252 insertions(+), 3 deletions(-)
create mode 100644 drivers/cdmamodem/cdmamodem.c
create mode 100644 drivers/cdmamodem/cdmamodem.h
create mode 100644 drivers/cdmamodem/voicecall.c
create mode 100644 include/cdma-voicecall.h
create mode 100644 plugins/cdmagen.c
create mode 100644 src/cdma-voicecall.c
create mode 100755 test/cdma-dial-number
create mode 100755 test/cdma-hangup
create mode 100755 test/cdma-list-call
11 years, 9 months
[PATCH] voicecall: Add EmergencyCall property.
by John Mathew
---
doc/voicecall-api.txt | 4 ++++
src/voicecall.c | 34 +++++++++++++++++++++++++++++++++-
2 files changed, 37 insertions(+), 1 deletions(-)
diff --git a/doc/voicecall-api.txt b/doc/voicecall-api.txt
index f0ba316..60c692c 100644
--- a/doc/voicecall-api.txt
+++ b/doc/voicecall-api.txt
@@ -125,3 +125,7 @@ Properties string LineIdentification [readonly]
Icon identifier to be used instead of or together
with the text information.
+
+ boolean EmergencyCall [readonly]
+
+ Contains the indication if the voice call is emergency call or not.
diff --git a/src/voicecall.c b/src/voicecall.c
index bd64432..e39f4b7 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -315,6 +315,20 @@ static void tone_request_finish(struct ofono_voicecall *vc,
g_free(entry);
}
+static gboolean voicecall_isemergency(struct voicecall *v)
+{
+ struct ofono_call *call = v->call;
+ const char *lineid_str;
+
+ lineid_str = phone_number_to_string(&call->phone_number);
+
+ if (g_slist_find_custom(v->vc->en_list, lineid_str,
+ (GCompareFunc) strcmp))
+ return TRUE;
+ else
+ return FALSE;
+}
+
static void append_voicecall_properties(struct voicecall *v,
DBusMessageIter *dict)
{
@@ -322,7 +336,8 @@ static void append_voicecall_properties(struct voicecall *v,
const char *status;
const char *callerid;
const char *timestr;
- ofono_bool_t mpty;
+ ofono_bool_t mpt;
+ dbus_bool_t emergency_call;
status = call_status_to_string(call->status);
callerid = phone_number_to_string(&call->phone_number);
@@ -358,6 +373,14 @@ static void append_voicecall_properties(struct voicecall *v,
if (v->icon_id)
ofono_dbus_dict_append(dict, "Icon", DBUS_TYPE_BYTE,
&v->icon_id);
+
+ if (voicecall_isemergency(v))
+ emergency_call = TRUE;
+ else
+ emergency_call = FALSE;
+
+ ofono_dbus_dict_append(dict, "EmergencyCall", DBUS_TYPE_BOOLEAN,
+ &emergency_call);
}
static DBusMessage *voicecall_get_properties(DBusConnection *conn,
@@ -722,6 +745,15 @@ static void voicecall_set_call_lineid(struct voicecall *v,
OFONO_VOICECALL_INTERFACE,
"LineIdentification",
DBUS_TYPE_STRING, &lineid_str);
+
+ if (voicecall_isemergency(v)) {
+ dbus_bool_t emergency_call = TRUE;
+ ofono_dbus_signal_property_changed(conn, path,
+ OFONO_VOICECALL_INTERFACE,
+ "EmergencyCall",
+ DBUS_TYPE_BOOLEAN,
+ &emergency_call);
+ }
}
static gboolean voicecall_dbus_register(struct voicecall *v)
--
1.7.0.4
11 years, 9 months
[PATCH] Mark CNAP task as done
by Gustavo F. Padovan
---
TODO | 6 ------
1 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/TODO b/TODO
index a3f7379..4c3506e 100644
--- a/TODO
+++ b/TODO
@@ -246,12 +246,6 @@ Supplementary Services
Priority: Low
Complexity: C8
-- Calling Name Presentation (CNAP) support
-
- Priority: Low
- Complexity: C2
- Owner: Gustavo F Padovan <padovan(a)profusion.mobi>
-
- User to User Signaling (UUS) support
Priority: Low
--
1.7.3.2
11 years, 9 months
[RFC PATCH] TODO: add owner to 'Network updating the emergency number' task
by Petteri Tikander
---
TODO | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/TODO b/TODO
index a3f7379..21fc723 100644
--- a/TODO
+++ b/TODO
@@ -410,6 +410,7 @@ Emergency Calls
Priority: High
Complexity: C2
+ Owner: Petteri Tikander <petteri.tikander(a)ixonos.com>
- Extend the voicecall interface with a property indicating whether this call
is an emergency call (essentially the CLI matches one of the numbers on the
--
1.7.0.4
-- See us at Mobile World Congress, 14-17 February 2011, in Barcelona, Spain. Visit the Ixonos booth Hall 1, # 1E19.
11 years, 9 months
[PATCH] ctm: use ofono_error instead of DBG for errors
by Gustavo F. Padovan
---
src/ctm.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/ctm.c b/src/ctm.c
index 1df34c2..2c82c2e 100644
--- a/src/ctm.c
+++ b/src/ctm.c
@@ -90,7 +90,7 @@ static void ctm_set_enabled_callback(const struct ofono_error *error,
DBusMessage *reply;
if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
- DBG("Error setting ctm enabled property");
+ ofono_error("Error setting ctm enabled property");
reply = __ofono_error_failed(ctm->pending);
__ofono_dbus_pending_reply(&ctm->pending, reply);
@@ -116,7 +116,7 @@ static void ctm_query_enabled_callback(const struct ofono_error *error,
if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
DBusMessage *reply;
- DBG("Error during ctm enabled query");
+ ofono_error("Error during ctm enabled query");
reply = __ofono_error_failed(ctm->pending);
__ofono_dbus_pending_reply(&ctm->pending, reply);
--
1.7.3.2
11 years, 9 months
[PATCH] smsutil: do not hardcode TP-ValidityPeriod
by Pekka.Pessi@nokia.com
From: Pekka Pessi <Pekka.Pessi(a)nokia.com>
---
src/smsutil.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/smsutil.c b/src/smsutil.c
index f4eee24..59faaf7 100644
--- a/src/smsutil.c
+++ b/src/smsutil.c
@@ -3162,11 +3162,10 @@ GSList *sms_datagram_prepare(const char *to,
memset(&template, 0, sizeof(struct sms));
template.type = SMS_TYPE_SUBMIT;
template.submit.rd = FALSE;
- template.submit.vpf = SMS_VALIDITY_PERIOD_FORMAT_RELATIVE;
+ template.submit.vpf = SMS_VALIDITY_PERIOD_FORMAT_ABSENT;
template.submit.rp = FALSE;
template.submit.srr = use_delivery_reports;
template.submit.mr = 0;
- template.submit.vp.relative = 0xA7; /* 24 Hours */
template.submit.dcs = 0x04; /* Class Unspecified, 8 Bit */
template.submit.udhi = TRUE;
sms_address_from_string(&template.submit.daddr, to);
@@ -3288,11 +3287,10 @@ GSList *sms_text_prepare(const char *to, const char *utf8, guint16 ref,
memset(&template, 0, sizeof(struct sms));
template.type = SMS_TYPE_SUBMIT;
template.submit.rd = FALSE;
- template.submit.vpf = SMS_VALIDITY_PERIOD_FORMAT_RELATIVE;
+ template.submit.vpf = SMS_VALIDITY_PERIOD_FORMAT_ABSENT;
template.submit.rp = FALSE;
template.submit.srr = use_delivery_reports;
template.submit.mr = 0;
- template.submit.vp.relative = 0xA7; /* 24 Hours */
sms_address_from_string(&template.submit.daddr, to);
/* UDHI, UDL, UD and DCS actually depend on what we have in the text */
--
1.7.1
11 years, 9 months
[PATCH] test: test case for changing Call Barring password
by Sjur Brændeland
From: Lasse Kunnasluoto <lasse.kunnasluoto(a)tieto.com>
---
test/test-call-barring | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/test/test-call-barring b/test/test-call-barring
index 5385a10..0756011 100755
--- a/test/test-call-barring
+++ b/test/test-call-barring
@@ -14,6 +14,7 @@ def property_changed(name, value):
def print_useage(s):
print "Usage: %s <property> <newvalue> <password>" % (s)
print "Usage: %s disableall <password>" % (s)
+ print "Usage: %s passwd <old_password> <new_password>" % (s)
sys.exit(1);
if __name__ == "__main__":
@@ -22,6 +23,9 @@ if __name__ == "__main__":
if (sys.argv[1] == 'disableall'):
pin = sys.argv[2]
+ elif (sys.argv[1] == 'passwd'):
+ old_password = sys.argv[2]
+ new_password = sys.argv[3]
else:
if (len(sys.argv) != 4):
print_useage(sys.argv[0])
@@ -59,6 +63,14 @@ if __name__ == "__main__":
except dbus.DBusException, e:
print "Unable to Disable All barrings: ", e
sys.exit(1)
+ elif (sys.argv[1] == 'passwd'):
+ try:
+ cb.ChangePassword(old_password, new_password)
+ except dbus.DBusException, e:
+ print "Unable to change password: ", e
+ sys.exit(1)
+ print "Password changed"
+ sys.exit(0)
else:
try:
cb.SetProperty(property, newvalue, pin)
--
1.7.0.4
11 years, 9 months
[PATCH] TODO: add blacklisting
by Pekka.Pessi@nokia.com
From: Pekka Pessi <Pekka.Pessi(a)nokia.com>
---
TODO | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/TODO b/TODO
index a421a99..558c1d2 100644
--- a/TODO
+++ b/TODO
@@ -305,6 +305,14 @@ Voicecall
Complexity: C2
Owner: Pekka Pessi <pekka.pessi(a)nokia.com>
+- Blacklisting. According to 3GPP TS 22.001 annex E, the TE must provide
+ automatic calling repeat call attempt restrictions.
+
+ There should be a method to manually reset blacklisting.
+
+ Priority: Medium
+ Complexity: C1
+
Sim Toolkit
===========
--
1.7.1
11 years, 9 months
[PATCH 1/2] Add CNAP support
by Gustavo F. Padovan
With CNAP phonesim can tell the Caller Name within the RING comand
---
src/callmanager.cpp | 16 +++++++++-------
src/callmanager.h | 5 +++--
src/control.cpp | 4 ++--
src/control.h | 2 +-
src/controlbase.ui | 16 ++++++++++++++++
src/default.xml | 19 +++++++++++++++++++
src/hardwaremanipulator.h | 2 +-
src/phonesim.cpp | 4 ++--
8 files changed, 53 insertions(+), 15 deletions(-)
diff --git a/src/callmanager.cpp b/src/callmanager.cpp
index dddc5ae..03fd341 100644
--- a/src/callmanager.cpp
+++ b/src/callmanager.cpp
@@ -302,7 +302,8 @@ bool CallManager::command( const QString& cmd )
return true;
}
-void CallManager::startIncomingCall( const QString& number, bool dialBack )
+void CallManager::startIncomingCall( const QString& number,
+ const QString& name, bool dialBack )
{
// Bail out if there is already an incoming call.
if ( idForIncoming() >= 0 ) {
@@ -328,7 +329,8 @@ void CallManager::startIncomingCall( const QString& number, bool dialBack )
if ( info.state == CallState_Waiting ) {
emit unsolicited( "+CCWA: " + QAtUtils::encodeNumber( number ) + ",1" );
} else {
- emit unsolicited( "RING\\n\\n+CLIP: " + QAtUtils::encodeNumber( number ) );
+ emit unsolicited( "RING\\n\\n+CLIP: " + QAtUtils::encodeNumber( number )
+ + "\\n\\n+CNAP: \"" + name + "\"" );
}
// Announce the incoming call using Ericsson-style state notifications.
@@ -339,9 +341,9 @@ void CallManager::startIncomingCall( const QString& number, bool dialBack )
ringTimer->start(2000);
}
-void CallManager::startIncomingCall( const QString& number )
+void CallManager::startIncomingCall( const QString& number , const QString& name )
{
- startIncomingCall( number, false );
+ startIncomingCall( number, name, false );
}
void CallManager::hangupAll()
@@ -670,18 +672,18 @@ void CallManager::dialingToAlerting()
void CallManager::dialBack()
{
- startIncomingCall( "1234567", true );
+ startIncomingCall( "1234567", "Alice", true );
}
void CallManager::dialBackWithHangup5()
{
- startIncomingCall( "1234567", true );
+ startIncomingCall( "1234567", "Bob", true );
hangupTimer->start( 5000 );
}
void CallManager::dialBackWithHangup4()
{
- startIncomingCall( "1234567", true );
+ startIncomingCall( "1234567", "Mallory", true );
hangupTimer->start( 4000 );
}
diff --git a/src/callmanager.h b/src/callmanager.h
index 3dd01cd..a2de574 100644
--- a/src/callmanager.h
+++ b/src/callmanager.h
@@ -93,8 +93,9 @@ public:
public slots:
// Start an incoming call simulation.
- void startIncomingCall( const QString& number, bool dialBack );
- void startIncomingCall( const QString& number );
+ void startIncomingCall( const QString& number, const QString& name,
+ bool dialBack );
+ void startIncomingCall( const QString& number, const QString& name );
signals:
// Send a response to a command.
diff --git a/src/control.cpp b/src/control.cpp
index 75dae98..49f9f04 100644
--- a/src/control.cpp
+++ b/src/control.cpp
@@ -119,7 +119,7 @@ Control::Control(const QString& ruleFile, SimRules *sr, QObject *parent)
<< SIGNAL(command(QString))
<< SIGNAL(variableChanged(QString,QString))
<< SIGNAL(switchTo(QString))
- << SIGNAL(startIncomingCall(QString));
+ << SIGNAL(startIncomingCall(QString, QString));
foreach (QByteArray sig, proxySignals)
connect(widget, sig, this, sig);
@@ -281,7 +281,7 @@ void ControlWidget::sendSMSDatagram()
void ControlWidget::sendCall()
{
- emit startIncomingCall( ui->leCaller->text() );
+ emit startIncomingCall( ui->leCaller->text() , ui->leCallerName->text() );
}
void ControlWidget::handleFromData( const QString& cmd )
diff --git a/src/control.h b/src/control.h
index 64a7af7..767baa3 100644
--- a/src/control.h
+++ b/src/control.h
@@ -101,7 +101,7 @@ signals:
void command(const QString &);
void variableChanged(const QString &, const QString &);
void switchTo(const QString &);
- void startIncomingCall(const QString &);
+ void startIncomingCall(const QString &, const QString &);
protected:
void closeEvent(QCloseEvent *event);
diff --git a/src/controlbase.ui b/src/controlbase.ui
index 2c91f95..76abd4b 100644
--- a/src/controlbase.ui
+++ b/src/controlbase.ui
@@ -141,6 +141,22 @@
<widget class="QLineEdit" name="leCaller"/>
</item>
<item>
+ <widget class="QLabel" name="lblCallerName">
+ <property name="text">
+ <string>Caller Na&me</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
+ </property>
+ <property name="buddy">
+ <cstring>leCallerName</cstring>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="leCallerName"/>
+ </item>
+ <item>
<layout class="QHBoxLayout">
<property name="spacing">
<number>6</number>
diff --git a/src/default.xml b/src/default.xml
index 0fd0182..3f800c1 100644
--- a/src/default.xml
+++ b/src/default.xml
@@ -1373,6 +1373,25 @@
</chat>
<chat>
+ <!-- Query calling line identifier presentation mode -->
+ <command>AT+CNAP?</command>
+ <response>+CNAP: ${NAP},1\n\nOK</response>
+</chat>
+
+<chat>
+ <!-- Query supported calling line identifier presentation modes -->
+ <command>AT+CNAP=?</command>
+ <response>+CNAP: (0,1)\n\nOK</response>
+</chat>
+
+<chat>
+ <!-- Set calling line identifier presentation mode -->
+ <command>AT+CNAP=*</command>
+ <response>OK</response>
+ <set name="NAP" value="*"/>
+</chat>
+
+<chat>
<!-- Query calling line identication restriction mode -->
<command>AT+CLIR?</command>
<response>+CLIR: ${LIR},${LIR_STATUS}\n\nOK</response>
diff --git a/src/hardwaremanipulator.h b/src/hardwaremanipulator.h
index fe5968f..d8ab11e 100644
--- a/src/hardwaremanipulator.h
+++ b/src/hardwaremanipulator.h
@@ -55,7 +55,7 @@ signals:
void command(const QString &cmd);
void variableChanged(const QString &n, const QString &v);
void switchTo(const QString &cmd);
- void startIncomingCall(const QString &number);
+ void startIncomingCall(const QString &number, const QString &name);
protected:
virtual QString constructCBMessage(const QString &messageCode, int geographicalScope, const QString &updateNumber, const QString &channel,
diff --git a/src/phonesim.cpp b/src/phonesim.cpp
index 89089b2..8ca5b23 100644
--- a/src/phonesim.cpp
+++ b/src/phonesim.cpp
@@ -526,8 +526,8 @@ SimRules::SimRules( int fd, QObject *p, const QString& filename, HardwareManipu
this, SLOT(dialCheck(QString,bool&)) );
if ( machine ) {
- connect( machine, SIGNAL(startIncomingCall(QString)),
- _callManager, SLOT(startIncomingCall(QString)) );
+ connect( machine, SIGNAL(startIncomingCall(QString,QString)),
+ _callManager, SLOT(startIncomingCall(QString,QString)) );
}
connect(this,SIGNAL(readyRead()),
--
1.7.3.2
11 years, 9 months