class SdpMessageDecorator : public MessageDecorator
{
public:
virtual ~SdpMessageDecorator() {}
virtual void decorateMessage(SipMessage &msg,
const Tuple &source,
const Tuple &destination)
{
SdpContents* sdp = dynamic_cast<SdpContents*>(msg.getContents());
if(sdp)
{
// Fill in IP and Port from source (if required)
if(sdp->session().connection().getAddress() == Data("0.0.0.0"))
{
sdp->session().connection().setAddress(Tuple::inet_ntop(source), source.ipVersion() == V6 ? SdpContents::IP6 : SdpContents::IP4);
}
if(sdp->session().origin().getAddress() == Data("0.0.0.0"))
{
sdp->session().origin().setAddress(Tuple::inet_ntop(source), source.ipVersion() == V6 ? SdpContents::IP6 : SdpContents::IP4);
}
InfoLog( << "SdpMessageDecorator: src="" << source << ", dest=" << destination << ", msg=" << endl << msg);
}
}
virtual void rollbackMessage(SipMessage& msg) {} // Nothing to do
virtual MessageDecorator* clone() const { return new SdpMessageDecorator; }
};
Scott
Hi,
When creating the contents of an SDP I need to embed the local IP address on which I will be listening for incoming RTP data. What is the best way to determine my local IP address based on the destination? For windows I noticed there is GenericIPAddress determineSourceInterface(const GenericIPAddress& destination); but I could not find a similar method for Linux.
Kind regards,
Richard Stellingwerff.
_______________________________________________
resiprocate-users mailing list
resiprocate-users@xxxxxxxxxxxxxxx
List Archive: http://list.resiprocate.org/archive/resiprocate-users/