From 86e4283ade1442276f6300030048547b02833877 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Fri, 31 Oct 2008 18:22:00 +0000 Subject: [PATCH] windows build fixes. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10211 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- .../mod_voicemail/mod_voicemail.c | 26 +++++++++---------- src/mod/endpoints/mod_sofia/sofia_presence.c | 3 +-- src/switch_utils.c | 2 +- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/mod/applications/mod_voicemail/mod_voicemail.c b/src/mod/applications/mod_voicemail/mod_voicemail.c index 3bcf8ae968..f02a9a70e5 100644 --- a/src/mod/applications/mod_voicemail/mod_voicemail.c +++ b/src/mod/applications/mod_voicemail/mod_voicemail.c @@ -2249,21 +2249,21 @@ static switch_status_t deliver_vm(vm_profile_t *profile, if (insert_db && switch_file_exists(file_path, pool) == SWITCH_STATUS_SUCCESS) { char *usql; - switch_event_t *params; + switch_event_t *message_event; - switch_event_create_subclass(¶ms, SWITCH_EVENT_CUSTOM, VM_EVENT_MAINT); - switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "VM-Action", "leave-message"); - switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "VM-User", myid); - switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "VM-Domain", domain_name); - switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "VM-Caller-ID-Name", caller_id_name); - switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "VM-Caller-ID-Number", caller_id_number); - switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "VM-File-Path", file_path); - switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "VM-Flags", read_flags); - switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "VM-Folder", myfolder); - switch_event_add_header(params, SWITCH_STACK_BOTTOM, "VM-Message-Len", "%u", message_len); - switch_event_add_header(params, SWITCH_STACK_BOTTOM, "VM-Timestamp", "%lu", (unsigned long) switch_timestamp(NULL)); + switch_event_create_subclass(&message_event, SWITCH_EVENT_CUSTOM, VM_EVENT_MAINT); + switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "VM-Action", "leave-message"); + switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "VM-User", myid); + switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "VM-Domain", domain_name); + switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "VM-Caller-ID-Name", caller_id_name); + switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "VM-Caller-ID-Number", caller_id_number); + switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "VM-File-Path", file_path); + switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "VM-Flags", read_flags); + switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "VM-Folder", myfolder); + switch_event_add_header(message_event, SWITCH_STACK_BOTTOM, "VM-Message-Len", "%u", message_len); + switch_event_add_header(message_event, SWITCH_STACK_BOTTOM, "VM-Timestamp", "%lu", (unsigned long) switch_timestamp(NULL)); - switch_event_fire(¶ms); + switch_event_fire(&message_event); usql = switch_mprintf("insert into voicemail_msgs values(%ld,0,'%q','%q','%q','%q','%q','%q','%q','%u','','%q')", (long) switch_timestamp(NULL), myid, domain_name, uuid_str, caller_id_name, caller_id_number, diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c index c17af3513f..15735307db 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -1205,8 +1205,7 @@ static int sofia_presence_mwi_callback2(void *pArg, int argc, char **argv, char id = switch_mprintf("sip:%s@%s", sub_to_user, sub_to_host); contact = sofia_glue_get_url_from_contact(o_contact, 1); - if ((route = strstr(o_contact, ";fs_path="))) { - route = strdup(route + 9); + if ((route = strstr(o_contact, ";fs_path=")) && (route = strdup(route + 9))) { for (p = route; p && *p ; p++) { if (*p == '>' || *p == ';') { diff --git a/src/switch_utils.c b/src/switch_utils.c index dfced8df5b..ae3c6acc6e 100644 --- a/src/switch_utils.c +++ b/src/switch_utils.c @@ -1071,7 +1071,7 @@ SWITCH_DECLARE(char *) get_addr(char *buf, switch_size_t len, struct sockaddr *s switch_assert(buf); *buf = '\0'; if (sa) { - getnameinfo(sa, salen, buf, len, NULL, 0, NI_NUMERICHOST); + getnameinfo(sa, salen, buf, (socklen_t)len, NULL, 0, NI_NUMERICHOST); } return buf; }