diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index 25c9ccabeb..02c34e452f 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -247,6 +247,7 @@ uint8_t sofia_reg_handle_register(nua_t * nua, sofia_profile_t *profile, nua_han switch_event_t *event; const char *rpid = "unknown"; const char *display = "\"user\""; + char network_addr[80]; /* all callers must confirm that sip, sip->sip_request and sip->sip_contact are not NULL */ assert(sip != NULL && sip->sip_contact != NULL && sip->sip_request != NULL); @@ -325,7 +326,8 @@ uint8_t sofia_reg_handle_register(nua_t * nua, sofia_profile_t *profile, nua_han } if (!authorization || stale) { - snprintf(params, sizeof(params), "from_user=%s&from_host=%s&contact=%s", from_user, from_host, contact_str); + get_addr(network_addr, sizeof(network_addr), &((struct sockaddr_in *) msg_addrinfo(nua_current_request(nua))->ai_addr)->sin_addr); + snprintf(params, sizeof(params), "network_addr=%s&from_user=%s&from_host=%s&contact=%s", network_addr, from_user, from_host, contact_str); if (switch_xml_locate("directory", "domain", "name", from_host, &xml, &domain, params) != SWITCH_STATUS_SUCCESS) { @@ -780,3 +782,4 @@ void sofia_reg_add_gateway(char *key, outbound_reg_t * gateway) +