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

Re: [reSIProcate-users] Why SipMessage.getDestination is empty


hi, scott,

I want to know the ip address dum used because  I use addTransport with ip interface = Data::Empty
I tried SipMessage::getReceivedTransport. like this:

onSuccess(ClientRegistrationHandle h, const SipMessage& response)
{
    ...
    addr = response.getReceivedTransport()->getTuple().getSockaddr();
or 
    addr = response.getReceivedTransport()->boundInterface();
}

but the ip of addr is zero
any idea ?


2009/11/13 Scott Godin <slgodin@xxxxxxxxx>
setDestination is mainly used to force an outbound SIP message to
ignore the require URI and route directly to that destination - it is
not intended to be used to query the destination socket information of
inbound requests (this is documented in the SipMessage header file).
If you want to get a pointer to the transport that received the
message use SipMessage::getReceivedTransport.

Scott

On Fri, Nov 13, 2009 at 2:08 AM, maodong hu <hhmmdd@xxxxxxx> wrote:
> hi, all
> in my ClientRegistrationHandler::onSuccess(ClientRegistrationHandle h, const
> SipMessage& response), I want get the destination address of the response
> message, but failed, it is empty,
> I use ((SipMessage&)response).getDestination().getSockaddr() , the addr is
> zero
> but if I get Source addr, it is success to get
> response.getSource().getSockaddr() , it can get correct value
> anyone can help to explain if it is bug for the getDestination() or not
>
> --
> Best Regards
>
> Maodong Hu
>
> _______________________________________________
> resiprocate-users mailing list
> resiprocate-users@xxxxxxxxxxxxxxx
> List Archive: http://list.resiprocate.org/archive/resiprocate-users/
>




--
Best Regards

Maodong Hu