mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-28 13:14:23 +00:00
skypiax: added 'report_incoming_chatmessages' configuration file per_interface setting. To activate it, put its value to '1' or 'true', any other value will be 'false'. Defualts to 'true'
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15343 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
5a16fd1cce
commit
a697216119
@ -1133,6 +1133,7 @@ static switch_status_t load_config(int reload_type)
|
|||||||
char *tcp_cli_port = NULL;
|
char *tcp_cli_port = NULL;
|
||||||
char *tcp_srv_port = NULL;
|
char *tcp_srv_port = NULL;
|
||||||
char *skype_user = NULL;
|
char *skype_user = NULL;
|
||||||
|
char *report_incoming_chatmessages = "true";
|
||||||
|
|
||||||
uint32_t interface_id = 0, to = 0, max = 0;
|
uint32_t interface_id = 0, to = 0, max = 0;
|
||||||
|
|
||||||
@ -1162,6 +1163,8 @@ static switch_status_t load_config(int reload_type)
|
|||||||
hold_music = val;
|
hold_music = val;
|
||||||
} else if (!strcasecmp(var, "skype_user")) {
|
} else if (!strcasecmp(var, "skype_user")) {
|
||||||
skype_user = val;
|
skype_user = val;
|
||||||
|
} else if (!strcasecmp(var, "report_incoming_chatmessages")) {
|
||||||
|
report_incoming_chatmessages = val;
|
||||||
} else if (!strcasecmp(var, "tcp_cli_port")) {
|
} else if (!strcasecmp(var, "tcp_cli_port")) {
|
||||||
tcp_cli_port = val;
|
tcp_cli_port = val;
|
||||||
} else if (!strcasecmp(var, "tcp_srv_port")) {
|
} else if (!strcasecmp(var, "tcp_srv_port")) {
|
||||||
@ -1277,6 +1280,13 @@ static switch_status_t load_config(int reload_type)
|
|||||||
switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].destination, destination);
|
switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].destination, destination);
|
||||||
switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].context, context);
|
switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].context, context);
|
||||||
|
|
||||||
|
if(!strcmp(report_incoming_chatmessages, "true") || !strcmp(report_incoming_chatmessages, "1")){
|
||||||
|
globals.SKYPIAX_INTERFACES[interface_id].report_incoming_chatmessages = 1;
|
||||||
|
}else {
|
||||||
|
globals.SKYPIAX_INTERFACES[interface_id].report_incoming_chatmessages = 0; //redundant, just in case
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
DEBUGA_SKYPE
|
DEBUGA_SKYPE
|
||||||
("interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].X11_display=%s\n",
|
("interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].X11_display=%s\n",
|
||||||
SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].X11_display);
|
SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].X11_display);
|
||||||
@ -1303,6 +1313,11 @@ static switch_status_t load_config(int reload_type)
|
|||||||
DEBUGA_SKYPE
|
DEBUGA_SKYPE
|
||||||
("interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].context=%s\n",
|
("interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].context=%s\n",
|
||||||
SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].context);
|
SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].context);
|
||||||
|
|
||||||
|
DEBUGA_SKYPE
|
||||||
|
("interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].report_incoming_chatmessages=%d\n",
|
||||||
|
SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].report_incoming_chatmessages);
|
||||||
|
|
||||||
WARNINGA("STARTING interface_id=%d\n", SKYPIAX_P_LOG, interface_id);
|
WARNINGA("STARTING interface_id=%d\n", SKYPIAX_P_LOG, interface_id);
|
||||||
|
|
||||||
switch_threadattr_create(&skypiax_api_thread_attr, skypiax_module_pool);
|
switch_threadattr_create(&skypiax_api_thread_attr, skypiax_module_pool);
|
||||||
@ -1392,6 +1407,7 @@ static switch_status_t load_config(int reload_type)
|
|||||||
DEBUGA_SKYPE("i=%d globals.SKYPIAX_INTERFACES[%d].dialplan=%s\n", SKYPIAX_P_LOG, i, i, globals.SKYPIAX_INTERFACES[i].dialplan);
|
DEBUGA_SKYPE("i=%d globals.SKYPIAX_INTERFACES[%d].dialplan=%s\n", SKYPIAX_P_LOG, i, i, globals.SKYPIAX_INTERFACES[i].dialplan);
|
||||||
DEBUGA_SKYPE("i=%d globals.SKYPIAX_INTERFACES[%d].destination=%s\n", SKYPIAX_P_LOG, i, i, globals.SKYPIAX_INTERFACES[i].destination);
|
DEBUGA_SKYPE("i=%d globals.SKYPIAX_INTERFACES[%d].destination=%s\n", SKYPIAX_P_LOG, i, i, globals.SKYPIAX_INTERFACES[i].destination);
|
||||||
DEBUGA_SKYPE("i=%d globals.SKYPIAX_INTERFACES[%d].context=%s\n", SKYPIAX_P_LOG, i, i, globals.SKYPIAX_INTERFACES[i].context);
|
DEBUGA_SKYPE("i=%d globals.SKYPIAX_INTERFACES[%d].context=%s\n", SKYPIAX_P_LOG, i, i, globals.SKYPIAX_INTERFACES[i].context);
|
||||||
|
DEBUGA_SKYPE("i=%d globals.SKYPIAX_INTERFACES[%d].report_incoming_chatmessages=%d\n", SKYPIAX_P_LOG, i, i, globals.SKYPIAX_INTERFACES[i].report_incoming_chatmessages);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2283,6 +2299,11 @@ int incoming_chatmessage(private_t * tech_pvt, int which)
|
|||||||
|
|
||||||
DEBUGA_SKYPE("received CHATMESSAGE on interface %s\n", SKYPIAX_P_LOG, tech_pvt->name);
|
DEBUGA_SKYPE("received CHATMESSAGE on interface %s\n", SKYPIAX_P_LOG, tech_pvt->name);
|
||||||
|
|
||||||
|
if(!tech_pvt->report_incoming_chatmessages){
|
||||||
|
DEBUGA_SKYPE("I will not generate an Event, report_incoming_chatmessages is %d\n", SKYPIAX_P_LOG, tech_pvt->report_incoming_chatmessages);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!zstr(tech_pvt->session_uuid_str)) {
|
if (!zstr(tech_pvt->session_uuid_str)) {
|
||||||
session = switch_core_session_locate(tech_pvt->session_uuid_str);
|
session = switch_core_session_locate(tech_pvt->session_uuid_str);
|
||||||
}
|
}
|
||||||
|
@ -270,6 +270,7 @@ struct private_object {
|
|||||||
|
|
||||||
chatmessage_t chatmessages[MAX_CHATMESSAGES];
|
chatmessage_t chatmessages[MAX_CHATMESSAGES];
|
||||||
chat_t chats[MAX_CHATS];
|
chat_t chats[MAX_CHATS];
|
||||||
|
uint32_t report_incoming_chatmessages;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct private_object private_t;
|
typedef struct private_object private_t;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user