×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Aug 2006
    Posts
    7

    Unhappy Problem with SIP client example

    hi all,

    i found this sip example in nokia pdf, but i'm not able to compile..
    here is my code:

    ///////////////////////////////////////////////////////////
    /////////////CSIPExample.h/////////////////////////////////
    ///////////////////////////////////////////////////////////
    class CSIPProfileRegistryObserver;
    class CSIPObserver;
    class CSIPConnectionObserver;
    class CSIP;
    class CSipProfileRegistry;
    class CSipProfileRegistry;
    class CSIPProfile;
    class CSIPConnection;
    class CSIPInviteDialogAssoc;
    class CSIPFromHeader;
    class CSIPToHeader;
    class CSIPContactHeader;
    class CSIPAddress;
    class CSIPClientTransaction;
    class CSIPResponseElements;
    class CSIPRequestElements;

    class CSIPExample :
    public CBase,
    public MSIPProfileRegistryObserver,
    public MSIPObserver,
    public MSIPConnectionObserver
    {
    public:
    //Ste aggiunte
    CSIPInviteDialogAssoc* CreateSIPInviteDialogAssoc();
    void ExecuteL();



    static CSIPExample* NewL(TUid aUid);
    // MSIPProfileRegistryObserver implementation.
    // Move to cpp-file if further implementation.
    void ProfileCreated(TUint32 /*aSIPProfileId*/){}
    void ProfileUpdated(TUint32 /*aSIPProfileId*/){}
    void ProfileDestroyed(TUint32 /*aSIPProfileId*/){}
    void ProfileRegistryErrorOccurred(
    TUint32 /*aSIPProfileId*/,TInt /*aError*/){}
    // MSIPObserver implementation.
    // Move to cpp-file if further implementation.
    void IncomingRequest(
    TUint32 /*aIapId*/, CSIPServerTransaction* /*aTransaction*/){}
    virtual void TimedOut(
    CSIPServerTransaction& /*aSIPServerTransaction*/){}
    // MSIPConnectionObserver implementation.
    // Move to cpp-file if further implementation.
    void IncomingRequest (
    CSIPServerTransaction* /*aTransaction*/,
    CSIPDialog& /*aDialog*/){}
    void IncomingResponse (
    CSIPClientTransaction& /*aTransaction*/){}
    void IncomingResponse (
    CSIPClientTransaction& /*aTransaction*/,
    CSIPInviteDialogAssoc* /*aDialogAssoc*/){}
    void IncomingResponse (
    CSIPClientTransaction& /*aTransaction*/,
    CSIPRegistration& /*aRegistration*/){}
    void ErrorOccured (
    TInt /*aError*/,
    CSIPTransactionBase& /*aTransaction*/){}
    void ErrorOccured (
    TInt /*aError*/,
    CSIPClientTransaction& /*aTransaction*/,
    CSIPRegistration& /*aRegistration*/){}
    void ErrorOccured (
    TInt /*aError*/,
    CSIPTransactionBase& /*aTransaction*/,
    CSIPDialogAssocBase& /*aDialogAssoc*/){}
    void ErrorOccured (
    TInt /*aError*/,
    CSIPRefresh& /*aSIPRefresh*/){}
    void ErrorOccured (
    TInt /*aError*/,
    CSIPRegistration& /*aRegistration*/){}
    void ErrorOccured (
    TInt /*aError*/,
    CSIPDialogAssocBase& /*aDialogAssoc*/){}
    void InviteCompleted (
    CSIPClientTransaction& /*aTransaction*/){}
    void ConnectionStateChanged (
    CSIPConnection::TState /*aState*/){}
    private:
    CSIPExample(TUid& aUid){iUid = aUid;}
    void ConstructL(){}
    CSIP* iSIP;
    CSIPProfileRegistry* iProfileRegistry;
    CSIPProfile* iProfile;
    CSIPConnection* iConnection;
    TUid iUid;
    CSIPClientTransaction* iSIPClientTransaction;
    CSIPInviteDialogAssoc* iSIPInviteDialogAssoc;
    }

  2. #2
    Registered User
    Join Date
    Aug 2006
    Posts
    7

    Re: Problem with SIP client example

    /////////////////////////////////////////////////////
    /////////////////CSIPExample.cpp/////////////////////
    /////////////////////////////////////////////////////
    #include <SIPProfileRegistryObserver.h>
    #include <SIPObserver.h>
    #include <SIPConnectionObserver.h>
    #include <SIP.h>
    #include <SipProfileRegistry.h>
    #include <SipProfileRegistry.h>
    #include <SIPProfile.h>
    #include <SIPConnection.h>
    #include <SIPInviteDialogAssoc.h>
    #include <SIPFromHeader.h>
    #include <SIPToHeader.h>
    #include <SIPContactHeader.h>
    #include <SIPAddress.h>
    #include <SIPClientTransaction.h>
    #include <SIPResponseElements.h>
    #include <SIPRequestElements.h>
    #include "CSIPExample.h"

    CSIPExample* CSIPExample::NewL(TUid aUid) ´
    {
    CSIPExample* self = new( ELeave ) CSIPExample( aUid );
    CleanupStack::PushL( self );
    self->ConstructL();
    CleanupStack::Pop();
    return self;
    }

    void CSIPExample::ExecuteL()
    {
    // Initialize SIP Stack
    iSIP = CSIP::NewL(iUid, *this);
    // Initialize ProfileRegistry
    iProfileRegistry = CSIPProfileRegistry::NewL(*iSIP, *this);
    // Get the default profile.
    iProfile = iProfileRegistry->DefaultProfileL();
    // The client asks the API to enable the retrieved profile for its use.
    // For that, the client must inherit and implement MSIPConnectionObserver.
    TInt status = iProfileRegistry->EnableL(*iProfile, *this);
    // The returned status indicates if the profile can be immediately used
    // for creating a session, or if the client must wait for the profile to
    // be registered.
    if (status == KErrNone)
    {
    // get the SIP connection used by the profile
    iConnection = iProfileRegistry->ConnectionL(*iProfile);
    // create a SIP dialog for sending an INVITE;
    iSIPInviteDialogAssoc =
    CreateSIPInviteDialogAssoc();
    // Continue session establishement using the SIP Client API
    iSIPClientTransaction = iSIPInviteDialogAssoc->SendInviteL();
    }
    else //KErrPending
    {
    // wait for the profile to be registered before using it further
    }
    // Next look at
    // ProfileRegistrationStatusChanged(TUint32 aSIPProfileId)
    // method. Response for REGISTER request is handled there.
    }


    /**
    * Constructs CSIPInviteDialogAssoc object for test purposes.
    * @return CSIPInviteDialogAssoc object
    */
    CSIPInviteDialogAssoc* CSIPExample::CreateSIPInviteDialogAssoc()
    {
    // Construct toHeader. Note that we use possibly non-existing
    // opponent SIP Address.
    CSIPAddress* toAddress =
    CSIPAddress:ecodeL(_L8("sippponent@opponentdomain.com"));
    CleanupStack::PushL(toAddress);
    CSIPToHeader* toHeader = CSIPToHeader::NewL(toAddress);
    CleanupStack::Pop(toAddress);
    CleanupStack::PushL(toHeader);
    // and construct CSIPInviteDialogAssoc by using
    // from- and toHeaders:
    CSIPInviteDialogAssoc* inviteDialogAssoc =
    CSIPInviteDialogAssoc::NewL(
    *iConnection,
    toHeader,
    *iProfile );
    CleanupStack::Pop(toHeader);
    return inviteDialogAssoc;
    }
    //MSIPProfileRegistryObserver implementation:
    void CSIPExample::ProfileRegistrationStatusChanged(TUint32 aSIPProfileId)
    {
    // First inform User Interface that this method is being called
    User::InfoPrint(_L("ProfileRegistrationStatusChanged"));
    // Check that the changed profile is the same we use
    if (aSIPProfileId == iProfile->Id())
    {
    // Check that registration to the server was successful
    if ( iProfile->Status() == CSIPProfile::ERegistered)
    {
    // Get a connection object from ProfileRegistry.
    // Note: this can only be done after successful
    // registration.
    iConnection = iProfileRegistry->ConnectionL(*iProfile);
    // Continue this example application directly by
    // sending INVITE request.
    iSIPInviteDialogAssoc =
    CreateSIPInviteDialogAssoc();
    iSIPClientTransaction = iSIPInviteDialogAssoc->SendInviteL();
    }
    }
    }
    ~CSIPExample()
    {
    delete iSIP;
    }
    // MSIPConnectionObserver implementation
    void CSIPExample::IncomingResponse (
    CSIPClientTransaction& aTransaction,
    CSIPDialogAssocBase& aDialogAssoc)
    {
    User::InfoPrint(_L("IncomingResponse"));
    // ACK is sent to any 2xx response
    if (aTransaction.ResponseElements()->StatusCode() >= 200
    && aTransaction.ResponseElements()->StatusCode() < 300)
    {
    // Send ACK message:
    iSIPInviteDialogAssoc->SendAckL(aTransaction);
    }
    }
    // MSIPConnectionObserver implementation.
    void CSIPExample::IncomingRequest (CSIPServerTransaction* aTransaction)
    {
    // handle incoming request by using SIP API.
    // CSIPRequestElements reqElem = aTransaction->RequestElements()
    // …
    }

    //////////////////END///////////////////////


    I only include these file in my helloworld project made with Microsoft Visual C++ .NET 2003

    I get this error:

    c:\Progetti\Mmcli_sip\testApp\SIPtest\SIPtest\CSIPExample.cpp(113): error C2065: 'iSIP' : undeclared identifier
    c:\Progetti\Mmcli_sip\testApp\SIPtest\SIPtest\CSIPExample.cpp(21): error C2143: syntax error : missing ';' before '*'
    c:\Progetti\Mmcli_sip\testApp\SIPtest\SIPtest\CSIPExample.cpp(22): error C2146: syntax error : missing ';' before identifier ''
    c:\Progetti\Mmcli_sip\testApp\SIPtest\SIPtest\CSIPExample.cpp(21): error C2259: 'CSIPExample' : cannot instantiate abstract class
    due to following members:
    'void MSIPProfileRegistryObserver::ProfileRegistrationStatusChanged(TUint32)' : pure virtual function was not defined
    C:\Symbian\7.0s\Series60_v21\\Epoc32\include\sipprofileregistryobserver.h(71) : see declaration of 'MSIPProfileRegistryObserver::ProfileRegistrationStatusChanged'
    'void MSIPConnectionObserver::IncomingRequest(CSIPServerTransaction *)' : pure virtual function was not defined
    C:\Symbian\7.0s\Series60_v21\\Epoc32\include\sipconnectionobserver.h(62) : see declaration of 'MSIPConnectionObserver::IncomingRequest'
    'void MSIPConnectionObserver::IncomingResponse(CSIPClientTransaction &,CSIPDialogAssocBase &)' : pure virtual function was not defined
    C:\Symbian\7.0s\Series60_v21\\Epoc32\include\sipconnectionobserver.h(93) : see declaration of 'MSIPConnectionObserver::IncomingResponse'
    c:\Progetti\Mmcli_sip\testApp\SIPtest\SIPtest\CSIPExample.cpp(112): error C2373: 'CSIPExample' : redefinition; different type modifiers
    CSIPExample.cpp(21) : see declaration of 'CSIPExample'
    c:\Progetti\Mmcli_sip\testApp\SIPtest\SIPtest\CSIPExample.cpp(22): error C2470: 'operator`'' : looks like a function definition, but there is no formal parameter list; skipping apparent body
    c:\Progetti\Mmcli_sip\testApp\SIPtest\SIPtest\CSIPExample.cpp(90): error C2509: 'ProfileRegistrationStatusChanged' : member function not declared in 'CSIPExample'
    c:\PROGETTI\MMCLI_SIP\testApp\SIPtest\SIPtest\CSIPExample.h(22) : see declaration of 'CSIPExample'
    c:\Progetti\Mmcli_sip\testApp\SIPtest\SIPtest\CSIPExample.cpp(131): error C2511: 'void CSIPExample::IncomingRequest(CSIPServerTransaction *)' : overloaded member function not found in 'CSIPExample'
    c:\PROGETTI\MMCLI_SIP\testApp\SIPtest\SIPtest\CSIPExample.h(22) : see declaration of 'CSIPExample'
    c:\Progetti\Mmcli_sip\testApp\SIPtest\SIPtest\CSIPExample.cpp(119): error C2511: 'void CSIPExample::IncomingResponse(CSIPClientTransaction &,CSIPDialogAssocBase &)' : overloaded member function not found in 'CSIPExample'
    c:\PROGETTI\MMCLI_SIP\testApp\SIPtest\SIPtest\CSIPExample.h(22) : see declaration of 'CSIPExample'
    c:\Progetti\Mmcli_sip\testApp\SIPtest\SIPtest\CSIPExample.cpp(21): error C2512: 'CSIPExample' : no appropriate default constructor available
    c:\Progetti\Mmcli_sip\testApp\SIPtest\SIPtest\CSIPExample.cpp(113): error C2541: 'delete' : cannot delete objects that are not pointers
    c:\Progetti\Mmcli_sip\testApp\SIPtest\SIPtest\CSIPExample.cpp(111): error C2588: '::~CSIPExample' : illegal global destructor
    c:\Progetti\Mmcli_sip\testApp\SIPtest\SIPtest\CSIPExample.cpp(22): error C2761: 'CSIPExample *CSIPExample::NewL(TUid)' : member function redeclaration not allowed
    c:\Progetti\Mmcli_sip\testApp\SIPtest\SIPtest\CSIPExample.cpp(21): error C3209: '' : Unicode identifiers are not yet supported
    c:\Progetti\Mmcli_sip\testApp\SIPtest\SIPtest\CSIPExample.cpp(114): warning C4508: 'CSIPExample' : function should return a value; 'void' return type assumed

    thanks for help.. i'm not skilled in C++ for Symbian..
    Ste

  3. #3
    Registered User
    Join Date
    Aug 2006
    Posts
    7

    Re: Problem with SIP client example

    please help

Similar Threads

  1. Problem Running JSR 180 SIP Example !!!
    By sujoydas in forum Mobile Java General
    Replies: 3
    Last Post: 2008-04-27, 13:16
  2. SDK 3rd and SIP problem
    By scarex80 in forum Symbian Networking & Messaging (Closed)
    Replies: 10
    Last Post: 2006-12-14, 12:22
  3. client server connection problem
    By jeff4yee in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2006-09-28, 11:11
  4. UDP and SIP problem?
    By PrinceAlbertz in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2006-05-30, 13:10
  5. SIP capabilities problem
    By ademar123 in forum Symbian
    Replies: 0
    Last Post: 2005-05-11, 15:32

Posting Permissions

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