[reSIProcate] Newbe question about sending sip packets

Lorenzo webmaster at frascati1.org
Sat Oct 8 18:39:28 CDT 2005


Hi all,
I want to make a simple (maybe the simplest!) program to send a simple
sipmessage using resiprocate stack and a simple udp trasport.
I compile it on linux and windows and it's correct but it doesn't send
any packet!!
Does someone know what's wrong with this code?

Thank you,

Lorenzo
------------------------------------------------------------

#include "resiprocate/SipStack.hxx"
#include "resiprocate/Helper.hxx"
#include "resiprocate/SipMessage.hxx"
#include "resiprocate/Uri.hxx"
#include "resiprocate/os/Data.hxx"
#include "resiprocate/os/DnsUtil.hxx"
#include "resiprocate/os/Logger.hxx"
#include "resiprocate/os/DataStream.hxx"

using namespace resip;
using namespace std;

int main()
{
	resip::SipStack* stack(new SipStack());
	Uri outboundProxy = Uri("sip:192.168.0.1:5060:trasport=UDP");
	stack->addTransport(UDP, 5060, V4 );
	
	NameAddr target;
 	target.uri().scheme() = "sip";
  	target.uri().user() = "Lorenzo";
   	target.uri().host() = "192.168.0.1";
   	target.uri().port() = 5060;

	NameAddr from = target;
	from.uri().user() = "192.168.0.100";
	NameAddr contact = from;
	SipMessage* next = Helper::makeRegister( target, from, contact);
	stack->sendTo(next,outboundProxy);
	delete stack;
	return 0;
}
-------------------------------




More information about the resiprocate-devel mailing list