diff options
author | Peter Kozak <spag@golwen.net> | 2013-03-14 00:08:51 -0400 |
---|---|---|
committer | Peter Kozak <spag@golwen.net> | 2013-03-14 00:08:51 -0400 |
commit | a14a948cce2380ecf5d15d92dad2324ea8d24c65 (patch) | |
tree | ba95f70713c5a67585902bf488b47209347a3e13 /lib/freeswitch_event.rb | |
parent | c4062e4bc7e184d442672bc1a230ef8bc3d8d648 (diff) |
use GsParameter
Diffstat (limited to 'lib/freeswitch_event.rb')
-rw-r--r-- | lib/freeswitch_event.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/freeswitch_event.rb b/lib/freeswitch_event.rb index 5f961be..89d8ea0 100644 --- a/lib/freeswitch_event.rb +++ b/lib/freeswitch_event.rb @@ -15,7 +15,11 @@ class FreeswitchEventSocket return false end - def connect(password = DEFAULT_PASSWORD, event_host = DEFAULT_HOST, event_port = DEFAULT_PORT) + def connect(password = nil, event_host = nil, event_port = nil) + event_host = event_host || GsParameter.get('host', 'event_socket', 'client') || GsParameter.get('listen-ip', 'event_socket', 'settings') || DEFAULT_HOST + event_port = event_port || GsParameter.get('port', 'event_socket', 'client') || GsParameter.get('listen-port', 'event_socket', 'settings') || DEFAULT_PORT + password = password || GsParameter.get('password', 'event_socket', 'client') || GsParameter.get('password', 'event_socket', 'settings') || DEFAULT_PASSWORD + begin @socket = TCPSocket.open(event_host, event_port) rescue |