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

Re: [reSIProcate-users] Creating a Uri obj from a Data


Thanks Jason, thats cleared that problem.
What Im trying to do is force a response to be sent to a particular IP,port.
I thought I could do it by generating a Uri and setting it as forceTarget for the response message like this:

targetstr = "<sip:200@xxxxxxxxxxxxx:5060;transport=udp>";
resip::Data addr=resip::Data::from(targetstr);
resip::NameAddr nameaddr(addr);
resip::Uri prevhoptarget(nameaddr.uri());
msg->setForceTarget(prevhoptarget);

But when I try to send I get an excpetion from the stack:

TransportSelector.cxx:742: void resip::TransportSelector::transmit(resip::SipMessage*, resip::Tuple&): Assertion `target.transport' failed.

Perhaps theres a better way to go about this?

Regards
Andrew


Jason Fischl wrote:
If it's throwing an exception it is because it is not a URI. In your
example because it has the angle brackets, it should be parsed into a
NameAddr which itself has a Uri within it.

On Sun, Jan 4, 2009 at 5:09 PM, Andrew Wood <ajwood@xxxxxxx> wrote:
If I've got a Data obj containing a string such as
<sip:200@xxxxxxxxxxxxx:5060;transport=UDP>

How can I create a Uri obj from that, I thought I could pass it to the
constructor but its throwing an exception

Thanks
Andrew


_______________________________________________
resiprocate-users mailing list
resiprocate-users@xxxxxxxxxxxxxxx
List Archive: http://list.resiprocate.org/archive/resiprocate-users/


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email ______________________________________________________________________