diff --git a/sflphone-gtk/src/Makefile.am b/sflphone-gtk/src/Makefile.am index 0f4ed7d1faa047df6257a0f79af7848732c7008f..5947dcd0830475723a046da865e58f49e7c15ce1 100644 --- a/sflphone-gtk/src/Makefile.am +++ b/sflphone-gtk/src/Makefile.am @@ -39,11 +39,12 @@ sflphone_gtk_SOURCES = \ codeclist.c \ timestamp.c \ reqaccount.c \ - addressbook-config.c + addressbook-config.c \ + hooks-config.c noinst_HEADERS = actions.h dbus.h sflnotify.h mainwindow.h calllist.h dialpad.h audioconf.h codeclist.h assistant.h \ callmanager-glue.h errors.h sflphone_const.h configurationmanager-glue.h instance-glue.h menus.h calltab.h calltree.h configwindow.h \ - accountlist.h accountwindow.h marshaller.h sliders.h $(STATUSICON_HEADER) timestamp.h searchfilter.h reqaccount.h addressbook-config.h + accountlist.h accountwindow.h marshaller.h sliders.h $(STATUSICON_HEADER) timestamp.h searchfilter.h reqaccount.h addressbook-config.h hooks-config.h EXTRA_DIST = marshaller.list diff --git a/sflphone-gtk/src/configurationmanager-glue.h b/sflphone-gtk/src/configurationmanager-glue.h index 194b6f27be4b6511492afa23c77d8b40d12f0ba0..7d29e92172ab1c6cba9e07cec330c23b5d26254c 100644 --- a/sflphone-gtk/src/configurationmanager-glue.h +++ b/sflphone-gtk/src/configurationmanager-glue.h @@ -2300,6 +2300,81 @@ org_sflphone_SFLphone_ConfigurationManager_set_addressbook_settings_async (DBusG stuff->userdata = userdata; return dbus_g_proxy_begin_call (proxy, "setAddressbookSettings", org_sflphone_SFLphone_ConfigurationManager_set_addressbook_settings_async_callback, stuff, g_free, dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_INT), IN_settings, G_TYPE_INVALID); } +static +#ifdef G_HAVE_INLINE +inline +#endif +gboolean +org_sflphone_SFLphone_ConfigurationManager_get_hook_settings (DBusGProxy *proxy, GHashTable** OUT_settings, GError **error) + +{ + return dbus_g_proxy_call (proxy, "getHookSettings", error, G_TYPE_INVALID, dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING), OUT_settings, G_TYPE_INVALID); +} + +typedef void (*org_sflphone_SFLphone_ConfigurationManager_get_hook_settings_reply) (DBusGProxy *proxy, GHashTable *OUT_settings, GError *error, gpointer userdata); + +static void +org_sflphone_SFLphone_ConfigurationManager_get_hook_settings_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +{ + DBusGAsyncData *data = (DBusGAsyncData*) user_data; + GError *error = NULL; + GHashTable* OUT_settings; + dbus_g_proxy_end_call (proxy, call, &error, dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING), &OUT_settings, G_TYPE_INVALID); + (*(org_sflphone_SFLphone_ConfigurationManager_get_hook_settings_reply)data->cb) (proxy, OUT_settings, error, data->userdata); + return; +} + +static +#ifdef G_HAVE_INLINE +inline +#endif +DBusGProxyCall* +org_sflphone_SFLphone_ConfigurationManager_get_hook_settings_async (DBusGProxy *proxy, org_sflphone_SFLphone_ConfigurationManager_get_hook_settings_reply callback, gpointer userdata) + +{ + DBusGAsyncData *stuff; + stuff = g_new (DBusGAsyncData, 1); + stuff->cb = G_CALLBACK (callback); + stuff->userdata = userdata; + return dbus_g_proxy_begin_call (proxy, "getHookSettings", org_sflphone_SFLphone_ConfigurationManager_get_hook_settings_async_callback, stuff, g_free, G_TYPE_INVALID); +} +static +#ifdef G_HAVE_INLINE +inline +#endif +gboolean +org_sflphone_SFLphone_ConfigurationManager_set_hook_settings (DBusGProxy *proxy, const GHashTable* IN_settings, GError **error) + +{ + return dbus_g_proxy_call (proxy, "setHookSettings", error, dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING), IN_settings, G_TYPE_INVALID, G_TYPE_INVALID); +} + +typedef void (*org_sflphone_SFLphone_ConfigurationManager_set_hook_settings_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); + +static void +org_sflphone_SFLphone_ConfigurationManager_set_hook_settings_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) +{ + DBusGAsyncData *data = (DBusGAsyncData*) user_data; + GError *error = NULL; + dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); + (*(org_sflphone_SFLphone_ConfigurationManager_set_hook_settings_reply)data->cb) (proxy, error, data->userdata); + return; +} + +static +#ifdef G_HAVE_INLINE +inline +#endif +DBusGProxyCall* +org_sflphone_SFLphone_ConfigurationManager_set_hook_settings_async (DBusGProxy *proxy, const GHashTable* IN_settings, org_sflphone_SFLphone_ConfigurationManager_set_hook_settings_reply callback, gpointer userdata) + +{ + DBusGAsyncData *stuff; + stuff = g_new (DBusGAsyncData, 1); + stuff->cb = G_CALLBACK (callback); + stuff->userdata = userdata; + return dbus_g_proxy_begin_call (proxy, "setHookSettings", org_sflphone_SFLphone_ConfigurationManager_set_hook_settings_async_callback, stuff, g_free, dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING), IN_settings, G_TYPE_INVALID); +} #endif /* defined DBUS_GLIB_CLIENT_WRAPPERS_org_sflphone_SFLphone_ConfigurationManager */ G_END_DECLS diff --git a/sflphone-gtk/src/configwindow.c b/sflphone-gtk/src/configwindow.c index 81063f99aa69c8020d0464c99f56a06df48b6b4e..43bb009ea6c9f42be31192e6a8813c83093c6c53 100644 --- a/sflphone-gtk/src/configwindow.c +++ b/sflphone-gtk/src/configwindow.c @@ -29,6 +29,7 @@ #include <mainwindow.h> #include <audioconf.h> #include <addressbook-config.h> +#include <hooks-config.h> #include <stdlib.h> #include <stdio.h> @@ -781,6 +782,11 @@ show_config_window () gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Address Book"))); gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab); + // HookS tab + tab = create_hooks_settings(); + gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Hooks"))); + gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab); + gtk_notebook_set_current_page( GTK_NOTEBOOK( notebook) , 1); result = gtk_dialog_run(dialog); @@ -856,5 +862,6 @@ void config_window_set_stun_visible() void save_configuration_parameters (void) { addressbook_save_parameters (); + hooks_save_parameters (); } diff --git a/sflphone-gtk/src/dbus.c b/sflphone-gtk/src/dbus.c index 45b9285619c32f0b4bdbe6632c08509d5d5dac0c..a0f3189585c84d87d07453b2d14b3e27d494c398 100644 --- a/sflphone-gtk/src/dbus.c +++ b/sflphone-gtk/src/dbus.c @@ -1478,4 +1478,31 @@ void dbus_set_addressbook_settings (GHashTable * settings){ } } +GHashTable* dbus_get_hook_settings (void) { + + GError *error = NULL; + GHashTable *results = NULL; + + //g_print ("Calling org_sflphone_SFLphone_ConfigurationManager_get_addressbook_settings\n"); + + org_sflphone_SFLphone_ConfigurationManager_get_hook_settings (configurationManagerProxy, &results, &error); + if (error){ + g_print ("Error calling org_sflphone_SFLphone_ConfigurationManager_get_hook_settings\n"); + g_error_free (error); + } + + return results; +} + +void dbus_set_hook_settings (GHashTable * settings){ + + GError *error = NULL; + + org_sflphone_SFLphone_ConfigurationManager_set_hook_settings (configurationManagerProxy, settings, &error); + if (error){ + g_print ("Error calling org_sflphone_SFLphone_ConfigurationManager_set_hook_settings\n"); + g_error_free (error); + } +} + diff --git a/sflphone-gtk/src/dbus.h b/sflphone-gtk/src/dbus.h index 7eac089d8ae3d9768301b2ac134e5cb77e10eb4f..946c65486186c9103c73ed52e70c589223bb1814 100644 --- a/sflphone-gtk/src/dbus.h +++ b/sflphone-gtk/src/dbus.h @@ -458,6 +458,18 @@ GHashTable* dbus_get_addressbook_settings (void); */ void dbus_set_addressbook_settings (GHashTable *); +/** + * Encapsulate all the url hook-related configuration + * Get the configuration + */ +GHashTable* dbus_get_hook_settings (void); + +/** + * Encapsulate all the url hook-related configuration + * Set the configuration + */ +void dbus_set_hook_settings (GHashTable *); + diff --git a/sflphone-gtk/src/hooks-config.c b/sflphone-gtk/src/hooks-config.c new file mode 100644 index 0000000000000000000000000000000000000000..56c034d4b0cb32eef02ebc2ee7dcb28890ebe3c4 --- /dev/null +++ b/sflphone-gtk/src/hooks-config.c @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2009 Savoir-Faire Linux inc. + * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "hooks-config.h" + +URLHook_Config *_urlhook_config; + +GtkWidget *field, *command; + +void hooks_load_parameters (URLHook_Config** settings){ + + GHashTable *_params = NULL; + URLHook_Config *_settings; + + // Allocate a struct + _settings = g_new0 (URLHook_Config, 1); + + // Fetch the settings from D-Bus + _params = (GHashTable*) dbus_get_hook_settings (); + + if (_params == NULL) { + _settings->sip_field = DEFAULT_SIP_URL_FIELD; + _settings->command = DEFAULT_URL_COMMAND; + } + else { + _settings->sip_field = (gchar*)(g_hash_table_lookup (_params, URLHOOK_SIP_FIELD)); + _settings->command = (gchar*)(g_hash_table_lookup (_params, URLHOOK_COMMAND)); + } + + *settings = _settings; +} + + +void hooks_save_parameters (void){ + + GHashTable *params = NULL; + + params = g_hash_table_new (NULL, g_str_equal); + g_hash_table_replace (params, (gpointer)URLHOOK_SIP_FIELD, + g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(field)))); + g_hash_table_replace (params, (gpointer)URLHOOK_COMMAND, + g_strdup((gchar *)gtk_entry_get_text(GTK_ENTRY(command)))); + + dbus_set_hook_settings (params); + + // Decrement the reference count + g_hash_table_unref (params); + +} + + +GtkWidget* create_hooks_settings (){ + + GtkWidget *ret, *url_frame, *table, *label; + + // Load the user value + hooks_load_parameters (&_urlhook_config); + + ret = gtk_vbox_new(FALSE, 10); + gtk_container_set_border_width(GTK_CONTAINER(ret), 10); + + url_frame = gtk_frame_new(_("URL argument")); + gtk_box_pack_start(GTK_BOX(ret), url_frame, FALSE, FALSE, 0); + gtk_widget_show (url_frame); + + table = gtk_table_new ( 2, 2 , FALSE/* homogeneous */); + gtk_table_set_row_spacings( GTK_TABLE(table), 10); + gtk_table_set_col_spacings( GTK_TABLE(table), 10); + gtk_widget_show(table); + gtk_container_add( GTK_CONTAINER (url_frame) , table ); + + label = gtk_label_new_with_mnemonic (_("_SIP Field name: ")); + gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + field = gtk_entry_new (); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), field); + gtk_entry_set_text(GTK_ENTRY(field), _urlhook_config->sip_field); + gtk_table_attach ( GTK_TABLE( table ), field, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + label = gtk_label_new_with_mnemonic (_("_Command: ")); + gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + command = gtk_entry_new (); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), command); + gtk_entry_set_text(GTK_ENTRY(command), _urlhook_config->command); + gtk_table_attach ( GTK_TABLE( table ), command, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + + gtk_widget_show_all(ret); + + return ret; +} diff --git a/sflphone-gtk/src/hooks-config.h b/sflphone-gtk/src/hooks-config.h new file mode 100644 index 0000000000000000000000000000000000000000..d5f3dcbb36a6f044fc592fabcfa945da0617631d --- /dev/null +++ b/sflphone-gtk/src/hooks-config.h @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2009 Savoir-Faire Linux inc. + * Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef _HOOKS_CONFIG +#define _HOOKS_CONFIG + +#include <gtk/gtk.h> +#include <glib/gtypes.h> + +#include "actions.h" + +G_BEGIN_DECLS + +#define DEFAULT_SIP_URL_FIELD "X-Call-Url" +#define DEFAULT_URL_COMMAND "x-www-browser" +#define URLHOOK_COMMAND "URLHOOK_COMMAND" +#define URLHOOK_SIP_FIELD "URLHOOK_SIP_FIELD" + + +typedef struct _URLHook_Config { + gchar *sip_field; + gchar *command; +}URLHook_Config; + +/** + * Save the parameters through D-BUS + */ +void hooks_save_parameters (void); + +void hooks_load_parameters (URLHook_Config** settings); + +GtkWidget* create_hooks_settings (); + +G_END_DECLS + +#endif // _HOOKS_CONFIG diff --git a/src/dbus/configurationmanager-glue.h b/src/dbus/configurationmanager-glue.h index 3c9eacbf7a2558bafadec844bb1056c7939a9211..04be0e595d1cbd39097ba114fc4973ba708ef5e2 100644 --- a/src/dbus/configurationmanager-glue.h +++ b/src/dbus/configurationmanager-glue.h @@ -81,6 +81,8 @@ public: register_method(ConfigurationManager_adaptor, isStunEnabled, _isStunEnabled_stub); register_method(ConfigurationManager_adaptor, getAddressbookSettings, _getAddressbookSettings_stub); register_method(ConfigurationManager_adaptor, setAddressbookSettings, _setAddressbookSettings_stub); + register_method(ConfigurationManager_adaptor, getHookSettings, _getHookSettings_stub); + register_method(ConfigurationManager_adaptor, setHookSettings, _setHookSettings_stub); } ::DBus::IntrospectedInterface *const introspect() const @@ -385,6 +387,16 @@ public: { "settings", "a{si}", true }, { 0, 0, 0 } }; + static ::DBus::IntrospectedArgument getHookSettings_args[] = + { + { "settings", "a{ss}", false }, + { 0, 0, 0 } + }; + static ::DBus::IntrospectedArgument setHookSettings_args[] = + { + { "settings", "a{ss}", true }, + { 0, 0, 0 } + }; static ::DBus::IntrospectedArgument parametersChanged_args[] = { { "list", "a{ss}", false }, @@ -462,6 +474,8 @@ public: { "isStunEnabled", isStunEnabled_args }, { "getAddressbookSettings", getAddressbookSettings_args }, { "setAddressbookSettings", setAddressbookSettings_args }, + { "getHookSettings", getHookSettings_args }, + { "setHookSettings", setHookSettings_args }, { 0, 0 } }; static ::DBus::IntrospectedMethod ConfigurationManager_adaptor_signals[] = @@ -557,6 +571,8 @@ public: virtual int32_t isStunEnabled() = 0; virtual std::map< std::string, int32_t > getAddressbookSettings() = 0; virtual void setAddressbookSettings(const std::map< std::string, int32_t >& settings) = 0; + virtual std::map< std::string, std::string > getHookSettings() = 0; + virtual void setHookSettings(const std::map< std::string, std::string >& settings) = 0; public: @@ -1165,6 +1181,25 @@ private: ::DBus::ReturnMessage reply(call); return reply; } + ::DBus::Message _getHookSettings_stub(const ::DBus::CallMessage &call) + { + ::DBus::MessageIter ri = call.reader(); + + std::map< std::string, std::string > argout1 = getHookSettings(); + ::DBus::ReturnMessage reply(call); + ::DBus::MessageIter wi = reply.writer(); + wi << argout1; + return reply; + } + ::DBus::Message _setHookSettings_stub(const ::DBus::CallMessage &call) + { + ::DBus::MessageIter ri = call.reader(); + + std::map< std::string, std::string > argin1; ri >> argin1; + setHookSettings(argin1); + ::DBus::ReturnMessage reply(call); + return reply; + } }; } } } diff --git a/src/dbus/configurationmanager-introspec.xml b/src/dbus/configurationmanager-introspec.xml index 6f897c2c2a0fd1082fa27fd4534bc3ac34f3c45c..8d70715421349075ee286676f699ba19fd546157 100644 --- a/src/dbus/configurationmanager-introspec.xml +++ b/src/dbus/configurationmanager-introspec.xml @@ -251,6 +251,15 @@ <arg type="a{si}" name="settings" direction="in"/> </method> + <!-- Hook configuration --> + <method name="getHookSettings"> + <arg type="a{ss}" name="settings" direction="out"/> + </method> + + <method name="setHookSettings"> + <arg type="a{ss}" name="settings" direction="in"/> + </method> + <!-- ///////////////////////////// --> <signal name="parametersChanged"> <arg type="a{ss}" name="list" direction="out"/> diff --git a/src/dbus/configurationmanager.cpp b/src/dbus/configurationmanager.cpp index ac26ec4a42491e654ec61ef4e14c1aad2a207382..78a6a490a7d23521a3afac2bae6c8275aa1c3821 100644 --- a/src/dbus/configurationmanager.cpp +++ b/src/dbus/configurationmanager.cpp @@ -433,3 +433,11 @@ std::map<std::string, int32_t> ConfigurationManager::getAddressbookSettings (voi void ConfigurationManager::setAddressbookSettings (const std::map<std::string, int32_t>& settings) { Manager::instance().setAddressbookSettings (settings); } + +std::map<std::string,std::string> ConfigurationManager::getHookSettings (void) { + return Manager::instance().getHookSettings (); +} + +void ConfigurationManager::setHookSettings (const std::map<std::string, std::string>& settings) { + Manager::instance().setHookSettings (settings); +} diff --git a/src/dbus/configurationmanager.h b/src/dbus/configurationmanager.h index ebbc728d1d99807b4f7d106f2fd8033af4d3d6d6..82a962728fe00324127831dcc6ae96fbd8565cc6 100644 --- a/src/dbus/configurationmanager.h +++ b/src/dbus/configurationmanager.h @@ -107,6 +107,9 @@ public: std::map<std::string, int32_t> getAddressbookSettings (void); void setAddressbookSettings (const std::map<std::string, int32_t>& settings); + std::map<std::string, std::string> getHookSettings (void); + void setHookSettings (const std::map<std::string, std::string>& settings); + }; diff --git a/src/global.h b/src/global.h index 334c18edfe4abf704b1b3d34a776da6bbd966e0f..719f7e4238ced7de729b9a2c817bd8ce512161a8 100644 --- a/src/global.h +++ b/src/global.h @@ -135,4 +135,8 @@ static const SOUND_FORMAT INT32 = 0x8; #define DEFAULT_SIP_PORT 5060 +#define HOOK_DEFAULT_SIP_FIELD "X-Call-url" +#define HOOK_DEFAULT_URL_COMMAND "x-www-browser" + + #endif // __GLOBAL_H__ diff --git a/src/managerimpl.cpp b/src/managerimpl.cpp index 3978225bdb8368d6de6884f9a031218109bb1257..0a946e221b2db81c6ecf199b1babcf073a4c74aa 100644 --- a/src/managerimpl.cpp +++ b/src/managerimpl.cpp @@ -1187,6 +1187,10 @@ ManagerImpl::initConfigFile ( bool load_user_value ) fill_config_int (ADDRESSBOOK_DISPLAY_PHONE_HOME, NO_STR); fill_config_int (ADDRESSBOOK_DISPLAY_PHONE_MOBILE, NO_STR); + section = HOOKS; + fill_config_str (URLHOOK_SIP_FIELD, HOOK_DEFAULT_SIP_FIELD); + fill_config_str (URLHOOK_COMMAND, HOOK_DEFAULT_URL_COMMAND); + // Loads config from ~/.sflphone/sflphonedrc or so.. if (createSettingsPath() == 1 && load_user_value) { _exist = _config.populateFromFile(_path); @@ -2541,6 +2545,29 @@ void ManagerImpl::setAddressbookSettings (const std::map<std::string, int32_t>& saveConfig (); } + +std::map<std::string, std::string> ManagerImpl::getHookSettings () { + + std::map<std::string, std::string> settings; + + settings.insert (std::pair<std::string, std::string> ("URLHOOK_SIP_FIELD", getConfigString (HOOKS, URLHOOK_SIP_FIELD)) ); + settings.insert (std::pair<std::string, std::string> ("URLHOOK_COMMAND", getConfigString (HOOKS, URLHOOK_COMMAND)) ); + + return settings; +} + +void ManagerImpl::setHookSettings (const std::map<std::string, std::string>& settings){ + + setConfig(HOOKS, URLHOOK_SIP_FIELD, (*settings.find("URLHOOK_SIP_FIELD")).second); + setConfig(HOOKS, URLHOOK_COMMAND, (*settings.find("URLHOOK_COMMAND")).second); + + // Write it to the configuration file + saveConfig (); +} + + + + void ManagerImpl::check_call_configuration (const CallID& id, const std::string &to, Call::CallConfiguration *callConfig) { std::string pattern; Call::CallConfiguration config; diff --git a/src/managerimpl.h b/src/managerimpl.h index c9c919d77b7a4dcf1c7f51b022bc507af12e08c9..d36e291400483a487b553ed792692991fe6d2e02 100644 --- a/src/managerimpl.h +++ b/src/managerimpl.h @@ -565,6 +565,17 @@ class ManagerImpl { * Addressbook configuration */ void setAddressbookSettings (const std::map<std::string, int32_t>& settings); + + /** + * Hook configuration + */ + std::map<std::string, std::string> getHookSettings (void); + + /** + * Hook configuration + */ + void setHookSettings (const std::map<std::string, std::string>& settings); + /** * Get the audio manager diff --git a/src/user_cfg.h b/src/user_cfg.h index 62bb5579e7676c4efac340749324a751bae83de1..6b078eee51cd0e7dd50a1f4f68086f2d4a8bb2d0 100644 --- a/src/user_cfg.h +++ b/src/user_cfg.h @@ -78,6 +78,10 @@ #define ADDRESSBOOK_DISPLAY_PHONE_HOME "Addressbook.phone_home" #define ADDRESSBOOK_DISPLAY_PHONE_MOBILE "Addressbook.phone_mobile" +#define HOOKS "Hooks" /** Hooks section */ +#define URLHOOK_SIP_FIELD "Hooks.url_sip_field" +#define URLHOOK_COMMAND "Hooks.url_command" + #define EMPTY_FIELD "" /** Default value for empty field */ #define DFT_STUN_SERVER "stun.fwdnet.net:3478" /** Default STUN server address */ #define YES_STR "1" /** Default YES value */