Re: [OpenSIPStack] sip parser
Brought to you by:
joegenbaclor
From: Joegen E. B. <joe...@gm...> - 2008-07-29 10:26:34
|
You will have to use and event queue for that. See the EventQueue class (EventQueue.h). You need to use the EventQueue(BOOL blockIfEmpty) constructor and set the blockIfEmpty to TRUE m_SDPOfferEventQueue = new EventQueue( TRUE ); The in your virtual method you can do something like void CallSessionManager::EnqueueSDPAnswer( PString * answer ) { m_SDPOfferEventQueue->Enqueue( answer ); } BOOL CallSessionManager::OnRequireSDPAnswer( const SIPMessage & offer, SIPMessage & answer, CallSession & session ) { /// report this event to external module call_your_external_module( ... ); PString * eventObject = dynmic_cast<PString *>(m_SDPOfferEventQueue->DequeueEvent()); answer.SetBody( *eventObject ); delete eventObject; return TRUE; } Be careful about the queue. It will block forever if an event is not received so better make sure that there is an event that will unblock it. HTH, Joegen haripriya alapati wrote: > I am proceeding as per your suggestion. > But the thing is my audio and network module is dialog based, asynchronous event driven ones. How can i subclass those modules to this sip parser module. > Still i am struggling with that. > Can i have any suggestion regarding this. > > Thanks in advance. > > > > On Thu, 26 Jun 2008 jo...@op... wrote : > >> I am going to assume that you sub-classed the CallSession UACore for your gateway. If this NOT what you did, then you need to give more info. If this is what you did, all you need to do is to implement the two blank methods in CallSessionManager. >> BOOL CallSessionManager::OnRequireSDPAnswer( >> const SIPMessage & offer, >> SIPMessage & answer, >> CallSession & session >> ) >> { >> /// Media UA should implement this method >> return FALSE; >> } >> >> BOOL CallSessionManager::OnRequireSDPOffer( >> SIPMessage & _offer, >> CallSession & session >> ) >> { >> /// Media UA should implement this method >> return FALSE; >> } >> >> >> Lastly, as you can see, the default implementation of the CallSession does not have RTP. >> Joegen >> >> >> haripriya alapati wrote: >> >>> Hi, >>> >>> I have already DSP and NETWORK modules. Only thing is I have to include the SIP module to my project. >>> For Sip parser I am using opensipstack source code. But I am not getting how to separate the sip parser from the rtp and media modules in the opensipsatck code. Can anyone please help me regarding this. >>> >>> Thanks in advance. ------------------------------------------------------------------------- >>> Check out the new SourceForge.net Marketplace. >>> It's the best place to buy or sell services for >>> just about anything Open Source. >>> http://sourceforge.net/services/buy/index.php >>> _______________________________________________ >>> opensipstack-devel mailing list >>> ope...@li... >>> https://lists.sourceforge.net/lists/listinfo/opensipstack-devel >>> >>> >>> >>> > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > opensipstack-devel mailing list > ope...@li... > https://lists.sourceforge.net/lists/listinfo/opensipstack-devel > > No virus found in this incoming message. > Checked by AVG - http://www.avg.com > Version: 8.0.138 / Virus Database: 270.5.6/1578 - Release Date: 7/28/2008 5:13 PM > > > > |