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

Re: [reSIProcate] Using resiprocate: Forwarding messages


Lorenzo wrote:

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.

I totally agree..... but I hope that resip-developers would also read it. If not for Our benefit, but to the benefit to all users who would want a communication link back to the developers for allowing feedback from the "resip" users.
John