< Previous by Date Date Index Next by Date >
  Thread Index Next in Thread >

RE: [reSIProcate] Using resiprocate: Forwarding messages


It looks like the sendTo that takes a tuple, needs the transport set on
it already - ie. filled in /created by stack.  Since you want the stack
to pick the transport, you should try using the sendTo method that takes
the Uri.  Ie.

sendTo(Uri("sip:192.168.0.1:5060;transport=UDP"));

Scott

-----Original Message-----
From: resiprocate-devel-bounces@xxxxxxxxxxxxxxxxxxx
[mailto:resiprocate-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of
Lorenzo
Sent: Monday, August 22, 2005 10:40 AM
To: resiprocate-devel@xxxxxxxxxxxxxxxxxxx
Subject: [reSIProcate] Using resiprocate: Forwarding messages

Hi all,

I'm going to write a simple b2bua using resiprocate.
I must read a message and decide to forward it to a proxy or drop it.

What are the best way to forward a message to a well-know IP-address?
I tried with:

/*********************************/
int main(int argc, char* argv[]) {
auto_ptr<SipStack> stack(new SipStack() );
stack->addTransport(UDP, 5060);
while (true) {

  FdSet fdset;
  stack->buildFdSet(fdset);
  fdset.selectMilliSeconds(100);
  stack->process(fdset);

  Message* msg = stack->receive();

  if (msg)
   {
   SipMessage* received = dynamic_cast<SipMessage*>(msg);
   if (received)
     {
       in_addr in;
       DnsUtil::inet_pton("192.168.0.1", in); // this is the well known 
address
       Tuple rTuple(in, 5060, UDP);
        stack.sendTo(*received, rTuple)
      }

     }
} //end while
return 0;
}
/***********************************/

but the program crash with an assert(destination.transport). I had to 
define the transport of the Tuple but how?Maybe it's a simple question, 
but I didn't find any example or docs dealing with forwarding message.
Thank you,

Lorenzo - Rome


PS
I think for improving the usability of your code, the documentation 
(expetially the wiki ) should grow up and maybe it will be usefull to 
have a resip-user mailing list too for speaking about the using of the 
code without bugging people that are developing it.





_______________________________________________
resiprocate-devel mailing list
resiprocate-devel@xxxxxxxxxxxxxxxxxxx
https://list.sipfoundry.org/mailman/listinfo/resiprocate-devel