mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-05-29 10:01:41 +00:00
FS-3635 --resolve
This commit is contained in:
parent
0aba0cd3fa
commit
ced3cbb285
@ -368,7 +368,31 @@ static switch_status_t chat_send(switch_event_t *message_event)
|
|||||||
{
|
{
|
||||||
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
switch_status_t status = SWITCH_STATUS_SUCCESS;
|
||||||
switch_event_t *exten;
|
switch_event_t *exten;
|
||||||
|
int forwards = 0;
|
||||||
|
const char *var;
|
||||||
|
|
||||||
|
var = switch_event_get_header(message_event, "max_forwards");
|
||||||
|
|
||||||
|
if (!var) {
|
||||||
|
forwards = 70;
|
||||||
|
} else {
|
||||||
|
forwards = atoi(var);
|
||||||
|
|
||||||
|
if (forwards) {
|
||||||
|
forwards--;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!forwards) {
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Max forwards reached\n");
|
||||||
|
DUMP_EVENT(message_event);
|
||||||
|
return SWITCH_STATUS_FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (forwards) {
|
||||||
|
switch_event_add_header(message_event, SWITCH_STACK_BOTTOM, "max_forwards", "%d", forwards);
|
||||||
|
}
|
||||||
|
|
||||||
if ((exten = chatplan_hunt(message_event))) {
|
if ((exten = chatplan_hunt(message_event))) {
|
||||||
switch_event_header_t *hp;
|
switch_event_header_t *hp;
|
||||||
|
|
||||||
@ -402,6 +426,8 @@ SWITCH_STANDARD_CHAT_APP(send_function)
|
|||||||
dest_proto = switch_event_get_header(message, "dest_proto");
|
dest_proto = switch_event_get_header(message, "dest_proto");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch_event_add_header(message, SWITCH_STACK_BOTTOM, "skip_global_process", "true");
|
||||||
|
|
||||||
switch_core_chat_send(dest_proto, message);
|
switch_core_chat_send(dest_proto, message);
|
||||||
|
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user