add user_agent to sip lookups

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7269 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2008-01-17 19:25:01 +00:00
parent 4181b2bc87
commit d6a57e8ca2
3 changed files with 10 additions and 8 deletions

View File

@ -469,8 +469,9 @@ void sofia_presence_mwi_event_handler(switch_event_t *event);
void sofia_presence_cancel(void); void sofia_presence_cancel(void);
switch_status_t config_sofia(int reload, char *profile_name); switch_status_t config_sofia(int reload, char *profile_name);
void sofia_reg_auth_challange(nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_regtype_t regtype, const char *realm, int stale); void sofia_reg_auth_challange(nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_regtype_t regtype, const char *realm, int stale);
auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile, sip_authorization_t const *authorization, const char *regstr, char *np, size_t nplen, auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile, sip_authorization_t const *authorization, sip_t const *sip, const char *regstr,
char *ip, switch_event_t **v_event, long exptime, sofia_regtype_t regtype, const char *to_user); char *np, size_t nplen, char *ip, switch_event_t **v_event, long exptime, sofia_regtype_t regtype, const char *to_user);
void sofia_reg_handle_sip_r_challenge(int status, void sofia_reg_handle_sip_r_challenge(int status,
char const *phrase, char const *phrase,
nua_t *nua, sofia_profile_t *profile, nua_t *nua, sofia_profile_t *profile,

View File

@ -196,7 +196,7 @@ void sofia_event_callback(nua_event_t event,
if (authorization) { if (authorization) {
char network_ip[80]; char network_ip[80];
get_addr(network_ip, sizeof(network_ip), &((struct sockaddr_in *) msg_addrinfo(nua_current_request(nua))->ai_addr)->sin_addr); get_addr(network_ip, sizeof(network_ip), &((struct sockaddr_in *) msg_addrinfo(nua_current_request(nua))->ai_addr)->sin_addr);
auth_res = sofia_reg_parse_auth(profile, authorization, auth_res = sofia_reg_parse_auth(profile, authorization, sip,
(char *) sip->sip_request->rq_method_name, tech_pvt->key, strlen(tech_pvt->key), network_ip, NULL, 0, REG_INVITE, NULL); (char *) sip->sip_request->rq_method_name, tech_pvt->key, strlen(tech_pvt->key), network_ip, NULL, 0, REG_INVITE, NULL);
} }

View File

@ -412,8 +412,8 @@ uint8_t sofia_reg_handle_register(nua_t * nua, sofia_profile_t *profile, nua_han
if (authorization) { if (authorization) {
char *v_contact_str; char *v_contact_str;
if ((auth_res = sofia_reg_parse_auth(profile, authorization, sip->sip_request->rq_method_name, key, keylen, network_ip, v_event, exptime, regtype, to_user)) if ((auth_res = sofia_reg_parse_auth(profile, authorization, sip, sip->sip_request->rq_method_name,
== AUTH_STALE) { key, keylen, network_ip, v_event, exptime, regtype, to_user)) == AUTH_STALE) {
stale = 1; stale = 1;
} }
@ -757,7 +757,7 @@ void sofia_reg_handle_sip_r_challenge(int status,
} }
auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile, sip_authorization_t const *authorization, const char *regstr, auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile, sip_authorization_t const *authorization, sip_t const *sip, const char *regstr,
char *np, size_t nplen, char *ip, switch_event_t **v_event, long exptime, sofia_regtype_t regtype, const char *to_user) char *np, size_t nplen, char *ip, switch_event_t **v_event, long exptime, sofia_regtype_t regtype, const char *to_user)
{ {
int indexnum; int indexnum;
@ -853,8 +853,9 @@ auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile, sip_authorization_t co
free(sql); free(sql);
} }
pbuf = switch_mprintf("profile=%s", profile->name); pbuf = switch_mprintf("action=sip_auth&profile=%s&user_agent=%s",
profile->name,
(sip && sip->sip_user_agent) ? sip->sip_user_agent->g_string : "unknown");
if (!switch_strlen_zero(profile->reg_domain)) { if (!switch_strlen_zero(profile->reg_domain)) {
domain_name = profile->reg_domain; domain_name = profile->reg_domain;