×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Oct 2003
    Posts
    8

    Problem in compiling telephony application on ARMIB platform

    Hi,

    I am making an application that needs to dial a no. and once the phone call is established, the control must return to the application. Then the user accesses a menu in the application and selects options, each of which send DTMF tones over the established connection. My main problem is that once a connection is established, how does control return back to the application that initiated the call?

    I have tried the following code (obtained fron the forum itself) and have a problem in compiling it. On the ARMIB platform, I get an error "Dialer[xxx].app contains uninitialized data" where Dialer is the app name and xxx are some digits. However, the same code, when I compiled on the WINSB platform gave no errors. Can you tell me a possile reason?
    I am using the Borland C++ mobile edition.

    class myAppUi
    {
    ...
    TInt CallNumber();
    TInt DoCallNumber();
    static TInt DoCall(TAny *aAppUi);
    ...
    private:
    CIdle* iPhoneCall;
    RCall call;
    RTelServer server;
    ...
    };

    _LIT(KTsyName, "Phonetsy.tsy"); //phone constant

    void myAppUi::CallNumber()
    {

    // The name of the TSY to use to make the call.

    RTelServer::TPhoneInfo info;
    RPhone::TLineInfo lineInfo;

    // Connect to the telephony server and load the TSY.

    User::LeaveIfError(server.Connect());
    User::LeaveIfError(server.LoadPhoneModule(KTsyName));

    // Get the details for the first (and only) phone.
    User::LeaveIfError(server.GetPhoneInfo(0, info));

    // Open the phone.
    RPhone phone;
    User::LeaveIfError(phone.Open(server, info.iName));

    // Get the information for the voice line, line 0.
    User::LeaveIfError(phone.GetLineInfo(0, lineInfo));

    // Open the line. iName will now be "VoiceLine1".
    RLine line;
    User::LeaveIfError(line.Open(phone, lineInfo.iName));

    // Open a new phone call.
    _LIT(KPhoneNumber, "18888888888");
    call.Dial(KPhoneNumber);

    if (!(iPhoneCall))
    {
    iPhoneCall = CIdle::NewL(CActive::EPriorityIdle);
    }

    iPhoneCall->Start(TCallBack(DoCall,this));

    }
    TInt CNokiaREAppView:oCall(TAny *aAppUi)
    {
    return ((myAppUi*)aAppUi)->DoCallNumber();
    }

    TInt myAppUi:oCallNumber()
    {

    TBool ret;
    RCall::TStatus iCallStatus;
    call.GetStatus(iCallStatus);

    // check for status of the call set ret to ETrue when hannging up
    // or idle. and bring app to front

    if (iCallStatus == RCall::EStatusHangingUp || iCallStatus == RCall::EStatusIdle)
    {
    ret = EFalse; //finished do not come back
    //bring app to foreground
    TApaTask task(wsSession);
    task.SetWgId(CEikonEnv::Static()->RootWin().Identifier())
    task.BringToForeground();
    User::LeaveIfError(server.UnloadPhoneModule(KTsyName));
    }
    else
    ret = ETrue; //not finish, do come back

    return ret;
    }

    Please try and help me with this problem...

    Thanks and regards,
    Aditya

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,165
    Hi

    Maybe you should the call handling into its own class. And make it as an active object. Then you could get the changes is call status by using the NotifyStatusChange()-function of the RCall class.

    yucca

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    17
    Hi,

    this error message usually means that you have either static or global data (except for _LIT()s ) in your app. This however is only allowed on the WINS platform.
    If you need to have static or global data you should have a look at http://www.peroon.co.il/epocstat.html

    Hope this helps.

    Cheers,
    Pawel

  4. #4
    Registered User
    Join Date
    Oct 2003
    Posts
    8

    Thanks, it compiles, but another problem

    hi,

    I could get rid of the error. Thanks!

    But, now I have a problem of a more serious nature..
    In my app, I want to dial and then once the call is established, I want to bring my app in the foreground and perform some functions like sending DTMF tones over the established connection. However, the code that I referred to earlier doesn't seem to be doing that. I modified the function DoCallNumber to look like this -

    if (iCallStatus == RCall::EStatusConnected)
    {
    ret = EFalse;
    //bring app to foreground
    TApaTask task(CCoeEnv::Static()->WsSession());
    task.SetWgId(CEikonEnv::Static()->RootWin().Identifier())
    task.BringToForeground();
    User::LeaveIfError(server.UnloadPhoneModule(KTsyName));
    }
    else
    ret = ETrue; //not finish, do come back

    return ret;
    }

    But once the call is established, my app simply closes.
    Is there any other way I can achieve my goal?

    Thanks in advance!

    Regards,
    Aditya

  5. #5
    Registered User
    Join Date
    Mar 2003
    Posts
    17
    Hi again,

    as i don't have experience with user interface programming i cannot tell for sure you why your app closes. However there is something in your code which i find quite striking: User::LeaveIfError(server.UnloadPhoneModule(KTsyName));

    Why are you trying to unload a TSY during an active call ? This call is doomed to fail IMHO. This in turn would lead to a leave from the method you pasted.
    And perhaps this is also the reason for your app's exit.

    Cheers,
    Pawel

  6. #6
    Regular Contributor
    Join Date
    Sep 2003
    Posts
    169

    Problem in compiling telephony application on ARMIB platform

    Hey,

    This is the same problem I seem to be having. Once you get a call you application stays in the background and I have not found a way to bring it back to foreground yet. Although I can do that for voice calls (by calling NotifyIncomgCall() method of my RLine object inside an Active object, when you manually accept the call my application shows up again....) I cannot seem to do that for data calls. If you find anything out please let me know.

    Regards, Aljaz

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×