|
reSIProcate/DialogUsageManager
9694
|
#include "resip/stack/SdpContents.hxx"#include "resip/stack/SipMessage.hxx"#include "resip/stack/ShutdownMessage.hxx"#include "resip/stack/SipStack.hxx"#include "resip/dum/ClientAuthManager.hxx"#include "resip/dum/ClientInviteSession.hxx"#include "resip/dum/ClientRegistration.hxx"#include "resip/dum/DialogUsageManager.hxx"#include "resip/dum/DumShutdownHandler.hxx"#include "resip/dum/InviteSessionHandler.hxx"#include "resip/dum/MasterProfile.hxx"#include "resip/dum/RegistrationHandler.hxx"#include "resip/dum/ServerInviteSession.hxx"#include "resip/dum/ServerOutOfDialogReq.hxx"#include "resip/dum/OutOfDialogHandler.hxx"#include "resip/dum/AppDialog.hxx"#include "resip/dum/AppDialogSet.hxx"#include "resip/dum/AppDialogSetFactory.hxx"#include "rutil/Log.hxx"#include "rutil/Logger.hxx"#include "rutil/Random.hxx"#include <sstream>#include <time.h>
Go to the source code of this file.
Classes | |
| class | Controller |
Defines | |
| #define | RESIPROCATE_SUBSYSTEM Subsystem::TEST |
Functions | |
| int | main (int argc, char **argv) |
| #define RESIPROCATE_SUBSYSTEM Subsystem::TEST |
Definition at line 26 of file test3pcc.cxx.
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Definition at line 130 of file test3pcc.cxx.
References resip::DialogUsageManager::addTransport(), resip::Log::Cout, resip::Data::data(), resip::DialogUsageManager::getMasterProfile(), resip::Log::initialize(), resip::DialogUsageManager::makeInviteSession(), resip::DialogUsageManager::process(), resip::FdSet::selectMilliSeconds(), resip::DialogUsageManager::send(), resip::DialogUsageManager::setClientAuthManager(), resip::DialogUsageManager::setInviteSessionHandler(), resip::DialogUsageManager::setMasterProfile(), resip::Data::size(), type, resip::UDP, and resip::Log::Warning.
{
Log::initialize(Log::Cout, resip::Log::Warning, argv[0]);
DialogUsageManager controller;
controller.addTransport(UDP, 12005);
SharedPtr<MasterProfile> uacMasterProfile(new MasterProfile);
auto_ptr<ClientAuthManager> uacAuth(new ClientAuthManager);
controller.setMasterProfile(uacMasterProfile);
controller.setClientAuthManager(uacAuth);
Controller invSessionHandler;
controller.setInviteSessionHandler(&invSessionHandler);
NameAddr controllerAor("sip:controller@internal.xten.net");
controller.getMasterProfile()->setDefaultFrom(controllerAor);
NameAddr target("sip:rohan@internal.xten.net");
Data txt("v=0\r\n"
"o=- 327064655 327074279 IN IP4 192.168.0.129\r\n"
"s=3pcc test\r\n"
"c=IN IP4 0.0.0.0\r\n"
"t=0 0\r\n"
// "m=audio 7154 RTP/AVP 0\r\n"
// "a=sendrecv\r\n"
);
HeaderFieldValue hfv(txt.data(), txt.size());
Mime type("application", "sdp");
SdpContents sdp(&hfv, type);
controller.send(controller.makeInviteSession(target, &sdp));
int n = 0;
while (true)
{
FdSet fdset;
// Should these be buildFdSet on the DUM?
controller.buildFdSet(fdset);
int err = fdset.selectMilliSeconds(100);
assert ( err != -1 );
controller.process(fdset);
if (!(n++ % 10)) cerr << "|/-\\"[(n/10)%4] << '\b';
}
return 0;
}

1.7.5.1