void SipImpApp::process(void) { resip_assert(sipStack); if ( !tuIM ) { return; } resip_assert(tuIM); FdSet fdset; sipStack->buildFdSet(fdset); int err = fdset.selectMilliSeconds( 0 ); if ( err == -1 ) { int e = errno; resip_assert(0); //InfoLog(<< "Error " << e << " " << strerror(e) << " in select"); } //InfoLog(<< "Select returned"); //DebugLog ( << "Try TO PROCESS " ); sipStack->process(fdset); tuIM->process(); }
void SIPEngine::run() { FdSet fdset; this->mSipStack->buildFdSet(fdset); int err = fdset.selectMilliSeconds(resipMin((int)mSipStack->getTimeTillNextProcessMS(), 200)); this->mSipStack->process(fdset); while(this->mDum->process()); }
bool TuPresSvr::process() { bool done = 0; FdSet fdset; mStack->buildFdSet(fdset); // int err = fdset.selectMilliSeconds(0); int err = fdset.selectMilliSeconds(100); assert( err != -1 ); mStack->process(fdset); SipMessage* msg = (mStack->receive()); if (msg) { if (msg->isRequest()) { if (msg->header(h_RequestLine).getMethod() == SUBSCRIBE ) { processSubscribe(msg); } else if (msg->header(h_RequestLine).getMethod() == REGISTER ) { processPublish(msg); } else if (msg->header(h_RequestLine).getMethod() == OPTIONS ) { auto_ptr<SipMessage> resp( Helper::makeResponse(*msg,500,"You Shot Me!")); mStack->send(*resp); done = 1; } else if (msg->header(h_RequestLine).getMethod() == PUBLISH) { processPublish(msg); } else { auto_ptr<SipMessage> resp(Helper::makeResponse(*msg,501,"")); mStack->send(*resp); } } else { /* Nope - dialog key is currently overscoped to requests - bad. assert(msg->isResponse()); if (msg->header(h_CSeq).method()==NOTIFY) mDialogMgr.dispatchNotifyResponse(msg); */ } delete msg; } else { mDialogMgr.processExpirations(); } return done; }