×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    May 2006
    Posts
    86

    CSIPExample fail on symbian 8.1a emulator

    hi
    i'm trying to make a simple sip client using CSIPExample
    the compilation is ok , but when i try to run it on the emulator
    i get "system error" and the application does not start.

    the sip plug-in was copied from sdk 8.0a (seem like there is
    no plug-in package for 8.1a) (my phone is n70 with symbian 8.1a)

    for the plug-in i use the nokia ExamplePlugin
    the plugin dll & rsc file where add to the pkg file
    in the rss file i change the default_data=<application uid>
    and the rss file name is like the plugin uid

    the problem line seem to be :
    CSIPEngine* sipExample = CSIPEngine::NewL(KUidCSIPExampleWrapper);
    when i set it in MySipExampleAppUi.cpp

    any idea ?

    **********MySIPExample.h*******************
    #include <sipobserver.h>
    #include <sipprofileregistry.h>
    #include <sipprofileregistryobserver.h>
    #include <sipsubscribedialogassoc.h>
    #include <sipconnectionobserver.h>

    const TUid KUidCSIPExampleWrapper = {0x039D5DDF};
    class CSIPProfileRegistryObserver;
    class CSIPObserver;
    class CSIPConnectionObserver;
    class CSIP;
    class CSipProfileRegistry;
    class CSIPProfile;
    class CSIPConnection;
    class CSIPInviteDialogAssoc;
    class CSIPFromHeader;
    class CSIPToHeader;
    class CSIPContactHeader;
    class CSIPAddress;
    class CSIPClientTransaction;
    class CSIPResponseElements;
    class CSIPRequestElements;
    class CSIPServerTransaction;
    class CSIPInviteDialogAssoc;


    class CSIPEngine :
    public CBase,
    public MSIPProfileRegistryObserver,
    public MSIPObserver,
    public MSIPConnectionObserver
    {
    public:

    static CSIPEngine* NewL(TUid aUid);
    ~CSIPEngine();

    // 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*/){}
    void ProfileRegistrationStatusChanged(TUint32) ;

    // 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*/){}

    CSIPInviteDialogAssoc* CreateSIPInviteDialogAssoc(const TDesC8& user);
    CSIPSubscribeDialogAssoc* CreateSIPSubscribeDialogAssoc(const TDesC8& user);
    void ExecuteL();
    void Invite1();
    void Invite2();
    void Subscribe1();
    void Subscribe2();
    void IncomingResponse ( CSIPClientTransaction& , CSIPDialogAssocBase& ) ;
    // Move to cpp-file if further implementation.
    //void IncomingRequest ( CSIPServerTransaction* /*aTransaction*/, CSIPDialog& /*aDialog*/);
    void IncomingRequest ( CSIPServerTransaction* ) ;
    //void ConstructL();
    private:
    CSIPEngine(TUid& aUid) {
    iUid = aUid;
    }
    void ConstructL(){}
    TUid iUid;
    CSIP* iSIP;
    CSIPProfileRegistry* iProfileRegistry;
    CSIPProfile* iProfile;
    CSIPConnection* iConnection;
    CSIPClientTransaction* iSIPClientTransaction;
    CSIPInviteDialogAssoc* iSIPInviteDialogAssoc;
    CSIPSubscribeDialogAssoc* iSIPSubscribeDialogAssoc;

  2. #2
    Regular Contributor
    Join Date
    May 2006
    Posts
    86

    Re: CSIPExample fail on symbian 8.1a emulator

    **************MySIPExample.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 <sipservertransaction.h>
    #include <sipdialog.h>
    #include <SIPResponseElements.h>
    #include <SIPRequestElements.h>
    #include <sipmessageelements.h>
    //#include "CSIPEngine.h"
    #include "MySIPExample.h"








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

    CSIPEngine::~CSIPEngine() {
    delete iSIP;
    delete iProfileRegistry ;
    delete iProfile;
    delete iConnection;
    delete iSIPClientTransaction;
    delete iSIPInviteDialogAssoc;
    delete iSIPSubscribeDialogAssoc;
    }

    void CSIPEngine::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);
    } 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.

    }
    // End ExecuteL

    void CSIPEngine::Invite1() {

    // create a SIP dialog for sending an INVITE;
    iSIPInviteDialogAssoc = CreateSIPInviteDialogAssoc(_L8("siplayer1@10.0.0.1"));

    // Continue session establishement using the SIP Client API
    iSIPClientTransaction = iSIPInviteDialogAssoc->SendInviteL();
    }
    // End Invite

    void CSIPEngine::Invite2() {

    // create a SIP dialog for sending an INVITE;
    iSIPInviteDialogAssoc = CreateSIPInviteDialogAssoc(_L8("siplayer2@10.0.0.1"));

    // Continue session establishement using the SIP Client API
    iSIPClientTransaction = iSIPInviteDialogAssoc->SendInviteL();
    }
    // End Invite

    void CSIPEngine::Subscribe1() {

    // create a SIP dialog for sending an INVITE;
    iSIPSubscribeDialogAssoc = CreateSIPSubscribeDialogAssoc(_L8("siplayer1@10.0.0.1"));

    // Continue session establishement using the SIP Client API
    iSIPClientTransaction = iSIPSubscribeDialogAssoc->SendSubscribeL();
    }
    // End Subscribe

    void CSIPEngine::Subscribe2() {

    // create a SIP dialog for sending an INVITE;
    iSIPSubscribeDialogAssoc = CreateSIPSubscribeDialogAssoc(_L8("siplayer2@10.0.0.1"));

    // Continue session establishement using the SIP Client API
    iSIPClientTransaction = iSIPSubscribeDialogAssoc->SendSubscribeL();
    }
    // End Subscribe

    /***********************************************************************
    /** * Constructs CSIPInviteDialogAssoc object for test purposes.
    * @return CSIPInviteDialogAssoc object
    ************************************************************************/
    CSIPInviteDialogAssoc* CSIPEngine::CreateSIPInviteDialogAssoc(const TDesC8& user) {
    // Construct toHeader. Note that we use possibly non-existing
    // opponent SIP Address.
    CSIPAddress* toAddress = CSIPAddress:ecodeL(user);
    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);
    // delete toAddress;
    //delete toHeader;

    return inviteDialogAssoc;
    }

    CSIPSubscribeDialogAssoc* CSIPEngine::CreateSIPSubscribeDialogAssoc(const TDesC8& user) {
    // Construct toHeader. Note that we use possibly non-existing
    // opponent SIP Address.
    CSIPAddress* toAddress = CSIPAddress:ecodeL(user);
    CleanupStack::PushL(toAddress);

    CSIPToHeader* toHeader = CSIPToHeader::NewL(toAddress);

    CleanupStack::Pop(toAddress);
    CleanupStack::PushL(toHeader);

    // and construct CSIPInviteDialogAssoc by using
    // from- and toHeaders:
    CSIPSubscribeDialogAssoc* subscribeDialogAssoc = CSIPSubscribeDialogAssoc::NewL( *iConnection, toHeader, *iProfile );

    CleanupStack::Pop(toHeader);
    // delete toAddress;
    //delete toHeader;

    return subscribeDialogAssoc;
    }

    //MSIPProfileRegistryObserver implementation:
    void CSIPEngine::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();
    */
    }
    }
    }

    // MSIPConnectionObserver implementation
    void CSIPEngine::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.
    //Gets called when an INVITE comes
    void CSIPEngine::IncomingRequest (CSIPServerTransaction* aTransaction)
    {
    User::InfoPrint(_L("IncomingRequest"));
    if (aTransaction->Type() == CSIPTransactionBase::EINVITE)
    {
    //Answer immediately with 180 Ringing
    //THE NEXT LINE IS VERY IMPORTANT AND ALMOST NOWHERE DOCUMENTED!!
    iSIPInviteDialogAssoc=CSIPInviteDialogAssoc::NewL(*aTransaction);
    CSIPResponseElements* responseRinging;
    responseRinging= CSIPResponseElements::NewL(180, _L8("Ringing"));
    aTransaction->SendResponseL(responseRinging);


    //Now handle the request correctly
    TBuf8<100> *senderAddr=new TBuf8<100>;
    const CSIPRequestElements *reqElem = aTransaction->RequestElements();
    const CSIPMessageElements& cSIPMessageElements=reqElem->MessageElements();
    //...
    //If you want to read SDP data, you can do it here
    //but as I can see you do not use it yet
    //let isAcceptableMedia store whether you want to accept the INVITE
    //...

    CSIPResponseElements* response;
    /*if (isAcceptableMedia) response= CSIPResponseElements::NewL(200, _L8("OK"));
    else response= CSIPResponseElements::NewL(405, _L8("Not Acceptable"));*/
    response= CSIPResponseElements::NewL(200, _L8("OK"));
    aTransaction->SendResponseL(response);
    }
    if (aTransaction->Type() == CSIPTransactionBase::ESUBSCRIBE) {
    CSIPResponseElements* response = CSIPResponseElements::NewL(200,_L8("OK"));
    CleanupStack::PushL(response);
    aTransaction->SendResponseL(response);
    CleanupStack::Pop(response);
    }
    delete aTransaction;
    }

    // MSIPConnectionObserver implementation.
    void CSIPEngine::IncomingRequest ( CSIPServerTransaction* aTransaction , CSIPDialog& aDialog) {
    // handle incoming request by using SIP API.
    // CSIPRequestElements reqElem = aTransaction->RequestElements()
    // …
    User::InfoPrint(_L("IncomingRequest"));
    if (aTransaction->Type() == CSIPTransactionBase::EACK)
    {
    if (aDialog.IsAssociated(*iSIPInviteDialogAssoc))
    {
    //INVITE succesful
    }
    }
    if (aTransaction->Type() == CSIPTransactionBase::EBYE)
    {
    //Buddy left
    }
    delete aTransaction;
    }

  3. #3
    Regular Contributor
    Join Date
    May 2006
    Posts
    86

    Re: CSIPExample fail on symbian 8.1a emulator

    i tried to change the program to the most basic sip defination
    and when i try to load the program i get
    "Suspended : signal 'Exception 5' received . description: access violation. 1 0x191d0003(sipcodec.dll)() 0x191d0003

    *************mycpp file ***************

    #include <SIP.h>
    #include "mysip.h"


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

    CSIPEngine::~CSIPEngine() {
    delete iSIP;
    }

    void CSIPEngine::ExecuteL() {
    // Initialize SIP Stack
    iSIP = CSIP::NewL(iUid, *this);

    }

    in the appui as an option in HandleCommandL
    CSIPEngine* sipExample = CSIPEngine::NewL(KUidCSIPExampleWrapper);
    sipExample->ExecuteL();

    but the program fail before it load

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

    Re: CSIPExample fail on symbian 8.1a emulator

    Quote Originally Posted by nimco View Post
    i tried to change the program to the most basic sip defination
    and when i try to load the program i get
    "Suspended : signal 'Exception 5' received . description: access violation. 1 0x191d0003(sipcodec.dll)() 0x191d0003
    This is the Windows/x86 part of the message, however if you press continue/resume/etc., you will get the panic code (especially if you have applied http://wiki.forum.nokia.com/index.ph...ded_panic_code), though it is probably KERN-EXEC 3.
    Can you see anything from your code in the call-stack?

Similar Threads

  1. Replies: 35
    Last Post: 2009-04-11, 14:36
  2. Replies: 0
    Last Post: 2004-05-07, 11:45
  3. Http connection with Series 60 MIDP for Symbian OS emulator - no luck
    By bear101 in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2003-10-15, 16:31
  4. Replies: 1
    Last Post: 2002-07-09, 09:40

Posting Permissions

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