summaryrefslogtreecommitdiff
path: root/lib/freeswitch_event.rb
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-03-14 00:08:51 -0400
committerPeter Kozak <spag@golwen.net>2013-03-14 00:08:51 -0400
commita14a948cce2380ecf5d15d92dad2324ea8d24c65 (patch)
treeba95f70713c5a67585902bf488b47209347a3e13 /lib/freeswitch_event.rb
parentc4062e4bc7e184d442672bc1a230ef8bc3d8d648 (diff)
use GsParameter
Diffstat (limited to 'lib/freeswitch_event.rb')
-rw-r--r--lib/freeswitch_event.rb6
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