Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

VoIP developer guidelines for S60

From Wiki
Jump to: navigation, search
Article Metadata
Created: antonypr (23 Jun 2007)
Last edited: hamishwillee (12 Aug 2012)
Audio routing between loudspeaker and earpiece is not possible using public APIs and audio output switches between loudspeaker and earpiece unreliably due to GSM calls during a VoIP call. How do I route my VoIP audio between earpiece and loudspeaker?
  • Control over audio Routing can be achieved by partnering Audio Proxy Server (APS) 2.31 API that allows to switch audio output between earpiece and loudspeaker. Refer to its documentation to get the correct API to use. *Headset is supported irrespective of the use of this API.
  • Audio can also be routed to both earpiece and loudspeaker (when headset attached) if using Audio Output Routing API, available in the latest S60 3rd Ed. FP1 SDK Plugin.
  • Note: when audio is played using VoIP preference/priority values, then audio plays by default via earpiece on S60 3.0 and via loudspeaker on S60 3.1 devices (tested on N80 and N95)

How do I ensure that the incoming GSM call beeps when there is an incoming GSM call during an active VOIP call?

  • Use APS 2.31 API and AMR, G711, G729 or iLBC as the audio codecs for VoIP audio along with the audio priority and preference values in the test application that comes with APS. The audio policy granted will be such that S60 platform takes care of changing incoming GSM call ringtone, Clock alarm and calendar alarm sounds to beeps.
  • Without APS, the beep sound can only be achieved by changing the phone profile’s ringing type when a VoIP call is activated and changing it back to original value when voip call is ended. This can be done by using the Profile Engine API from S60 3rd Ed. SDK Plug-in.

How do I handle an incoming GSM call during an active VoIP call?

  • Detect incoming GSM call using ETEL 3rd Party API available in the S60 SDK, put the VoIP call on hold or it end completely. It can also be detected using Etel APIs which are not part of S60 SDK and need to be partnered from Symbian. The corresponding APIs in Etel might require manufacturer capability as opposed non-manufacturer capabilities required by Etel 3rd Party API. Etel 3rd party API is also referred to as CTelephony API or Etel ISV API.
  • For better control of incoming GSM call, partner Etel API from Symbian which would allow hang up a GSM call or put it on hold while the phone is ringing and not after answering and taking ownership of the call as required by CTelephony.

How can I control the Any Key Answer setting so that an incoming GSM call may not be answered using any key while my VoIP application is in focus?

  • There is no public API for this.

How do I handle outgoing GSM calls during an active VoIP call?

  • Detect outgoing call using Etel 3rd Party API available in the S60 SDK, put the VoIP call on hold or end it completely. It can also be detected using Etel APIs partnered from Symbian as explained above.
  • Cancellation of an outgoing call made from the S60 telephony application would also require Etel API from Symbian. In general Etel 3rd party can manipulate calls owned (answered or dialled) by it.

How do I know that a GSM call is active and how do I handle an incoming VoIP call during an active GSM call?

  • Detect GSM call status usin Etel 3rd Party API even if the call is not owned by your application. Then either reject VoIP call or accept it. The incoming VoIP audio will get mixed with the incoming GSM audio.

How do I handle outgoing VoIP and GSM call at the same time?

  • Detect outgoing GSM call using Etel 3rd Party API and cancel outgoing VoIP call without asking user

How do I handle incoming VoIP and GSM call at the same time?

  • Detect incoming GSM call using Etel 3rd Party API and reject VoIP call without asking user. More details in #24

Does my VoIP application need to have a UI or can it be hidden such that the user cannot differentiate between it and S60 Telephony application?

  • VoIP application will need to have a proper UI. No waivers accepted for hidden voip applications or voip applications trying to emulate Nokia VoIP. It should be clear to the user that a 3rd party application is being used and it has an icon in menu that can be used to start it.
  • VoIP service providers can get provisioning plugins developed and customised to their service for Nokia VOIP application via FN . This is useful for VoIP service providers who want to provision their service to the Nokia VoIP client.

How can I detect and make GSM emergency calls?

  • Partner Etel and Etelmm APIs from Symbian which allow detection of GSM emergency calls as well as dialing them. Etel 3rd party API does not support emergency number calling. The TSY checks whether it is Etel or CTelephony trying to make the emergency calls and only allows Etel to make them.

How can I allow the user to use the scan available Wifi networks and use them for VoIP?

  • Use RConectionMonitor API to scan for available open Wifi networks. Refer to FN Technical Library.
  • From S60 3rd Ed. SDK Plugin Use WLAN Setting UI API if there is a need to create WLAN access points with security settings. Access points for open networks can be created without using this API and by using the public Access point Item API. Tip on creating Wifi access point and connecting to it automatically is in FN Technical Library.
  • Use WLAN Management API to get more detailed information about the Wifi networks (MAC Address of AP) and more scanned results on S60 3.0.

I don’t want users to manually enter the SIP settings and want my application to set these up. How can I do this?

  • Use SIP Admin APIs for setting up SIP settings programmatically from the SDK plugin. SIP settings can be provisioned over the air on the N80 IE edition and new VoIP S60 devices. Details are available at

What audio codecs can I use for VoIP?

  • Partner APS 2.31 API to get access to commonly used voip codecs: G711, G729, iLBC, AMR.
  • PCM is not supported by APS 2.0 but is supported by APS 1.0 which cannot be used for VOIP for performance reasons. In other words, don’t use PCM for VoIP.
  • All these codecs can be configured using APS 2.31 except AMR, which needs an interface definition available in the latest SDK plugin.

Which API required to go to background when GSM call comes in and come to foreground after answering or rejecting the GSM call?

  • No API, this is how S60 functions by default with all 3rd party applications.

How do I handle the End (Red) key when only a VoIP call is active and in the foreground?

  • Red key can be handled to first end the VoIP call and then send VoIP application to background or to close it. This handling makes use of windows server events and tips on handling End key in FN Technical Library/discussion boards can be used

How do I handle the End (Red) key when a GSM call is active, and Voip Call is on hold but in foreground? This is usually the scenario when a GSM call is answered during an active VOIP call

  • Red key should be able to end the GSM call even if VOIP application is in foreground. If it is pressed again then it should end the VoIp call that is on hold and if pressed yet again it should send VoIP application to background or close it.

Can I autostart and provide a user setting fo doing so in my VoIP application?

  • It must be possible to opt-out of autostart from application’s settings.

Autostart of any application can be controlled using the tip in FN Technical Library. Search for ‘disable auto-start’

Clock alarm and calendar alarm sounds do not beep during the VoIP call. How can we ensure they beep during the VoIP call?

  • Use APS 2.31 with VoIP priority and preference values.
  • If not using APS, use Profile Engine API to change to ringing type to beep or silent, which will change the calendar alarm sound to beep as well. Or you could also use Calendar Settings API.
  • As for setting the clock alarm sound to beep, use Clock Setttings API.

Why does filling the audio data buffer with constant value produce no sound?

  • If the audio buffer is filled with a constant value there is nothing to hear. For audible audio, variation in audio samples is needed as constant frequency has sine wave form.

Does APS work on S60 3.1 or S60 3rd Edition FP1 devices?

  • APS 2. 31 supports both S60 3.0 and 3.1 devices (two separate SIS files for each platform).
  • Remember APS 2.31 is the first production quality APS and all commercial VoIP application using earlier releases of APs must update them to use this version.
  • This will also prevent updating problems that arise when two different VoIP applications are installed that contain different versions of APS though if application A uses APS 1.x and application B uses APS 2.31, then due to the change of API, the application A will cease to work. This can only be solved by changing the UID of APS 2.31 which will not be done.

APS 2.0 hangs? I have noticed that if a session to the APS is initialized but the audio is never started/stopped prior to exiting the application (closing the APS session) the APS appears to "hang". When this happens, the loopback audio test application just "hangs" at the next startup (display is blank). Is this the expected behavior? If I power off the phone and power it back on, the applications starts "working" again.

  • This is fixed in APS 2.2 onwards

Audio start/stop Sometimes when I select the Start Streaming (calls the Read/Write functions) menu option the loopback audio does not start. If I Stop Streaming (calls the Stop function) and then Start Streaming again the loopback audio will start. The value returned from the Read/Write/Stop functions is 0 in all cases. This only seems to occur on the first call to Read/Write after initialization. Subsequent calls appear to work without needing to stop and restart. Is this the expected behavior?

  • Fixed in APS 2.2 onwards

How can I improve performance of my application? Should I use active objects or a multithreaded approach? How do minimise audio data packet drops or delays?

  • Use a multithreaded approach to do the VoIP communication so that it does not run in the same thread as the UI. Refer to the Streamer example to see how to synchronize threads.

How do I take care of hotspot browser based authentication?

  • A Hotspot framework is coming for 3.x for a which a plugin can be written to handle the authentication
  • Use OSS browser and not the Services browser as the latter does not seem to get redirected to the authentication pages that most hotspots require browsers to do.

How to set WLAN QoS for voice?

  • The WLAN Quality of Service can be set using the SetOpt call of RSocket. The following code snippet sets the Quality of Service of our WLAn connection as VOICE. iSocket.SetOpt(KSoIpTOS, KSolInetIp, 0xE0); This will require NetworkControl manufacturer Capability.

How do I handle an incoming GSM call/Alarm Notification/Camera during an incoming VoIP call? These cause incoming VoIP (MP3 file based) ringtone to become silent even after each of these interruptions have ended.

  • Detect the GSM call, and end/reject the VoIP call. When both, a VoIP call and GSM call, come in at the same time then GSM call should get higher priority.
  • No solution for the alarm notification or camera application running during an incoming voip call so best is to detect these events, stop ringtone playback and re-start it when these applications have exited and if the incoming call is still supposed to ring.

Codec Information


  • G.711 & iLBC encoded buffers (i.e. the encoder output and the decoder input) will have a 1 word header at the start of the buffer and hence are 162 & 52 bytes respectively. Header format is same for G711 and iLBC. This will be set to one of the 3 unsigned 16 bit values shown in the table (therefore, the 2 extra bytes used in APS). Usually value of 1 will be used if VAD is not activated for the codec. Table shows only the G711/iLBC header and not the audio data. This will be the format for both the encoder output buffer and the decoder input buffer. The developer needs to add this header before supplying audio packet to the decoder.


  • Table shows both G729 header and audio data. G729 is frame below shows the 2 byte header outputbuf[0] and the data that follows depends on the value of this header, which can be either SID rate (15 bits using 8 bytes) or it can be Full rate (80 bits, using 22 bytes). The header value is set on an incoming audio packet using information from the RTP headers and will usually be 1 if VAD is not activated for the codec. The reason G729 packet is 24 bytes and 10 ms is because if you add the bits in the Full rate audio packet, they will add up to 80 bits or 10 bytes, which use 22 bytes of buffer due to word alligment. Add the 2 byte header to this and it gives you 24 bytes. G729 audible packet is always 10ms at is is sampled at 8 kb/s (80bits/8000b/s = 10ms).

WMM Access Category for Wireless LAN

  • WLAN connection as such does not have a specific access category. Instead, WLAN driver places each transmitted IP packet into one of the four access categories, using the DSCP bits of the IP header. The table below shows how the WLAN driver maps the IP packets to the WLAN access categories,

AC_VO = Voice AC_VI = Video AC_BE =Best Effort AC_BK = Background


  • Not all S60 3rd edition devices have WMM certification – more information at
  • The application sets the DSCP bits using Symbian Socket API and can reduce battery consumption upto 25% using AC_VO:
    • Rsocket::SetOpt(KSoIpTOS, KProtocolInetIp, xx)
    • Where xx is the hex DSCP value multiplied by for (i.e., shifted left by two bits).
  • Power save is enabled for voice by default if the AP uses U-APSD power save (also know as WMM power save). If the AP only supports "legacy" power save, then we switch to active mode during the data transfer. There isn't any API to control this behaviour.
This page was last modified on 12 August 2012, at 23:27.
43 page views in the last 30 days.