Hello,
I see is SipPimClient code, that sendPagerMessage() creates its own message queue which is used for receiving the response. It seems that after receiving some response which triggers completion of sendPagerMessage() and destruction of the message queue, SipUserAgent receives some message which it "thinks" is another response to your MESSAGE. I wonder if this is related somehow to the fact that both the sent and received MESSAGE have the same Call-Id?
Regards,
Andrzej Ciarkowski
|
> |
Hi,
I'm able to recieve messages but when I try sending one then the application crashes at the following line:
if (!mbShuttingDown) { responseQ->send(eventMsg); //<---Crashes here, line 1851, SipUserAgent.cpp }
Below is the call stack:
sipXtapid.dll!SipUserAgent::dispatch(SipMessage * message=0x01c5ead8, int messageType=0, SIPX_TRANSPORT_DATA * pTransport=0x00000000) Line 1851 + 0x14 C++ sipXtapid.dll!SipClient::run(void * runArg=0x00000000) Line 468 + 0x27 C++ sipXtapid.dll!OsTaskWnt::threadEntry(void * arg=0x01c5e3f8) Line 587 + 0x22 C++
The value of responseQ is shown to be: - responseQ 0x0359f124 {mGuard={mMutexImp=??? } mEmpty={mSemImp=??? } mFull={mSemImp=??? } ...} OsMsgQShared * + OsMsgQBase {DEF_MAX_MSGS=100 DEF_MAX_MSG_LEN=32 MSGQ_PREFIX={TYPE=0x1037c16c "UtlString" ssNull=0x10375710 "" UTLSTRING_NOT_FOUND=4294967295 ...} ...} OsMsgQBase + mGuard {mMutexImp=??? } OsMutexWnt + mEmpty {mSemImp=??? } OsCSemWnt + mFull {mSemImp=??? } OsCSemWnt + mDlist {TYPE=0x1037e014 "UtlDList" } UtlDList mOptions CXX0030: Error: _expression_ cannot be evaluated int mHighCnt CXX0030: Error: _expression_ cannot be evaluated int
I have attached the Ethereal trace and the log file. The code that I'm using is shown below.
Please help.
Thanks, Hitesh
class SipPimClientManager { private: SipPimClientManager () { }
static SipPimClient *m_pSipPimClient;
public: static SipPimClient *GetInstance (SipUserAgent &sipUserAgent, Url urlFromAddress) { if (m_pSipPimClient == NULL) { m_pSipPimClient = new SipPimClient (sipUserAgent, urlFromAddress); m_pSipPimClient->start ();
OsSysLog::add(FAC_SIPXTAPI, PRI_INFO, "SipPimClient::GetInstance ()"); } return m_pSipPimClient; } }; SipPimClient *SipPimClientManager::m_pSipPimClient = NULL;
SIPXTAPI_API SIPX_RESULT sipxSendMessage (const SIPX_INST hInst, const char* pszMessageText, const char* pszYourAddress, const char* pszAddressToSend) { OsSysLog::add(FAC_SIPXTAPI, PRI_INFO, "ENTER sipxSendMessage hInst=%p pszMessageText=%s pszYourAddress=%s pszAddressToSend=%s", hInst, pszMessageText, pszYourAddress, pszAddressToSend);
SIPX_INSTANCE_DATA* pInst = (SIPX_INSTANCE_DATA*) hInst ;
if (pInst == NULL) { return SIPX_RESULT_FAILURE; }
int nResponseCode = -1; UtlString ustrResponseCodeText;
SIPX_RESULT rc;
if (SipPimClientManager::GetInstance (*(pInst->pSipUserAgent), Url (pszYourAddress)) ->sendPagerMessage (Url (pszAddressToSend), pszMessageText, "Subject", nResponseCode, ustrResponseCodeText)) { rc = SIPX_RESULT_SUCCESS; } else { rc = SIPX_RESULT_FAILURE; }
OsSysLog::add(FAC_SIPXTAPI, PRI_INFO, "EXIT sipxSendMessage nResponseCode=%d ustrResponseCodeText=%s", nResponseCode, ustrResponseCodeText.data ());
return rc; }
SIPXTAPI_API SIPX_RESULT sipxMessageListenerAdd (const SIPX_INST hInst, const char* pszFromAddress, void (*textHandler)(const char* pszFromAddress, const char* textMessage, int textLength)) { OsSysLog::add(FAC_SIPXTAPI, PRI_INFO, "ENTER sipxMessageListenerAdd");
SIPX_RESULT rc = SIPX_RESULT_SUCCESS;
SIPX_INSTANCE_DATA* pInst = (SIPX_INSTANCE_DATA*) hInst ;
if (pInst == NULL) { return SIPX_RESULT_FAILURE; }
SipPimClientManager::GetInstance (*(pInst->pSipUserAgent), Url (pszFromAddress))-> setIncomingImTextHandler (textHandler);
OsSysLog::add(FAC_SIPXTAPI, PRI_INFO, "EXIT sipxMessageListenerAdd"); return rc; } |
_______________________________________________ sipxtapi-dev mailing list [email protected] List Archive: http://list.sipfoundry.org/archive/sipxtapi-dev/
