/[resiprocate]/branches/b-client-outbound-20110213/resip/dum/test/basicClientUserAgent.cxx
ViewVC logotype

Diff of /branches/b-client-outbound-20110213/resip/dum/test/basicClientUserAgent.cxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 9018 by sgodin, Wed Feb 16 22:40:07 2011 UTC revision 9021 by sgodin, Sat Feb 19 17:54:39 2011 UTC
# Line 144  Line 144 
144     mProfile->addSupportedMethod(SUBSCRIBE);     mProfile->addSupportedMethod(SUBSCRIBE);
145     //mProfile->addSupportedMethod(UPDATE);         //mProfile->addSupportedMethod(UPDATE);    
146     mProfile->addSupportedMethod(INFO);         mProfile->addSupportedMethod(INFO);    
147     mProfile->addSupportedMethod(PRACK);         mProfile->addSupportedMethod(MESSAGE);    
148       //mProfile->addSupportedMethod(PRACK);    
149     //mProfile->addSupportedOptionTag(Token(Symbols::C100rel));  // Automatically added when using setUacReliableProvisionalMode     //mProfile->addSupportedOptionTag(Token(Symbols::C100rel));  // Automatically added when using setUacReliableProvisionalMode
150     mProfile->setUacReliableProvisionalMode(MasterProfile::Supported);     mProfile->setUacReliableProvisionalMode(MasterProfile::Supported);
151     //mProfile->setUasReliableProvisionalMode(MasterProfile::Supported);  // TODO - needs support in DUM, currently unimplemented     //mProfile->setUasReliableProvisionalMode(MasterProfile::Supported);  // TODO - needs support in DUM, currently unimplemented
# Line 171  Line 172 
172     mProfile->addSupportedMimeType(UPDATE, Mime("multipart", "mixed"));       mProfile->addSupportedMimeType(UPDATE, Mime("multipart", "mixed"));  
173     mProfile->addSupportedMimeType(UPDATE, Mime("multipart", "signed"));       mProfile->addSupportedMimeType(UPDATE, Mime("multipart", "signed"));  
174     mProfile->addSupportedMimeType(UPDATE, Mime("multipart", "alternative"));       mProfile->addSupportedMimeType(UPDATE, Mime("multipart", "alternative"));  
175       mProfile->addSupportedMimeType(MESSAGE, Mime("text","plain")); // Invite session in-dialog routing testing
176     mProfile->addSupportedMimeType(NOTIFY, Mime("text","plain"));  // subscription testing     mProfile->addSupportedMimeType(NOTIFY, Mime("text","plain"));  // subscription testing
177     //mProfile->addSupportedMimeType(NOTIFY, Mime("message", "sipfrag"));       //mProfile->addSupportedMimeType(NOTIFY, Mime("message", "sipfrag"));  
178    
# Line 331  Line 333 
333              mClientSubscriptionHandle->end();              mClientSubscriptionHandle->end();
334           }           }
335    
336           // End all calls - !slg! TODO           // End all calls - copy list in case delete/unregister of call is immediate
337             std::set<BasicClientCall*> tempCallList = mCallList;
338             std::set<BasicClientCall*>::iterator it = tempCallList.begin();
339             for(; it != tempCallList.end(); it++)
340             {
341                (*it)->terminateCall();
342             }
343    
344           mDum->shutdown(this);           mDum->shutdown(this);
345           mDumShutdownRequested = false;           mDumShutdownRequested = false;
# Line 409  Line 417 
417  }  }
418    
419  void  void
420    BasicClientUserAgent::onCallTimeout(BasicClientCall* call)
421    {
422       if(isValidCall(call))
423       {
424          call->timerExpired();
425       }
426       else  // call no longer exists
427       {
428          if(!mCallTarget.host().empty())
429          {
430             // re-start a new call
431             BasicClientCall* newCall = new BasicClientCall(*this);
432             newCall->initiateCall(mCallTarget, mProfile);
433          }
434       }
435    }
436    
437    void
438    BasicClientUserAgent::registerCall(BasicClientCall* call)
439    {
440       mCallList.insert(call);
441    }
442    
443    void
444    BasicClientUserAgent::unregisterCall(BasicClientCall* call)
445    {
446       std::set<BasicClientCall*>::iterator it = mCallList.find(call);
447       if(it != mCallList.end())
448       {
449          mCallList.erase(it);
450       }
451    }
452    
453    bool
454    BasicClientUserAgent::isValidCall(BasicClientCall* call)
455    {
456       std::set<BasicClientCall*>::iterator it = mCallList.find(call);
457       if(it != mCallList.end())
458       {
459          return true;
460       }
461       return false;
462    }
463    
464    void
465  BasicClientUserAgent::onDumCanBeDeleted()  BasicClientUserAgent::onDumCanBeDeleted()
466  {  {
467     mDumShutdown = true;     mDumShutdown = true;
# Line 429  Line 482 
482           SharedPtr<SipMessage> sub = mDum->makeSubscription(NameAddr(mSubscribeTarget), mProfile, "basicClientTest");           SharedPtr<SipMessage> sub = mDum->makeSubscription(NameAddr(mSubscribeTarget), mProfile, "basicClientTest");
483           mDum->send(sub);           mDum->send(sub);
484        }        }
485    
486          // Check if we should try to form a test call
487          if(!mCallTarget.host().empty())
488          {
489             BasicClientCall* newCall = new BasicClientCall(*this);
490             newCall->initiateCall(mCallTarget, mProfile);
491          }
492     }     }
493     mRegHandle = h;     mRegHandle = h;
494     mRegistrationRetryDelayTime = 0;  // reset     mRegistrationRetryDelayTime = 0;  // reset

Legend:
Removed from v.9018  
changed lines
  Added in v.9021

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27