×

Discussion Board

Results 1 to 4 of 4

Hybrid View

  1. #1
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    116

    Question SIP resolver plugin problem

    I have write sip resolver plugin, try to INVITE, but there is 480 response:

    SIP INVITE request and nokia's response:
    INVITE sip:123456@192.168.129.178 SIP/2.0
    Via: SIP/2.0/UDP 192.168.129.86:5060;branch=z9hG4bK-c05c3300d667031094b6001b7806ca9c
    From: "23 Clone" <sip:6321@192.168.129.86;user=phone>;tag=c05c3300d667031094b5001b7806ca9c
    To: "123456" <sip:123456@192.168.129.178:5060;user=phone>
    Call-ID: 9-XwFR7YoIcn-Mk6B72gGBsGzqZUmR
    CSeq: 1 INVITE
    Contact: <sip:6321@192.168.129.86;user=phone>
    Accept-Contact: *;class="myclass"
    P-Asserted-Identity: "23 Clone" <sip:6321@192.168.129.86;user=phone>
    Max-Forwards: 10
    Cisco-Guid: 2301124482-3030206468-2327348562-565159331
    Content-Type: application/sdp
    Content-Length: 196

    v=0
    o=- 1229333929 1229333929 IN IP4 192.168.129.86
    s=-
    c=IN IP4 192.168.129.86
    t=0 0
    m=audio 11986 RTP/AVP 18 101
    a=rtpmap:18 G729/8000
    a=rtpmap:101 telephone-event/8000
    a=fmtp:101 0-16

    -------

    SIP/2.0 100 Trying
    Via: SIP/2.0/UDP 192.168.129.86:5060;branch=z9hG4bK-c05c3300d667031094b6001b7806ca9c
    To: "123456" <sip:123456@192.168.129.178;user=phone>
    From: "23 Clone" <sip:6321@192.168.129.86;user=phone>;tag=c05c3300d667031094b5001b7806ca9c
    Call-ID: 9-XwFR7YoIcn-Mk6B72gGBsGzqZUmR
    CSeq: 1 INVITE
    Content-Length: 0

    ------

    SIP/2.0 480 Temporarily Not Available
    Via: SIP/2.0/UDP 192.168.129.86:5060;branch=z9hG4bK-c05c3300d667031094b6001b7806ca9c
    To: "123456" <sip:123456@192.168.129.178;user=phone>;tag=24ve19sdcthc6s8a1646
    From: "23 Clone" <sip:6321@192.168.129.86;user=phone>;tag=c05c3300d667031094b5001b7806ca9c
    Call-ID: 9-XwFR7YoIcn-Mk6B72gGBsGzqZUmR
    CSeq: 1 INVITE
    Content-Length: 0
    Sip Client resolver plugin capabilities:
    _LIT8(KCapabilities,
    "<SIP_CLIENT ALLOW_STARTING=\"YES\">\
    <SIP_HEADERS>\
    <ACCEPT_CONTACT value=\"*;class=\"myclass\"\"/>\
    <ACCEPT value=\"application/sdp\"/>\
    <ACCEPT value=\"text/plain\"/>\
    <ACCEPT value=\"\"/>\
    </SIP_HEADERS>\
    <SDP_LINES>\
    <LINE name=\"m\" value=\"audio 0 RTP/AVP 18 101\" />\
    </SDP_LINES>\
    </SIP_CLIENT>");

  2. #2
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    116

    Re: SIP resolver plugin problem

    Plugin Source code:

    E0001234.rss :
    Code:
    #include <RegistryInfo.rh>
    
    RESOURCE REGISTRY_INFO theInfo
        {
        // UID for the DLL
        dll_uid = 0xE0001234;
        // Declare array of interface info
        interfaces = 
            {
            INTERFACE_INFO
                {
                // UID of interface that is implemented
                interface_uid = 0x102010DD;
                implementations = 
                    {
                    IMPLEMENTATION_INFO
                        {
                        implementation_uid = 0xE0001234;
                        version_no = 1;
                        // SIPEx UID: Must match to the one SIPEx passes to CSIP::NewL. 
                        default_data = "E6777964"; // my app uid3
                        }
                    };
                }
            };
        }
    sipresolverplugin.mmp :
    Code:
    /*
    ============================================================================
     Name		: sipresolver.mmp
     Author	  : Alexey Veselovsky
     Copyright   : 
     Description : This is the project specification file for sipresolver.
    ============================================================================
    */
    
    TARGET		  sipresolverplugin.dll
    TARGETTYPE	  PLUGIN
    UID 0x10009D8D 0xE0001234
    
    USERINCLUDE	 ..\inc
    SYSTEMINCLUDE   \epoc32\include +\include\ecom
    
    SOURCEPATH	  ..\src
    
    SOURCE		  sipresolverpluginDllMain.cpp ResolverPlugin.cpp
    
    LIBRARY		 euser.lib ecom.lib apparc.lib apgrfx.lib
    
    #ifdef ENABLE_ABIV2_MODE
    DEBUGGABLE
    #endif
    
    CAPABILITY Location NetworkControl NetworkServices ProtServ ReadDeviceData ReadUserData WriteDeviceData
    
    SOURCEPATH ..\data
    START RESOURCE E0001234.rss
    	TARGET sipresolverplugin.rsc
    END
    ResolverPlugin.h & ResolverPlugin.cpp:
    Code:
    /*
     ============================================================================
     Name		: ResolverPlugin.h
     Author	  : Alexey Veselovsky
     Version	 : 1.0
     Copyright   : 
     Description : CResolverPlugin declaration
     ============================================================================
     */
    
    #ifndef RESOLVERPLUGIN_H
    #define RESOLVERPLUGIN_H
    
    // INCLUDES
    #include <e32std.h>
    #include <e32base.h>
    
    #include <apgcli.h>
    #include <SipResolvedClient.h>
    
    // CLASS DECLARATION
    const TInt32 KResolverPluginUID = 0xE0001234;
    
    /**
     *  CResolverPlugin
     * 
     */
    class CResolverPlugin : public CSIPResolvedClient
    {
    public:
        // Constructors and destructor
    
        /**
         * Destructor.
         */
        ~CResolverPlugin();
    
        /**
         * Two-phased constructor.
         */
        static CResolverPlugin* NewL();
    
        /**
         * Two-phased constructor.
         */
        static CResolverPlugin* NewLC();
        
        TUid ChannelL( RStringF aMethod,
                       const TDesC8& aRequestUri,
                       const RPointerArray<CSIPHeaderBase>& aHeaders,
                       const TDesC8& aContent,
                       const CSIPContentTypeHeader* aContentType=0);
    
        void ConnectL( TUid aUid );
        
        const TDesC8& Capabilities();
    
    
    private:
    
        /**
         * Constructor for performing 1st stage construction
         */
        CResolverPlugin();
    
        /**
         * EPOC default constructor for performing 2nd stage construction
         */
        void ConstructL();
        
        static void ResetAndDestroy( TAny* anArray );
    
        RApaLsSession iApaSession;
        TApaAppInfo iAppInfo;
        
        TUid iApplicationUID;
    };
    
    #endif // RESOLVERPLUGIN_H
    
    // ResolverPlugin.cpp
    /*
     ============================================================================
     Name		: ResolverPlugin.cpp
     Author	  : Alexey Veselovsky
     Version	 : 1.0
     Copyright   : 
     Description : CResolverPlugin implementation
     ============================================================================
     */
    
    #include "ResolverPlugin.h"
    #include <apacmdln.h>
    
    _LIT8(KCapabilities,
    "<SIP_CLIENT ALLOW_STARTING=\"YES\">\
    <SIP_HEADERS>\
    <ACCEPT_CONTACT value=\"*;class=\"myclass\"\"/>\
    <ACCEPT value=\"application/sdp\"/>\
    <ACCEPT value=\"text/plain\"/>\
    <ACCEPT value=\"\"/>\
    </SIP_HEADERS>\
    <SDP_LINES>\
    <LINE name=\"m\" value=\"audio 0 RTP/AVP 18 101\" />\
    </SDP_LINES>\
    </SIP_CLIENT>");
    
    CResolverPlugin::CResolverPlugin()
    {
        // No implementation required
    }
    
    CResolverPlugin::~CResolverPlugin()
    {
        iApaSession.Close();
    }
    
    CResolverPlugin* CResolverPlugin::NewLC()
    {
        CResolverPlugin* self = new (ELeave)CResolverPlugin();
        CleanupStack::PushL(self);
        self->ConstructL();
        return self;
    }
    
    CResolverPlugin* CResolverPlugin::NewL()
    {
        CResolverPlugin* self=CResolverPlugin::NewLC();
        CleanupStack::Pop(); // self;
        return self;
    }
    
    void CResolverPlugin::ConstructL()
    {
        const TUid KMyImplementationUid = { KResolverPluginUID };
    
        RImplInfoPtrArray infoArray;
        REComSession::ListImplementationsL( KSIPResolvedClientIFUid, infoArray );
        CleanupStack::PushL( TCleanupItem( ResetAndDestroy, &infoArray ) );
    
        TBool found = EFalse;
        for ( TInt i=0; !found && i < infoArray.Count(); i++ )
            {
            CImplementationInformation* info = infoArray[ i ];
            if ( info->ImplementationUid() == KMyImplementationUid )
                {
                TLex8 lex( info->DataType() );
                TUint value( 0 );
                User::LeaveIfError( lex.Val( value, EHex ) );
                iApplicationUID.iUid = value;
                found = ETrue;
                }
            }
    
        CleanupStack::PopAndDestroy( 1 ); // infoArray
    
        if ( !found )
            {
            User::Leave( KErrNotFound );
            }
            
        User::LeaveIfError( iApaSession.Connect() );
        User::LeaveIfError( iApaSession.GetAppInfo( iAppInfo, iApplicationUID ) );      
    }
    
    TUid CResolverPlugin::ChannelL( RStringF /*aMethod*/,
                                         const TDesC8& /*aRequestUri*/,
                                         const RPointerArray<CSIPHeaderBase>& /*aHeaders*/,
                                         const TDesC8& /*aContent*/,
                                         const CSIPContentTypeHeader* /*aContentType*/)
    {
        return iApplicationUID;
    }
    
    
    void CResolverPlugin::ConnectL( TUid aUid )
    {
        // Launch app based on uid passed from SIP stack
        //
        TApaAppInfo appInfo;
        User::LeaveIfError( iApaSession.GetAppInfo( appInfo, aUid ) );
        CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
    #ifdef EKA2
        cmdLine->SetExecutableNameL( appInfo.iFullName );
    #else
        cmdLine->SetLibraryNameL( appInfo.iFullName );
    #endif
        User::LeaveIfError( iApaSession.StartApp( *cmdLine ) );
        CleanupStack::PopAndDestroy( cmdLine ); 
    }
    
    const TDesC8& CResolverPlugin::Capabilities()
    {
        return KCapabilities;
    }
    
    void CResolverPlugin::ResetAndDestroy( TAny* anArray )
    {
        RImplInfoPtrArray* array = reinterpret_cast<RImplInfoPtrArray*>( anArray );
        if (array)
        {
            array->ResetAndDestroy();
        }
    }
    sipresolverpluginDll.cpp
    Code:
    /*
     ============================================================================
     Name		: sipresolverDll.cpp 
     Author	  : Alexey Veselovsky
     Copyright   : 
     Description : sipresolverDll.cpp - main DLL source
     ============================================================================
     */
    
    //  Include Files  
    
    #include <e32std.h>		 // GLDEF_C
    #include "ResolverPlugin.h"
    #include <ImplementationProxy.h>
    
    //  Exported Functions
    
    #ifndef EKA2 // for EKA1 only
    EXPORT_C TInt E32Dll(TDllReason /*aReason*/)
    // Called when the DLL is loaded and unloaded. Note: have to define
    // epoccalldllentrypoints in MMP file to get this called in THUMB.
    
    {
        return KErrNone;
    }
    #endif
    
    // Map the interface UID to implementation factory function
    const TImplementationProxy Implementations[] =
        {
        IMPLEMENTATION_PROXY_ENTRY( KResolverPluginUID,
                                    CResolverPlugin::NewL )
        };
    
    // -----------------------------------------------------------------------------
    // ImplementationGroupProxy
    //
    // Exported proxy for instantiation method resolution
    // -----------------------------------------------------------------------------
    //
    EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aCount )
        {
        aCount = sizeof( Implementations ) / sizeof( TImplementationProxy );
        return Implementations;
        }
    And, finaly, .pkg for sis creation:
    Code:
    ; income_caller.pkg
    ;Language - standard language definitions
    &EN
    
    ; standard SIS file header
    #{"income_caller"},(0xE6777964),1,0,0
    
    ;Localised Vendor name
    %{"Vendor-EN"}
    
    ;Unique Vendor name
    :"Vendor"
    
    ;Supports Series 60 v 3.0
    [0x101F7961], 0, 0, 0, {"Series60ProductID"}
    
    ;Files to install
    
    "$(EPOCROOT)Epoc32\release\$(PLATFORM)\$(TARGET)\income_caller.exe"		-"!:\sys\bin\income_caller.exe"
    
    "$(EPOCROOT)Epoc32\data\z\resource\apps\income_caller.r01"		-"!:\resource\apps\income_caller.r01"
    "$(EPOCROOT)Epoc32\data\z\private\10003a3f\apps\income_caller_reg.r01"	-"!:\private\10003a3f\import\apps\income_caller_reg.r01"
    "$(EPOCROOT)epoc32\data\z\resource\apps\income_caller_aif.mif" -"!:\resource\apps\income_caller_aif.mif"
    "$(EPOCROOT)epoc32\data\z\resource\apps\income_caller.mbm" -"!:\resource\apps\income_caller.mbm"
    
    "$(EPOCROOT)Epoc32\release\$(PLATFORM)\$(TARGET)\sipresolverplugin.dll"		-"!:\sys\bin\sipresolverplugin.dll"
    "$(EPOCROOT)epoc32\data\z\resource\plugins\sipresolverplugin.rsc" -"!:\resource\plugins\sipresolverplugin.rsc"
    
    ; Add any installation notes if applicable
    ;"income_caller.txt"					  -"!:\private\0xE6777964\income_caller.txt"

  3. #3
    Regular Contributor
    Join Date
    Dec 2006
    Posts
    59

    Re: SIP resolver plugin problem

    According to the Invite routing logic it could be that your resolver plug-in is not loaded when you receive a 480 response. You could check this by running your application in the emulator and looking at the epocwind.out logfile.

  4. #4
    Registered User
    Join Date
    Jun 2009
    Posts
    5

    Re: SIP resolver plugin problem

    Quote Originally Posted by bifihi View Post
    According to the Invite routing logic it could be that your resolver plug-in is not loaded when you receive a 480 response. You could check this by running your application in the emulator and looking at the epocwind.out logfile.
    plz show me how could i got the epocwind.out logfile? thanks very much

Similar Threads

  1. Resolverplugin replies message 401
    By dimaar in forum Symbian Networking & Messaging (Closed)
    Replies: 10
    Last Post: 2008-12-10, 17:09
  2. SIP Resolver Plugin Problem
    By bifihi in forum VoIP
    Replies: 2
    Last Post: 2007-06-08, 13:26
  3. SIP Plugin 4.0 and SIP in S60 3rd Ed.
    By sipshakers in forum Symbian
    Replies: 2
    Last Post: 2007-05-09, 08:08
  4. SIP plugin TX an 400 after RX an INVITE
    By Zaibach in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2004-08-06, 11:29
  5. SIP plugin installation problem
    By hiteshw in forum Symbian Tools & SDKs
    Replies: 0
    Last Post: 2004-08-04, 13:51

Posting Permissions

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