mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 05:02:10 +00:00
make sofia set network_addr as the address the packet was actually received from, not the address from the uri.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4169 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -74,6 +74,7 @@ typedef struct private_object private_object_t;
|
||||
#include <sofia-sip/su_md5.h>
|
||||
#include <sofia-sip/su_log.h>
|
||||
#include <sofia-sip/nea.h>
|
||||
#include <sofia-sip/msg_addr.h>
|
||||
|
||||
extern su_log_t tport_log[];
|
||||
|
||||
@@ -4173,7 +4174,7 @@ static void sip_i_invite(nua_t *nua,
|
||||
sip_unknown_t *un;
|
||||
private_object_t *tech_pvt = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
sip_from_t const *from = sip->sip_from;
|
||||
sip_from_t const *from = sip->sip_from;
|
||||
sip_to_t const *to = sip->sip_to;
|
||||
char *displayname;
|
||||
char *username, *req_username = NULL;
|
||||
@@ -4184,8 +4185,9 @@ static void sip_i_invite(nua_t *nua,
|
||||
char *via_rport, *via_host, *via_port;
|
||||
char *from_port;
|
||||
char uri[1024];
|
||||
char network_ip[80];
|
||||
|
||||
|
||||
|
||||
if (!(sip && sip->sip_contact && sip->sip_contact->m_url)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "NO CONTACT!\n");
|
||||
return;
|
||||
@@ -4212,6 +4214,9 @@ static void sip_i_invite(nua_t *nua,
|
||||
tech_pvt->key = switch_core_session_strdup(session, key);
|
||||
}
|
||||
|
||||
get_addr(network_ip, sizeof(network_ip), &((struct sockaddr_in *)msg_addrinfo(nua_current_request(nua))->ai_addr)->sin_addr);
|
||||
|
||||
|
||||
to_user = (char *) to->a_url->url_user;
|
||||
to_host = (char *) to->a_url->url_host;
|
||||
if (!(to_port = (char *) to->a_url->url_port)) {
|
||||
@@ -4365,7 +4370,7 @@ static void sip_i_invite(nua_t *nua,
|
||||
profile->dialplan,
|
||||
displayname,
|
||||
(char *) from->a_url->url_user,
|
||||
(char *) from->a_url->url_host,
|
||||
network_ip,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
||||
Reference in New Issue
Block a user