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
This commit is contained in:
parent
e1125f336c
commit
efd246babd
|
@ -278,6 +278,7 @@
|
|||
<param name="message" value="Jingle all the way"/>
|
||||
<param name="rtp-ip" value="10.0.0.1"/>
|
||||
<param name="auto-login" value="true"/>
|
||||
<param name="auto-reply" value="Press *Call* to call FreeSWITCH and be sure to come to ClueCon! http://www.cluecon.com"/>
|
||||
<!-- SASL "plain" or "md5" -->
|
||||
<param name="sasl" value="plain"/>
|
||||
<!-- if the server where the jabber is hosted is not the same as the one in the jid -->
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue