On 10/18/06, Dale R. Worley <[EMAIL PROTECTED]> wrote:
Generally SipUserAgent rejects any method that it has not been
instructed to accept.  After constructing it, use
SipUserAgent::allowMethod() so that INFO will be delivered to your
application.

Dale

Thanks a lot Dale, I knew it must have been there somewhere :-) now the ua correctly handles the incoming INFOs :-)
I hope you won't mind if I use this email to give some more info on the other problem I have (I re-read previous email and noticed it was too vague)

As I said before, since I need to shutdown and restart the ua to change localip and localport (btw is this the only way?) i added refreshMgr and lineMgr (as per SipUserAgentTest.cpp example) like this:

handler::handler()
{

/* init params are here */
    ...
    lineMgr = new SipLineMgr(); //new
    refreshMgr = new SipRefreshMgr(); //new
    lineMgr->StartLineMgr(); //new
    lineMgr->initializeRefreshMgr(refreshMgr);//new

    ua = new SipUserAgent(5080,5080,5081,pLocalIp,sipuser,"127.0.0.1",NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,"PING",lineMgr);

    ua->addMessageObserver(q);
    ua->start();//new
    refreshMgr->init(ua);//new
}

before adding the //new lines what i used to do was to
1) prepare SIP messages to send
2) ua->send(myMsg); to send them
3) regularly checking the q like this

if(!q.isEmpty())
 {
    qDebug("Num msgs in Q: %d", q.numMsgs());
    q.receive(recvd);
   
    const SipMessage *sipms = ((SipMessageEvent&)(*recvd)).getMessage();
    if(sipms)
    {
     ... //do something appropriate
     }
   free(recvd);
}


Now since the //new lines are in place what i get is a heap error due to a timeout (from what i gather from the call stack) cos it does not find a transaction associated to an incoming message; so I assume that they way i did handle the SIP messages was not correct at all.

here is the call stack

     msvcr71d.dll!_CrtIsValidHeapPointer(const void * pUserData=0x00e32878)  Line 1807    C
     msvcr71d.dll!_free_dbg_lk(void * pUserData=0x00e32878, int nBlockUse=1)  Line 1132 + 0x9    C
     msvcr71d.dll!_free_dbg(void * pUserData=0x00e32878, int nBlockUse=1)  Line 1070 + 0xd    C
     msvcr71d.dll!free(void * pUserData=0x00e32878)  Line 1025 + 0xb    C
     NR_DexBar.exe!SipSrvLookup::freeServerT()  Line 733 + 0x15   
     NR_DexBar.exe!SipTransaction::~SipTransaction()  Line 186 + 0xf   
     NR_DexBar.exe!SipTransaction::`scalar deleting destructor'()  + 0x2b   
     NR_DexBar.exe!SipTransactionList::removeOldTransactions()  Line 260 + 0x3b   
     NR_DexBar.exe!SipUserAgent::garbageCollection()  Line 2536   
     NR_DexBar.exe!SipUserAgent::handleMessage()  Line 2502   
     NR_DexBar.exe!OsServerTask::run()  Line 148 + 0x11   
     NR_DexBar.exe!OsTaskWnt::threadEntry()  Line 591 + 0x22   


Thanks for any suggestion and excuse me for the long post
_______________________________________________
sipxtapi-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipxtapi-dev/

Reply via email to