Iming/ Bifihi,
Thank you so much for the replies. Ok i'll tell u what am i doing.
I am using Asterisk server i.e Asterisk Win 32 PBX as my SIP server. I have enabled the debugging on my Asterisk server so i can see the invite request coming in.
When i sent a Invite from the SIP phone it shows in the Server window that the Invite packets are sent. But i don't receive the request on my emulator. When i send the Invite from my Emulator i can see the Log coming in the server and i can also receive the request on the SIP phone.
So i am pretty sure the Invite packet are being sent.
What i am not sure of is that weather my application is using correct methods to trap the event of receiving the Invite request.
This is the header file of the class that i am using to send the request. Will i also RECEIVE THE INVITE REQUEST by implementing these abstract classes or do i have so do something more.. or if i am missing a method that i need to override
some help will be greatly appreciated.
Code:
/*
============================================================================
Name : SipRegisterAppView.h
Author :Abhishek karmakar
Copyright :
Description :
============================================================================
*/
#ifndef __SIPREGISTERAPPVIEW_h__
#define __SIPREGISTERAPPVIEW_h__
// INCLUDES
#include <coecntrl.h>
#include <sip.h>
#include <uri8.h>
#include <sipobserver.h>
#include <sipconnection.h>
#include <sipconnectionobserver.h>
#include <sipregistrationbinding.h>
#include <sipclienttransaction.h>
#include <sipinvitedialogassoc.h>
#include "SipEngine.h"
// CLASS DECLARATION
class CSipEngine;
class TIapData
{
public:
TBuf<128> iName;
TUint32 iIap;
};
class CSipRegisterAppView : public CCoeControl, MSIPObserver,
MSIPConnectionObserver
{
public:
// New methods
/**
* NewL.
* Two-phased constructor.
* Create a CSipRegisterAppView object, which will draw itself to aRect.
* @param aRect The rectangle this view will be drawn to.
* @return a pointer to the created instance of CSipRegisterAppView.
*/
static CSipRegisterAppView* NewL(const TRect& aRect);
/**
* NewLC.
* Two-phased constructor.
* Create a CSipRegisterAppView object, which will draw itself
* to aRect.
* @param aRect Rectangle this view will be drawn to.
* @return A pointer to the created instance of CSipRegisterAppView.
*/
static CSipRegisterAppView* NewLC(const TRect& aRect);
/**
* ~CSipRegisterAppView
* Virtual Destructor.
*/
virtual ~CSipRegisterAppView();
public:
// Functions from base classes
/**
* From CCoeControl, Draw
* Draw this CSipRegisterAppView to the screen.
* @param aRect the rectangle of this view that needs updating
*/
void Draw(const TRect& aRect) const;
/**
* From CoeControl, SizeChanged.
* Called by framework when the view size is changed.
*/
virtual void SizeChanged();
//from base class MSipconnectionobserver
void IncomingResponse(CSIPClientTransaction& aTransaction,
CSIPRegistrationBinding& aRegistration);
void IncomingRequest(TUint32 aIapId, CSIPServerTransaction* aTransaction);
void IncomingRequest(CSIPServerTransaction* aTransaction);
/**
* IncomingRequest (from MSIPConnectionObserver)
* A SIP request within a dialog has been received from the network.
* The client must resolve the actual dialog association to which
* this request belongs.
*
* @param aTransaction SIP server transaction. The ownership is
* transferred.
* @param aDialog the dialog that this transaction belongs to.
*/
void IncomingRequest(CSIPServerTransaction* aTransaction,
CSIPDialog& aDialog);
/**
* IncomingResponse (from MSIPConnectionObserver)
*/
void IncomingResponse(CSIPClientTransaction& aTransaction);
/**
* IncomingResponse (from MSIPConnectionObserver)
* A SIP response that is within a dialog association or creates
* a dialog association.
*
* @param aTransaction contains response elements.
* @param aDialogAssoc a dialog association.
*/
void IncomingResponse(CSIPClientTransaction& aTransaction,
CSIPDialogAssocBase& aDialogAssoc);
/**
* IncomingResponse (from MSIPConnectionObserver)
*/
void IncomingResponse(CSIPClientTransaction& aTransaction,
CSIPInviteDialogAssoc* aDialogAssoc);
void ErrorOccured(TInt aError, CSIPTransactionBase& aTransaction);
void ErrorOccured(TInt aError, CSIPClientTransaction& aTransaction,
CSIPRegistrationBinding& aRegistration);
/**
* An asynchronous error has occured related to a request within
* an existing dialog.
*
* @param aError system wide or sip error code
* @param aTransaction the failed transaction.
* @param aDialogAssoc the failed dialog associoation.
*/
void ErrorOccured(TInt aError, CSIPTransactionBase& aTransaction,
CSIPDialogAssocBase& aDialogAssoc);
/**
* An asynchronous error has occured related to a refresh
*
* @param aError system wide or sip error code
* @param aSIPRefresh original refresh object.
*/
void ErrorOccured(TInt aError, CSIPRefresh& aSIPRefresh);
/**
* An asynchronous error has occured related to a periodical refresh
* that relates to a registration.
*
* @param aError system wide or sip error code;
* KErrCouldNotConnect if the refresh has failed
* due to the suspended connection.
* @param aRegistration associated registration.
*/
void ErrorOccured(TInt aError, CSIPRegistrationBinding& aRegistration);
/**
* An asynchronous error has occured related to a periodical refresh
* that belongs to SIP dialog association.
*
* @param aError system wide or sip error code;
* KErrCouldNotConnect if the refresh has failed
* due to the suspended connection.
* @param aDialogAssoc SIP dialog association.
*/
void ErrorOccured(TInt aError, CSIPDialogAssocBase& aDialogAssoc);
void InviteCompleted(CSIPClientTransaction& aTransaction);
/**
* Invite was canceled with the CANCEL
* @param aTransaction a canceled INVITE UAS transaction
*/
void InviteCanceled(CSIPServerTransaction& aTransaction);
/**
* Connection state has changed.
* If connection state has changed to EInactive or EUnavailable,
* SIP stack has removed all stand-alone SIP refreshes, registrations
* and dialog associations that client requested to refresh. Client may
* re-issue refresh requests (stand-alone, registration or dialog
* association related) when connection becomes EActive again.
* SIP stack also terminates all pending sip client transactions and no
* errors are reported back to the client about the terminated
* transactions nor about removed refreshes in order to avoid event
* flood.
*
* @param aState indicates the current connection state
*/
void ConnectionStateChanged(CSIPConnection::TState aState);
/**
* TimedOut (from MSIPObserver)
*/
void TimedOut(CSIPServerTransaction& aSIPServerTransaction);
public:
TInt SelectIAPL();
void Register();
void SendInviteL();
private:
// Constructors
/**
* ConstructL
* 2nd phase constructor.
* Perform the second phase construction of a
* CSipRegisterAppView object.
* @param aRect The rectangle this view will be drawn to.
*/
void ConstructL(const TRect& aRect);
/**
* CSipRegisterAppView.
* C++ default constructor.
*/
CSipRegisterAppView();
CSIP* iSIP;
CSIPConnection* iConnection;
CSIPConnection::TState iConnState;
CSIPRegistrationBinding* iRegistration;
CSIPClientTransaction* iRegistrationTx;
TInt iSelectedIAP;
};
#endif // __SIPREGISTERAPPVIEW_h__
// End of File
Thanks and Regards,