/[resiprocate]/main/resip/dum/test/basicRegister.cxx
ViewVC logotype

Diff of /main/resip/dum/test/basicRegister.cxx

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

revision 2870 by fluffy, Sun May 30 17:28:44 2004 UTC revision 2877 by alan, Sun May 30 19:03:55 2004 UTC
# Line 55  Line 55 
55  int  int
56  main (int argc, char** argv)  main (int argc, char** argv)
57  {  {
58     Log::initialize(Log::COUT, Log::DEBUG, argv[0]);      int level=(int)Log::DEBUG;
59        if (argc >1 ) level = atoi(argv[1]);
60    
61        Log::initialize(Log::COUT, (resip::Log::Level)level, argv[0]);
62        
63     SipStack clientStack;     SipStack clientStack;
64     clientStack.addTransport(UDP, 5060);     clientStack.addTransport(UDP, 5060);
65       NameAddr aor("sip:502@jasomi.com");
66    
67     Client client;     Client client;
68     Profile* p = new Profile;     Profile* p = new Profile;
69     DialogUsageManager clientDum(clientStack);     DialogUsageManager clientDum(clientStack);
70     clientDum.setProfile(p);     clientDum.setProfile(p);
   
71     clientDum.setClientRegistrationHandler(&client);     clientDum.setClientRegistrationHandler(&client);
     
72     clientDum.getProfile()->setDefaultRegistrationTime(70);     clientDum.getProfile()->setDefaultRegistrationTime(70);
73     SipMessage & regMessage = clientDum.makeRegistration(NameAddr("sip:502@jasomi.com"));     clientDum.getProfile()->setDefaultAor(aor);
74    
75       SipMessage & regMessage = clientDum.makeRegistration(aor);
76    
77     cerr << regMessage << "Generated register: " << endl << regMessage << endl;     cerr << regMessage << "Generated register: " << endl << regMessage << endl;
78     clientDum.send( regMessage );     clientDum.send( regMessage );
79        
80     while ( 1 )     int n = 0;
81       while ( !client.done )
82    
83     {     {
84       FdSet fdset;       FdSet fdset;
85    
86         // Should these be buildFdSet on the DUM?
87       clientStack.buildFdSet(fdset);       clientStack.buildFdSet(fdset);
88       int err = fdset.selectMilliSeconds(100);       int err = fdset.selectMilliSeconds(100);
89       assert ( err != -1 );       assert ( err != -1 );
90       clientStack.process(fdset);  
91         clientDum.process(fdset);
92         if (!(n++ % 10)) cerr << "|/-\\"[(n/10)%4] << '\b';
93    
94     }       }  
95    
96  }  }

Legend:
Removed from v.2870  
changed lines
  Added in v.2877

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27