Re: [reSIProcate-users] How to register user to the proxy...?
Hi,
The Profile object contains all the information that the DUM (dialog
usage manager) layer uses to keep you registered with a proxy for one
identity / AOR. Once you provide DUM with a Profile object with this
information and the appropriate callback handlers, DUM will send the
actual register requests for you and keep them updates.
Lets say you have an account on iptel.org with an AOR of
sip:rsnair@xxxxxxxxx and a password of secret. The code in UserAgent
will assume that the registrar is iptel.org and the realm is
iptel.org too. It assumes that the Digest username is the same as
the userpart. (You can change the code slightly if your proxy
doesn't work this way).
Uri userAor = Uri(Data("sip:rsnair@xxxxxxxxx"));
Data password = Data("secret");
You can also check out dum/test/UserAgent.cxx for a working and
pretty complete example of a basic UserAgent that registers.
thanks,
-rohan
On Jul 10, 2007, at 6:14 PM, Nair, Rankarajan S. (Rankarajan S.) wrote:
I am a new user of resiprocate.
How do I register my user to a proxy? The example
[basicRegister.cxx] does not show this, neither I could not find
any direct ways.
The sample does not accept proxyURI as one of the arguments...so
where is it trying to register to?
thanks in advance...
======================================================================
=====
excerpt from sample:
SipStack stack;
#endif
/*DnsStub::NameserverList additional;
GenericIPAddress ip(
additional.push_back(
SipStack stack(*/
DialogUsageManager clientDum(stack);
SharedPtr<MasterProfile> profile(new MasterProfile);
auto_ptr<ClientAuthManager> clientAuth(new ClientAuthManager);
ClientHandler clientHandler;
clientDum.addTransport(UDP, 5060, V4);
// clientDum.addTransport(UDP, 10000 + rand()&0x7fff, V6);
//clientDum.addTransport(TCP, 10000 + rand()&0x7fff, V4);
// clientDum.addTransport(TCP, 10000 + rand()&0x7fff, V6);
#ifdef USE_SSL
clientDum.addTransport(TLS, 10000 + rand()&0x7fff, V4);
// clientDum.addTransport(TLS, 10000 + rand()&0x7fff, V6);
#endif
clientDum.setMasterProfile(profile);
clientDum.setClientRegistrationHandler(&clientHandler);
clientDum.setClientAuthManager(clientAuth);
clientDum.getMasterProfile()->setDefaultRegistrationTime(70);
// keep alive test.
auto_ptr<KeepAliveManager> keepAlive(new KeepAliveManager);
clientDum.setKeepAliveManager(keepAlive);
clientDum.getMasterProfile()->setDefaultFrom(userAor);
profile->setDigestCredential(userAor.uri().host(),
userAor.uri().user(),
passwd);
SharedPtr<SipMessage> regMessage = clientDum.makeRegistration
(userAor);
NameAddr contact;
clientDum.send( regMessage );
_______________________________________________
resiprocate-users mailing list
resiprocate-users@xxxxxxxxxxxxxxxxxxxx
List Archive: http://list.resiprocate.org/archive/resiprocate-users/