add chat interface EXTRAGUY-00

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11319 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale committed 2009-01-20 20:49:47 +00:00
1 parent f34830563b
commit ec3f6f4ec6
9 files changed
+56 -51

No files matched your search

@@ -506,7 +506,8 @@ static void pres_event_handler(switch_event_t *event)
switch_safe_free(sql);
}
static switch_status_t chat_send(char *proto, char *from, char *to, char *subject, char *body, char *hint)
static switch_status_t chat_send(const char *proto, const char *from, const char *to, const char *subject,
const char *body, const char *type, const char *hint);
{
char *user, *host, *f_user = NULL, *ffrom = NULL, *f_host = NULL, *f_resource = NULL;
mdl_profile_t *profile = NULL;
@@ -2459,10 +2460,9 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
switch (dl_signal) {
case LDL_SIGNAL_MSG:{
switch_chat_interface_t *ci;
char *proto = MDL_CHAT_PROTO;
char *pproto = NULL, *ffrom = NULL;
char *hint;
char *proto = MDL_CHAT_PROTO;
char *pproto = NULL, *ffrom = NULL;
char *hint;
#ifdef AUTO_REPLY
if (profile->auto_reply) {
ldl_handle_send_msg(handle,
@@ -2489,11 +2489,8 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
from = ffrom;
}
if ((ci = switch_loadable_module_get_chat_interface(proto))) {
ci->chat_send(MDL_CHAT_PROTO, from, to, subject, switch_str_nil(msg), hint);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Chat Interface [%s]!\n", proto);
}
switch_core_chat_send(proto, MDL_CHAT_PROTO, from, to, subject, switch_str_nil(msg), NULL, hint);
switch_safe_free(pproto);
switch_safe_free(ffrom);
+2 -1
View File
@@ -624,7 +624,8 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
void launch_sofia_profile_thread(sofia_profile_t *profile);
switch_status_t sofia_presence_chat_send(char *proto, char *from, char *to, char *subject, char *body, char *hint);
switch_status_t sofia_presence_chat_send(const char *proto, const char *from, const char *to, const char *subject,
const char *body, const char *type, const char *hint);
void sofia_glue_tech_absorb_sdp(private_object_t *tech_pvt);
switch_status_t sofia_glue_tech_media(private_object_t *tech_pvt, const char *r_sdp);
char *sofia_reg_find_reg_url(sofia_profile_t *profile, const char *user, const char *host, char *val, switch_size_t len);
+3 -7
View File
@@ -49,7 +49,8 @@ struct presence_helper {
char last_uuid[512];
};
switch_status_t sofia_presence_chat_send(char *proto, char *from, char *to, char *subject, char *body, char *hint)
switch_status_t sofia_presence_chat_send(const char *proto, const char *from, const char *to, const char *subject,
const char *body, const char *type, const char *hint)
{
char buf[256];
char *prof = NULL, *user = NULL, *host = NULL;
@@ -2003,12 +2004,7 @@ void sofia_presence_handle_sip_i_message(int status,
}
}
} else {
switch_chat_interface_t *ci;
if ((ci = switch_loadable_module_get_chat_interface(proto))) {
ci->chat_send(SOFIA_CHAT_PROTO, from_addr, to_addr, "", msg, full_from);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid Chat Interface [%s]!\n", proto);
}
switch_core_chat_send(proto, SOFIA_CHAT_PROTO, from_addr, to_addr, "", msg, NULL, full_from);
}
switch_safe_free(to_addr);
switch_safe_free(from_addr);