Re: [reSIProcate-users] how to get Sip message direct destination ?
Despite it's similar naming getDestination is not similar in functionality to getSource. set/getDesintation is used by the stack itself to instruct the message sending code to use a particular fixed destination, instead of doing a DNS lookup. It's still not clear to me what you need - are you looking for the destination of inbound (received) or outbound (about to send) messages?
If inbound - I think the only reliable way would be to ensure that your application binds it's transports to a specific IP address (not INADDR_ANY), then use SipMessage::getReceivedTransport()->getTuple()
If outbound - you can use a message Decorator that will be called after transport selection and just before the message is sent out on the wire - that callback has both source and destination passed to it. (See SipMessage::addOutboundDecorator).
Thanks,
Scott
2010/5/29 刘鹏
<buptsam@xxxxxxxxx>
Hi Scott,
Thank you for your reply.
In fact my work is modifying my teammates' module working as a sip proxy. When she calls the method SipMessage = stack.receive(), and the function returns a non-null value, I'll call SipMessage::getDestination() just for testing. When she calls the method stack.send(SipMessage), I'll call SipMessage::getDestination() to get direct destination of the SIP message. It's always successful when I test SipMessage::getSource() in the same location.
I think my teammate's module works well as she has tested her module with X-Lite and our own SIP terminals.
Best regards!
2010/5/30 Scott Godin
<sgodin@xxxxxxxxxxxxxxx>
Are you trying to get the destination of a SIP message that is outbound from your application (ie. the IP address/port of the NIC that the message will be sent on), or the destination of an inbound SIP message (ie. the IP address/port that the message was received on)?
Scott
Hi All,
Recently I met a strange question: when I send or receive a message , I can get the direct source of the message smoothly by using SipMessage::getSource. However , when I want to get the direct destination of the message , the same measure didn't work by using SipMessage::getDestination() . I can get nothing . Anyone who can solve the problem please give me a hand . Thanks in advance :)
Best wishes.
_______________________________________________
resiprocate-users mailing list
resiprocate-users@xxxxxxxxxxxxxxx
List Archive: http://list.resiprocate.org/archive/resiprocate-users/
--
刘鹏
北京邮电大学计算机院