Introduce call management buttons
cover Introduce call management buttons
This patch add support of call state management.
Buttons Alerting and Active permit to change the state of on-going call.
Nicolas Bertrand (5):
controlbase: Add call state management buttons
hardwaremanipulator: Call state changed signals
callmanager: Change call state management slots
control: handle call management buttons
phonesim: connect call mangagement signals
src/callmanager.cpp | 7 +++++++ src/callmanager.h | 12 ++++++------ src/control.cpp | 12 ++++++++++++ src/control.h | 2 ++ src/controlbase.ui | 18 ++++++++++++++++++ src/hardwaremanipulator.h | 2 ++ src/phonesim.cpp | 4 ++++ 7 files changed, 51 insertions(+), 6 deletions(-)
PATCH 1/5 controlbase: Add call state management buttons
--- src/controlbase.ui | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-)
src/controlbase.ui +18 -0
@@ -1395,6 +1395,24 @@ p, li { white-space: pre-wrap; } </widget> </item> <item> + <layout class="QHBoxLayout" name="horizontalLayout_4"> + <item> + <widget class="QPushButton" name="pbAlerting"> + <property name="text"> + <string>Alerting</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="pbActive"> + <property name="text"> + <string>Active</string> + </property> + </widget> + </item> + </layout> + </item> + <item> <layout class="QHBoxLayout" name="horizontalLayout_3"> <item> <widget class="QGroupBox" name="gbIncomingCall">
Signature · 1 line
1.7.1
PATCH 2/5 hardwaremanipulator: Call state changed signals
In reply to Nicolas Bertrand--- src/hardwaremanipulator.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
src/hardwaremanipulator.h +2 -0
@@ -58,6 +58,8 @@ signals: void variableChanged(const QString &n, const QString &v); void switchTo(const QString &cmd); void startIncomingCall(const QString &number, const QString &called_number, const QString &name); +void stateChangedToAlerting (); +void stateChangedToConnected (); protected: virtual QString constructCBMessage(const QString &messageCode, int geographicalScope, const QString &updateNumber, const QString &channel,
Signature · 1 line
1.7.1
PATCH 3/5 callmanager: Change call state management slots
In reply to Nicolas Bertrand--- src/callmanager.cpp | 7 +++++++ src/callmanager.h | 12 ++++++------ 2 files changed, 13 insertions(+), 6 deletions(-)
src/callmanager.cpp +7 -0
@@ -700,6 +700,10 @@ bool CallManager::chld4() void CallManager::dialingToConnected() { + // Stop timers in case they are still active + alertingTimer->stop(); + connectTimer->stop(); + // Find the currently dialing or alerting call. int index = indexForId( idForState( CallState_Dialing ) ); if ( index < 0 )
@@ -726,6 +730,9 @@ void CallManager::dialingToConnected() void CallManager::dialingToAlerting() { + // Stop the timer in case it is still active + alertingTimer->stop(); + // Find the currently dialing or alerting call. int index = indexForId( idForState( CallState_Dialing ) ); if ( index < 0 )
src/callmanager.h +6 -6
@@ -100,6 +100,12 @@ public slots: void startIncomingCall( const QString& number, const QString& calledNumber, const QString& name ); +// Transition the active dialing or alerting call to connected. +void dialingToConnected (); + +// Transition the active dialing call to alerting. +void dialingToAlerting (); + signals:// Send a response to a command. void send( const QString& line );
@@ -118,12 +124,6 @@ signals: void callStatesChanged( QList<CallInfo> *list ); private slots: -// Transition the active dialing or alerting call to connected. -void dialingToConnected (); - -// Transition the active dialing call to alerting. -void dialingToAlerting (); -// Transition the waiting call to incoming. void waitingToIncoming ();
Signature · 1 line
1.7.1
PATCH 4/5 control: handle call management buttons
In reply to Nicolas Bertrand--- src/control.cpp | 12 ++++++++++++ src/control.h | 2 ++ 2 files changed, 14 insertions(+), 0 deletions(-)
src/control.cpp +12 -0
@@ -88,6 +88,8 @@ ControlWidget::ControlWidget(const QString &ruleFile, Control *parent) connect(ui->pbSendGNSSData, SIGNAL(clicked()), this, SLOT(sendGNSSData())); connect(ui->pbGNSSDefault, SIGNAL(clicked()), this, SLOT(setDefaultGNSSData())); connect(ui->pbSendNotif, SIGNAL(clicked()), this, SLOT(sendCSSN())); + connect(ui->pbAlerting, SIGNAL(clicked()), this, SLOT(setStateAlerting())); + connect(ui->pbActive, SIGNAL(clicked()), this, SLOT(setStateConnected())); QStringList headers; headers << "Sender" << "Priority" << "Notification Status";
@@ -168,6 +170,16 @@ void Control::callManagement( QList<CallInfo> *list ) widget->setCssuEnabled( enableCSSU ); } +void ControlWidget::setStateConnected() +{ + emit p->stateChangedToConnected(); +} + +void ControlWidget::setStateAlerting() +{ + emit p->stateChangedToAlerting(); +} + void ControlWidget::setCssiEnabled( bool enableCSSI ) { ui->cbCSSI->setEnabled( enableCSSI );
src/control.h +2 -0
@@ -104,6 +104,8 @@ private slots:void sendGNSSData ();void setDefaultGNSSData ();void sendCSSN (); +void setStateAlerting (); +void setStateConnected (); signals: void unsolicitedCommand(const QString &);
Signature · 1 line
1.7.1
PATCH 5/5 phonesim: connect call mangagement signals
In reply to Nicolas Bertrand--- src/phonesim.cpp | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
src/phonesim.cpp +4 -0
@@ -530,6 +530,10 @@ SimRules::SimRules( int fd, QObject *p, const QString& filename, HardwareManipu _callManager, SLOT(startIncomingCall(QString,QString,QString)) ); connect ( _callManager, SIGNAL( callStatesChanged( QList<CallInfo> * ) ), machine, SLOT( callManagement( QList<CallInfo> * ) ) ); + connect ( machine, SIGNAL( stateChangedToAlerting() ), _callManager, + SLOT( dialingToAlerting() ) ); + connect ( machine, SIGNAL( stateChangedToConnected() ), _callManager, + SLOT( dialingToConnected() ) ); } connect(this,SIGNAL(readyRead()),
Signature · 1 line
1.7.1
Hi Nicolas,
Quoted 10 lines · Nicolas Bertrand
This patch add support of call state management.
Buttons Alerting and Active permit to change the state of on-going call.Nicolas Bertrand (5):
controlbase: Add call state management buttons
hardwaremanipulator: Call state changed signals
callmanager: Change call state management slots
control: handle call management buttons
phonesim: connect call mangagement signals
Quoted 9 lines
src/callmanager.cpp | 7 +++++++ src/callmanager.h | 12 ++++++------ src/control.cpp | 12 ++++++++++++ src/control.h | 2 ++ src/controlbase.ui | 18 ++++++++++++++++++ src/hardwaremanipulator.h | 2 ++ src/phonesim.cpp | 4 ++++ 7 files changed, 51 insertions(+), 6 deletions(-)
I applied all patches in this series, however calls still proceed to Alerting / Active state automagically. Are there plans to fix that?
Regards,
-Denis