Michael,
It worked. I really appreciate your help!
Thanks again,
Lin Huang
From: Michael Jerris [mailto:m...@jerris.com]
Sent: Tuesday, March 17, 2009 6:43 PM
To: Lin Huang; sofia-sip-devel
Subject: Re: [Sofia-sip-devel] How to get the source IP address of an
incoming message
Something like this should do the trick from your event callback
su_addrinfo_t *my_addrinfo =
msg_addrinfo(nua_current_request(nua));
char network_ip[80] = {0};
int network_port = 0;
if (my_addrinfo->ai_addr) {
getnameinfo(my_addrinfo->ai_addr, my_addrinfo->ai_addrlen, network_ip,
(socklen_t)sizeof(network_ip), NULL, 0, NI_NUMERICHOST);
}
network_port = ntohs(((struct sockaddr_in *)
msg_addrinfo(nua_current_request(nua))->ai_addr)->sin_port);
On Mar 17, 2009, at 6:06 PM, Lin Huang wrote:
Hello,
My application needs to know the source IP address of an incoming
message.
The comments for sip_s in sip.h mention "The generic transport aspects
of the message, like network address, is accessed using the #msg_t
object directly."
I looked at the definition of msg_t but did not figure out how this is
done.
Could someone explain the steps if you did the same thing before?
Thanks in advance for your help,
Lin Huang
This message is confidential to Prodea Systems, Inc unless otherwise
indicated
or apparent from its nature. This message is directed to the intended
recipient
only, who may be readily determined by the sender of this message and
its
contents. If the reader of this message is not the intended recipient,
or an
employee or agent responsible for delivering this message to the
intended
recipient:(a)any dissemination or copying of this message is strictly
prohibited; and(b)immediately notify the sender by return message and
destroy
any copies of this message in any form(electronic, paper or otherwise)
that you
have.The delivery of this message and its information is neither
intended to be
nor constitutes a disclosure or waiver of any trade secrets,
intellectual
property, attorney work product, or attorney-client communications. The
authority of the individual sending this message to legally bind Prodea
Systems
is neither apparent nor implied,and must be independently verified.
------------------------------------------------------------------------
------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based
development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial.
http://p.sf.net/sfu/www-adobe-com_______________________________________
________
<http://console.mxlogic.com/redir/?b33WrXMVcSC-yejhjhdw0RKEXMdOzHu52-El8
unn5hkl5hkl5hkl5hkl5hkl5hkl5hkl5hkl5hkl5hkl5hkl5hkl5hkl5hkl5hkl5hkTvHTd7
b0VAsNsQsCXCRp5v1gzYoOFOVJ5dNxUSyCOepppohKr73zobZ8Qg6BIoGXbiZ9b5Qfc-uqnj
h05WC3h1eFEw8_cQgj9-q8alrzrPh06xoQgqwx7Wkd45njh1I3h1a2YE4jh0HZaqhYTfM-ub
7Xa1J4SCrjvh79TusdIf_pfbHZAY-F>
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel
<http://console.mxlogic.com/redir/?1oovjvu79CQTQhOqaq9IDeqR4IM-l9QWBmUSZ
Q03_0T3VkDj3VkDa3JsFlSmBWimbEupYYTvHTd7b0VAsNsQsCXCRp5v1gzYoOFOVJ5dNxUSy
COepppohKr73zobZ8Qg6BIoGXbiZ9b5Qfc-uqnjh05WC3h1eFEw8_cQgj9-q8alrzrPh06xo
Qgqwx7Wkd45njh1I3h1a2YE4jh0HZaqhYTfM-ub7Xa1JcSCrjvh79TusdIf_pfbHZAY-F>
This message is confidential to Prodea Systems, Inc unless otherwise indicated
or apparent from its nature. This message is directed to the intended recipient
only, who may be readily determined by the sender of this message and its
contents. If the reader of this message is not the intended recipient, or an
employee or agent responsible for delivering this message to the intended
recipient:(a)any dissemination or copying of this message is strictly
prohibited; and(b)immediately notify the sender by return message and destroy
any copies of this message in any form(electronic, paper or otherwise) that you
have.The delivery of this message and its information is neither intended to be
nor constitutes a disclosure or waiver of any trade secrets, intellectual
property, attorney work product, or attorney-client communications. The
authority of the individual sending this message to legally bind Prodea Systems
is neither apparent nor implied,and must be independently verified.
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel