From efd246babd4465e98c961cd1c602fdd039391137 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 12 Oct 2006 14:06:09 +0000 Subject: [PATCH] add auto-reply option to dingaling to allow the gateway bot to auto-reply to chat msgs recieved outside the context of a call git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3041 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- conf/freeswitch.xml | 1 + src/mod/endpoints/mod_dingaling/mod_dingaling.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/conf/freeswitch.xml b/conf/freeswitch.xml index 9e5d0e2e80..d983ce3286 100644 --- a/conf/freeswitch.xml +++ b/conf/freeswitch.xml @@ -278,6 +278,7 @@ + diff --git a/src/mod/endpoints/mod_dingaling/mod_dingaling.c b/src/mod/endpoints/mod_dingaling/mod_dingaling.c index 3fc026b982..05d6979c40 100644 --- a/src/mod/endpoints/mod_dingaling/mod_dingaling.c +++ b/src/mod/endpoints/mod_dingaling/mod_dingaling.c @@ -95,6 +95,7 @@ struct mdl_profile { char *login; char *password; char *message; + char *auto_reply; char *dialplan; char *ip; char *extip; @@ -1302,6 +1303,8 @@ static void set_profile_val(struct mdl_profile *profile, char *var, char *val) switch_set_flag(profile, TFLAG_TIMER); } else if (!strcasecmp(var, "dialplan")) { profile->dialplan = switch_core_strdup(module_pool, val); + } else if (!strcasecmp(var, "auto-reply")) { + profile->auto_reply = switch_core_strdup(module_pool, val); } else if (!strcasecmp(var, "name")) { profile->name = switch_core_strdup(module_pool, val); } else if (!strcasecmp(var, "message")) { @@ -1551,6 +1554,11 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi if (msg) { switch_event_add_body(event, msg); } + + if (profile->auto_reply) { + ldl_handle_send_msg(handle, from, "", profile->auto_reply); + } + switch_event_fire(&event); } break;