sofia_regtype_t regtype, const char *realm, int stale, long exptime);
auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile, sip_authorization_t const *authorization,
sip_t const *sip,
- sofia_dispatch_event_t *de, const char *regstr, char *np, size_t nplen, char *ip, switch_event_t **v_event,
+ sofia_dispatch_event_t *de, const char *regstr, char *np, size_t nplen, char *ip, int network_port, switch_event_t **v_event,
long exptime, sofia_regtype_t regtype, const char *to_user, switch_event_t **auth_params, long *reg_count, switch_xml_t *user_xml);
* Joseph Sullivan <jossulli@amazon.com>
* Emmanuel Schmidbauer <e.schmidbauer@gmail.com>
* William King <william.king@quentustech.com>
+ * David Knell <david.knell@telng.com>
*
* sofia.c -- SOFIA SIP Endpoint (sofia code)
*
if (authorization) {
char network_ip[80];
- sofia_glue_get_addr(de->data->e_msg, network_ip, sizeof(network_ip), NULL);
+ int network_port;
+ sofia_glue_get_addr(de->data->e_msg, network_ip, sizeof(network_ip), &network_port);
auth_res = sofia_reg_parse_auth(profile, authorization, sip, de,
- (char *) sip->sip_request->rq_method_name, tech_pvt->key, strlen(tech_pvt->key), network_ip, NULL, 0,
+ (char *) sip->sip_request->rq_method_name, tech_pvt->key, strlen(tech_pvt->key), network_ip, network_port, NULL, 0,
REG_INVITE, NULL, NULL, NULL, NULL);
}
* Raymond Chandler <intralanman@freeswitch.org>
* William King <william.king@quentustech.com>
* Emmanuel Schmidbauer <e.schmidbauer@gmail.com>
+ * David Knell <david.knell@telng.com>
*
* sofia_presence.c -- SOFIA SIP Endpoint (presence code)
*
if (authorization) {
char network_ip[80];
- sofia_glue_get_addr(de->data->e_msg, network_ip, sizeof(network_ip), NULL);
+ int network_port;
+ sofia_glue_get_addr(de->data->e_msg, network_ip, sizeof(network_ip), &network_port);
auth_res = sofia_reg_parse_auth(profile, authorization, sip, de,
- (char *) sip->sip_request->rq_method_name, key, sizeof(key), network_ip, &v_event, 0,
+ (char *) sip->sip_request->rq_method_name, key, sizeof(key), network_ip, network_port, &v_event, 0,
REG_REGISTER, to_user, NULL, NULL, NULL);
} else if ( sofia_reg_handle_register(nua, profile, nh, sip, de, REG_REGISTER, key, sizeof(key), &v_event, NULL, NULL, NULL)) {
if (v_event) {
if (authorization) {
char network_ip[80];
- sofia_glue_get_addr(de->data->e_msg, network_ip, sizeof(network_ip), NULL);
+ int network_port;
+ sofia_glue_get_addr(de->data->e_msg, network_ip, sizeof(network_ip), &network_port);
auth_res = sofia_reg_parse_auth(profile, authorization, sip, de,
- (char *) sip->sip_request->rq_method_name, key, keylen, network_ip, NULL, 0,
+ (char *) sip->sip_request->rq_method_name, key, keylen, network_ip, network_port, NULL, 0,
REG_INVITE, NULL, NULL, NULL, NULL);
} else if ( sofia_reg_handle_register(nua, profile, nh, sip, de, REG_INVITE, key, (uint32_t)keylen, &v_event, NULL, NULL, NULL)) {
if (v_event) {
* Paul D. Tinsley <pdt at jackhammer.org>
* Bret McDanel <trixter AT 0xdecafbad.com>
* Marcel Barbulescu <marcelbarbulescu@gmail.com>
- * David Knell <>
+ * David Knell <david.knell@telng.com>
* Eliot Gable <egable AT.AT broadvox.com>
* Leon de Rooij <leon@scarlet-internet.nl>
* Emmanuel Schmidbauer <e.schmidbauer@gmail.com>
const char *username = "unknown";
const char *realm = reg_host;
if ((auth_res = sofia_reg_parse_auth(profile, authorization, sip, de, sip->sip_request->rq_method_name,
- key, keylen, network_ip, v_event, exptime, regtype, to_user, &auth_params, ®_count, user_xml)) == AUTH_STALE) {
+ key, keylen, network_ip, network_port, v_event, exptime, regtype, to_user, &auth_params, ®_count, user_xml)) == AUTH_STALE) {
stale = 1;
}
char *np,
size_t nplen,
char *ip,
+ int network_port,
switch_event_t **v_event,
long exptime, sofia_regtype_t regtype, const char *to_user, switch_event_t **auth_params, long *reg_count, switch_xml_t *user_xml)
{
const char *user_agent = NULL;
const char *user_agent_filter = profile->user_agent_filter;
uint32_t max_registrations_perext = profile->max_registrations_perext;
+ char client_port[16];
+ snprintf(client_port, 15, "%d", network_port);
username = realm = nonce = uri = qop = cnonce = nc = response = NULL;
switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "sip_auth_method", (sip && sip->sip_request) ? sip->sip_request->rq_method_name : NULL);
+ switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "client_port", client_port);
if (auth_params) {
switch_event_dup(auth_params, params);
}