×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    7

    DialNewCall CTelephony example?

    Does anyone have a good resource for an example of dialing a call on an S60. I am hoping for an example that I can import, compile, and run in Carbide.c++ 1.3.

    I have found several DialNewCall examples, and I can get most of them to compile, but when the dial code runs the app just crashes on my N95. I'm new to the entire Symbian development, so I'm for sure just doing things wrong.

    Importing a working example to examine seems to be the easiest way of learning!

    Thanks.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    Re: DialNewCall CTelephony example?

    I am not sure if complete examples exist for that (S60 2nd edition SDK-s contain S[eries]60Ex\dialer as I remember, but it is not present in 3rd edition SDK-s). The example in the SDK Help seems to be almost OK, if you complete the active object implementation (for example CActiveScheduler::Add seems to be missing), it should be fine.
    And if you experience crashes, you can reveal the panic code following this link: http://wiki.forum.nokia.com/index.ph...ded_panic_code

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    7

    Re: DialNewCall CTelephony example?

    Thanks for the tip on the CActiveScheduler. I added some lines for that and now my app doesn't crash. The phone does dial either, but it's a start. I'll paste my mostly stolen and pieced together calling class and maybe you can see what I am doing wrong.

    If it's not my calling code, then it is probably how I am using the ActiveScheduler.

    Here is my calling code:
    Code:
    CClientApp* c = new CClientApp(CTelephony::NewL());
    c->Dial();
    CClientApp.h:
    Code:
    #ifndef CCLIENTAPP_H_
    #define CCLIENTAPP_H_
    
    #include <e32base.h>
    #include <Etel3rdParty.h>
    
    class CClientApp : public CActive
        {
        
    private:
        CTelephony* iTelephony;
        CTelephony::TCallId iCallId;
    
    public:
        CClientApp(CTelephony* aTelephony);
        void Dial();
    
    private:
        void RunL();
        void DoCancel();
    
    };
    #endif /*CCLIENTAPP_H_*/
    And finally CClientApp.cpp:
    Code:
    #include <e32base.h>
    #include <Etel3rdParty.h>
    #include <CClientApp.h>
    
    _LIT(KTheNumber, "6157209901");  /AT&T voicemail
    
    CClientApp::CClientApp(CTelephony* aTelephony)
        : CActive(EPriorityStandard),
          iTelephony(aTelephony)
        {
        //default constructor
        }
    
    void CClientApp::Dial()
        {
        CTelephony::TTelNumber telNumber(KTheNumber);
    
        CTelephony::TCallParamsV1 callParams;
        callParams.iIdRestrict = CTelephony::ESendMyId;
        CTelephony::TCallParamsV1Pckg callParamsPckg(callParams);
    
        CActiveScheduler::Start();
        CActiveScheduler::Add(this);
        iTelephony->DialNewCall(iStatus, callParamsPckg, telNumber, iCallId);
        SetActive();
        }
    
    void CClientApp::RunL()
        {
        if(iStatus==KErrNone)
           {} 
        }
    
    void CClientApp::DoCancel()
        {
        iTelephony->CancelAsync(CTelephony::EDialNewCallCancel);
        }

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    Re: DialNewCall CTelephony example?

    CActiveScheduler::Start is a tricky metod: it starts the active scheduler's dispatcher loop, which is an endless one by default (it will return if someone invokes CActiveScheduler::Stop).
    So if your code is a GUI-less one, you should move this line after the SetActive. If your code is inside a GUI application, you should simply forget this line (the scheduler loop is already running in case of GUI apps, in fact everything in a GUI app happens inside that loop).
    And in general, variables participating in asynchronous service invocations (like DialNewCall in this case) should be member variables of the given class.

  5. #5
    Registered User
    Join Date
    Mar 2003
    Posts
    7

    Re: DialNewCall CTelephony example?

    I removed the Start like you sugguest since I didn't think it was needed either (GUI), but I was able to figure out what was missing.

    I had to add NetworkServices to the .mmp and it works perfectly.

  6. #6
    Registered User
    Join Date
    Oct 2008
    Posts
    1

    Re: DialNewCall CTelephony example?

    I cant find the CActiveScheduler::Start in the HelloWorld example included in the S60 SDK 3er ed.

    It is a GUI app


    I have the same problem, I would like to make a call


    Thanks!

  7. #7
    Registered User
    Join Date
    Jun 2006
    Location
    India
    Posts
    1,043

    Re: DialNewCall CTelephony example?

    Hi,
    In case you are having a GUI app you dont need to start Active scheduler.You can also check this example on making call
    http://wiki.forum.nokia.com/index.ph...ith_CTelephony
    Maximus
    S60 Developer
    Impossible is nothing

Similar Threads

  1. Replies: 9
    Last Post: 2010-07-12, 13:25
  2. CTelephony on 2nd ed and 3rd ed any issues?
    By Akorth in forum Symbian
    Replies: 4
    Last Post: 2007-10-12, 09:33
  3. Using DialNewCall being self signed
    By wirefree in forum Symbian Networking & Messaging (Closed)
    Replies: 3
    Last Post: 2007-08-12, 14:42
  4. Replies: 3
    Last Post: 2007-03-29, 12:23
  5. Replies: 4
    Last Post: 2006-10-19, 12:48

Posting Permissions

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