none
Agents in WP8 VoIP app ?

    Question

  • I have these questions related to Agents in VoIP for WP8 app

    1. VoipForegroundLifetimeAgent is said to keeps the background process alive while the foreground app is active. I don't see it useful. During call, user can answer real GSM call, and your foreground process is killed. Why should we use it ?

    Furthermore, I see the ChatterBox sample app launchs VoipForegroundLifetimeAgent every time the foreground process Launch or Activate. Is this agent useful in both Outgoing and Incoming scenario ?

    2. When using callCoordinator->RequestNewIncomingCall, the built-in Incoming screen is shown, which is not always what we need, for sometimes our app is not in English, is there a workaround to change this screen ?

    3. I see that I don't need these agents. I just call VoipPhoneCall->NotifyCallActive, which is said to let the OS allocate more CPU for our app 's audio processing. This way, I can use whatever screen I want
    Thursday, August 29, 2013 3:19 AM

Answers

  • Hi,

    Let me clear you on your questions one by one.

    1. WeChat is not true VOIP app Mean they are not using VOIP capability and VOIP Agents in Windows Phone. They are doing very simple thing. When User A Is trying To Call User B Then User A Send Call Request To WeChat Server And We Chat Servers Sends PushNotification To User B Device And It Get Notified That You Got Some Push Notification With Text That You Are Getting Some Call (But in True WP8 Apps you Got Incoming Call Screen When you Got Some call on VOIP) If Users Taps On That Toast Notification Then App Reads The Payload And Connect The Call Through WeChat Servers. They Are not using RTP Protocols Only Making Calls By Involving Thier Servers No Sockets Involved or TLS As Per My Knowledge.

    2. Why should we use ForegroundLifetimeAgent? Just to keep the background process alive while foreground is active???

    This forgorund lifetime agents Make Your Client Side And Server Side SIP Session Active and Reconnect Again And Again After Some Certain Time Period Normally 300Secs And Sending The Sip Register Packets To Server So You Can Receive Invite Packets From Other Parties For Calls And Call Can Be Gone Through VOIP. That is Standard VOIP And SIP Implementation.

    3. I don't see these agents useful. I think the main purpose is to call VoipPhoneCall->

    NotifyCallActive, which will tell the OS to allocate more CPU for my app.

    These Agents Are Very Usefull to notify your OS And App Tell That You Are Getting VOIP Call. Lets Take One Example. You Are Using VOIP App And You Are App is not running But There is One VOIP Agent is running in Background That Will Be Listening Everytime for Incoming Call Pushnotifications. What Does It Do. It Basically Shows You SIP Incoming Call Screen And Also Registers you With Your SIP Server to recieve that call and make connection with device side with server.

    I hope this will helps you And I must say WP8 have very good support for VOIP Apps.


    Arslan Pervaiz
    _______________________________
    Mark As Answer If It Helps You

    • Marked as answer by onmyway133 Friday, August 30, 2013 11:29 AM
    Friday, August 30, 2013 7:33 AM

All replies

  • Hi O,

    Please read this which describes the agents in detail:

    http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj206983(v=vs.105).aspx

    Then post back if you need further clarification.

    Jeff


    Jeff Sanders (MSFT)

    @jsandersrocks - Windows Store Developer Solutions @WSDevSol
    Getting Started With Windows Azure Mobile Services development? Click here
    Getting Started With Windows Phone or Store app development? Click here
    My Team Blog: Windows Store & Phone Developer Solutions
    My Blog: Http Client Protocol Issues (and other fun stuff I support)

    Thursday, August 29, 2013 1:27 PM
    Moderator
  • Hi Jeff, I've already read that many times. Please see my questions above

    In brief

    1. Why should we use ForegroundLifetimeAgent? Just to keep the background process alive while foreground is active???

    2,3. I don't see these agents useful. I think the main purpose is to call VoipPhoneCall->NotifyCallActive, which will tell the OS to allocate more CPU for my app. 

    According to this http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj207046(v=vs.105).aspx Creating the audio interfaces using AudioDeviceRole.Communications causes them to have some special behaviors on the phone

    If we don't call NotifyCallActive, we can't use Communications wasapi mode. If we use Default mode, our voip processing could be slow. 

    Have you taken a look at some other VoIP app on WPStore (such as WeChat, ...), they have custom incoming call screen !!!!!!



    • Edited by onmyway133 Friday, August 30, 2013 2:38 AM
    Friday, August 30, 2013 2:38 AM
  • Hi,

    Let me clear you on your questions one by one.

    1. WeChat is not true VOIP app Mean they are not using VOIP capability and VOIP Agents in Windows Phone. They are doing very simple thing. When User A Is trying To Call User B Then User A Send Call Request To WeChat Server And We Chat Servers Sends PushNotification To User B Device And It Get Notified That You Got Some Push Notification With Text That You Are Getting Some Call (But in True WP8 Apps you Got Incoming Call Screen When you Got Some call on VOIP) If Users Taps On That Toast Notification Then App Reads The Payload And Connect The Call Through WeChat Servers. They Are not using RTP Protocols Only Making Calls By Involving Thier Servers No Sockets Involved or TLS As Per My Knowledge.

    2. Why should we use ForegroundLifetimeAgent? Just to keep the background process alive while foreground is active???

    This forgorund lifetime agents Make Your Client Side And Server Side SIP Session Active and Reconnect Again And Again After Some Certain Time Period Normally 300Secs And Sending The Sip Register Packets To Server So You Can Receive Invite Packets From Other Parties For Calls And Call Can Be Gone Through VOIP. That is Standard VOIP And SIP Implementation.

    3. I don't see these agents useful. I think the main purpose is to call VoipPhoneCall->

    NotifyCallActive, which will tell the OS to allocate more CPU for my app.

    These Agents Are Very Usefull to notify your OS And App Tell That You Are Getting VOIP Call. Lets Take One Example. You Are Using VOIP App And You Are App is not running But There is One VOIP Agent is running in Background That Will Be Listening Everytime for Incoming Call Pushnotifications. What Does It Do. It Basically Shows You SIP Incoming Call Screen And Also Registers you With Your SIP Server to recieve that call and make connection with device side with server.

    I hope this will helps you And I must say WP8 have very good support for VOIP Apps.


    Arslan Pervaiz
    _______________________________
    Mark As Answer If It Helps You

    • Marked as answer by onmyway133 Friday, August 30, 2013 11:29 AM
    Friday, August 30, 2013 7:33 AM
  • Hi Arslan, thanks for your reply

    1. I see that what ChatterBox eventually does is trying to call NotifyCallActive, so that our app can be allocated more CPU for rtp and audio processing.

    If WeChat does not act this way (it actually does not), then they must have a VERY EFFICIENT way to encode and stream audio data

    2,3. I forgot about the reREGISTER :)



    • Edited by onmyway133 Friday, August 30, 2013 11:56 AM
    Friday, August 30, 2013 11:29 AM
  • I also need to add SIP account information but I am not getting any place where i can add this SIP configuration. I am a newbie in wphone development. 

    also chatterbox example is not working i.e. no call are being done actually and no errors are shown.

    kindly help. 

    Wednesday, October 09, 2013 7:12 AM