×
Namespaces

Variants
Actions

Telephony API using Qt Mobile Extension

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Compatibility
Platform(s):
Symbian
Article
Created: chintandave_er (07 Nov 2010)
Last edited: hamishwillee (11 Oct 2012)

This article shows how you can use the Qt Telephony Mobile Extension (XQTelephony) to make circuit switched calls and get call status notifications.

Warning.pngWarning: Note that Archived:Mobile Extensions are deprecated, and cross platform Qt Mobility APIs should be used instead. However at time of writing Qt Mobility 1.1 does not have telephony support.

Contents

Precondition

  • In order to use an extension you need to add the source files of that extension to your project in your IDE and build them together as part of your application source codes.
  • You can get more information about Mobile extension from Archived:Mobile Extensions
  • Please read this Wiki article for How to use Mobile Extension APIs in Qt

Headers

#include <XQTelephony>

Making a Circuit-Switched Telephone Call

XQTelephony* telephony = new XQTelephony(this);
telephony->call("+9190000000000");


Get Notification of the call status change

    XQTelephony* telephony = new XQTelephony(this);
 
// Connect lineStatusChanged() Signal to handleStatusChange() Slot
connect(telephony, SIGNAL(lineStatusChanged(XQTelephony::LineStatus, QString)),this, SLOT(handleStatusChange(XQTelephony::LineStatus, QString)));
 
// Our slot for handling telephone line status changes
void MyTelephoneLineListener::handleLineStatusChange(XQTelephony::LineStatus status, QString number)
{
switch(status)
{
 
case XQTelephony::StatusRinging:
{
 
}
case XQTelephony::StatusIdle:
{
 
}
case XQTelephony::StatusDialling:
{
 
}
case XQTelephony::StatusConnecting:
{
 
}
case XQTelephony::StatusConnected:
{
 
}
case XQTelephony::StatusDisconnecting:
{
 
}
case XQTelephony::StatusHold:
{
 
}
case XQTelephony::StatusTransferring:
{
 
}
}
 
}


Get Notification for the Incoming call

To get notification for incoming call, the LineStatus of the call is StatusRinging


XQTelephony* telephony = new XQTelephony(this);
 
// Connect lineStatusChanged() Signal to handleStatusChange() Slot
connect(telephony, SIGNAL(lineStatusChanged(XQTelephony::LineStatus, QString)),this, SLOT(handleStatusChange(XQTelephony::LineStatus, QString)));
 
// Our slot for handling telephone line status changes
void MyTelephoneLineListener::handleLineStatusChange(XQTelephony::LineStatus status, QString number)
{
switch(status)
{
// get notification for incoming call
case XQTelephony::StatusRinging:
{
// Incoming call comes.
// add action
}
}
}
This page was last modified on 11 October 2012, at 04:18.
66 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×