reSIProcate/DialogUsageManager  9694
unreg.cxx
Go to the documentation of this file.
00001 #include "rutil/Logger.hxx"
00002 #include "resip/dum/ClientRegistration.hxx"
00003 #include "CommandLineParser.hxx"
00004 #include "UserAgent.hxx"
00005 
00006 
00007 using namespace resip;
00008 
00009 #define RESIPROCATE_SUBSYSTEM Subsystem::TEST
00010 
00011 
00012 class TestUserAgent : public UserAgent
00013 {
00014    public:
00015       TestUserAgent(int argc, char** argv) : UserAgent(argc, argv)
00016       {
00017       }
00018 
00019       void startup()
00020       {
00021          InfoLog (<< "register for " << mAor);
00022          UInt32 e=0;
00023          NameAddr target(mAor);
00024          mDum.send(mDum.makeRegistration(target, e));
00025       }
00026          
00027       void onSuccess(ClientRegistrationHandle h, const SipMessage& response)
00028       {
00029          InfoLog (<< "Removing binding for " << *h);
00030          h->removeAll(true);
00031       }
00032 };
00033 
00034 int
00035 main(int argc, char** argv)
00036 {
00037    TestUserAgent tua(argc, argv);
00038    tua.startup();
00039    for (int i=0; i<100000; ++i)
00040    {
00041       tua.process();
00042       usleep(10);
00043    }
00044 }