|
reSIProcate/stack
9694
|
#include <sys/types.h>#include <iostream>#include <memory>#include "rutil/DnsUtil.hxx"#include "rutil/Inserter.hxx"#include "rutil/Logger.hxx"#include "resip/stack/Helper.hxx"#include "resip/stack/SipMessage.hxx"#include "resip/stack/SipStack.hxx"#include "resip/stack/Uri.hxx"
Go to the source code of this file.
Defines | |
| #define | RESIPROCATE_SUBSYSTEM Subsystem::SIP |
Functions | |
| int | main (int argc, char *argv[]) |
| #define RESIPROCATE_SUBSYSTEM Subsystem::SIP |
Definition at line 20 of file test503Generator.cxx.
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
Definition at line 24 of file test503Generator.cxx.
References resip::SipStack::addTransport(), resip::Message::brief(), resip::Log::Cout, resip::Log::Info, InfoLog, resip::Log::initialize(), resip::SipMessage::isRequest(), resip::Helper::makeResponse(), resip::SipStack::process(), resip::SipStack::receive(), resip::SipStack::send(), resip::TCP, and resip::UDP.
{
SipStack stack;
Log::initialize(Log::Cout, Log::Info ,"test503Generator");
stack.addTransport(UDP, 5060);
stack.addTransport(TCP, 5060);
while(true)
{
stack.process(1000);
SipMessage* msg = stack.receive();
if (msg && msg->isRequest())
{
SipMessage* resp = Helper::makeResponse(*msg, 503);
stack.send(*resp);
InfoLog( << "Generated 503 to: " << msg->brief());
delete resp;
}
delete msg;
}
}

1.7.5.1