summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-18 11:24:31 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-18 11:24:31 +0100
commitd25a009ebe56f669fd0b6e6e8ff579f24368abb7 (patch)
tree4154a7976dfb7e63544285f63d014d14f9d6d73f
parenteaad37485fe59d0306c37cc038dda6d210052910 (diff)
parent76a2cbbeab405f466f0fd53d7da2bf7a2f98e6a3 (diff)
Merge branch 'develop'
-rw-r--r--.gitignore19
-rw-r--r--README.md23
-rw-r--r--app/controllers/config_snom_controller.rb38
-rw-r--r--app/models/tenant.rb14
4 files changed, 60 insertions, 34 deletions
diff --git a/.gitignore b/.gitignore
index bf1d09a..65a18ad 100644
--- a/.gitignore
+++ b/.gitignore
@@ -31,9 +31,7 @@ tmp/
nbproject
Thumbs.db
-
# Extra
-.sass-cache
.livereload
# Dreamweaver added files
@@ -60,18 +58,17 @@ tmp/**/*
# Ignore fixtures. We use factory_girl.
/test/fixtures/*.yml
-ERD.pdf
-ERD.png
-
/vendor/cache
/vendor/bundle
.settings/*
/.idea
# ignore Sass cache:
-/.sass-cache
-tmp/sass-cache
-tmp/cache
+.sass-cache
+/tmp/sass-cache
+/tmp/cache
+
+/public/assets
# directory created by "bundle install --path ." (not needed anyway):
/ruby
@@ -82,7 +79,7 @@ tmp/cache
/tmp
# Images
-public/uploads
+/public/uploads
# Freeswitch
-misc/freeswitch/conf/freeswitch.serial
-misc/freeswitch/scripts/ini/gateway_gateway1.ini
+/misc/freeswitch/conf/freeswitch.serial
+/misc/freeswitch/scripts/ini/gateway_gateway1.ini
diff --git a/README.md b/README.md
index a97ad3b..d0a758d 100644
--- a/README.md
+++ b/README.md
@@ -1,16 +1,29 @@
GS5
===
+Gemeinschaft 5 by [AMOOMA GmbH](http://amooma.de) in Germany. It is a FreeSWITCH and Ruby on Rails based PBX. This Github repository is our development environment.
-Gemeinschaft 5 by the [AMOOMA GmbH](http://amooma.de) in Germany. It is a FreeSWITCH and Ruby on Rails based PBX.
+Bug reports
+===========
+Please open a new issue to report a bug. Please don't forget to include the URL in case you report a view related problem.
+
+Feature requests
+================
+Please open a new issue and mark it as a feature request.
+
+Roadmap
+=======
+We don't have a public roadmap. But we do track the future work with issues. So have a look at [https://github.com/amooma/GS5/issues](https://github.com/amooma/GS5/issues) for future features.
License
=======
-We use this repository to develop and we'd like to invite everybody to add new features or find bugs. There for the repository is not a private one. But the code in this repository is not GPL! Please go to [http://amooma.de/gemeinschaft/gs5](http://amooma.de/gemeinschaft/gs5) for a copy of this software with an other license.
+We use this public repository to develop. Do not use this code on a production system! Do not give away this code to your clients! This code is strictly for development purposes and GS5 is not a GPL project.
+
+DO NOT USE CODE FROM THE CONTENT OF THIS REPOSITORY FOR A PRODUCTION SYSTEM!
-DO NOT USE CODE FROM THIS REPO FOR A PRODUCTION SYSTEM!
+You can download a free and stable version of GS5 for your production system at [http://amooma.de/gemeinschaft/gs5](http://amooma.de/gemeinschaft/gs5).
Development How-to
==================
-There is a master and a develop branch in this repository. If you are familiar with [http://nvie.com/posts/a-successful-git-branching-model/](http://nvie.com/posts/a-successful-git-branching-model/) you are good to go. Please send a pull request and an e-mail to stefan.wintermeyer@amooma.de with some info about your code. Regular developer get access to the repository and a closed developer mailinglist.
+There is a master and a develop branch in this repository. If you are familiar with [http://nvie.com/posts/a-successful-git-branching-model/](http://nvie.com/posts/a-successful-git-branching-model/) you are good to go. Please send a pull request and an e-mail to stefan.wintermeyer@amooma.de with some info about your code. Regular developer get access to the repository, a closed developer mailinglist and hardware in case they need it.
-We only accept code which was written 100% by you and were you grant us the rights for this code. \ No newline at end of file
+We only accept code which was written 100% by you and were you grant us the rights for the code. \ No newline at end of file
diff --git a/app/controllers/config_snom_controller.rb b/app/controllers/config_snom_controller.rb
index 40f0c4e..74a117d 100644
--- a/app/controllers/config_snom_controller.rb
+++ b/app/controllers/config_snom_controller.rb
@@ -2,17 +2,17 @@ class ConfigSnomController < ApplicationController
MAX_SIP_ACCOUNTS_COUNT = 11
MAX_SOFTKEYS_COUNT = 12 + (42 * 3) - 1
MAX_DIRECTORY_ENTRIES = 20
- KEYPAD_TO_CHAR = {
- '0' => [' ','-','.',',','0'],
- '1' => [' ','-','.',',','1'],
- '2' => ['a','b','c','2'],
- '3' => ['d','e','f','3'],
- '4' => ['g','h','i','4'],
- '5' => ['j','k','l','5'],
- '6' => ['m','n','o','6'],
- '7' => ['p','q','r','s','7'],
- '8' => ['t','u','v','8'],
- '9' => ['w','x','y','z','9'],
+ KEY_REGEXP = {
+ '0' => "[ -.,_0]+",
+ '1' => "[ -.,_1]+",
+ '2' => "[abc2]",
+ '3' => "[def3]",
+ '4' => "[ghi4]",
+ '5' => "[jkl5]",
+ '6' => "[mno6]",
+ '7' => "[pqrs7]",
+ '8' => "[tuv8]",
+ '9' => "[wxyz9]",
}
skip_authorization_check
@@ -727,6 +727,14 @@ AAAA'
:softkeys => [],
}
+ key_regexp = ''
+ if !@dialpad_keys.blank?
+ @dialpad_keys.to_s.each_char do |dialpad_key|
+ key_regexp.concat(KEY_REGEXP[dialpad_key].to_s)
+ end
+ key_regexp = '^' + key_regexp
+ end
+
phone_books = Array.new()
phone_books = phone_books + @sip_account.sip_accountable.try(:phone_books).all
if @sip_account.sip_accountable.class == User
@@ -738,7 +746,13 @@ AAAA'
phone_book_ids << phone_book.id
end
- PhoneBookEntry.where(:phone_book_id => phone_book_ids).order(:last_name).order(:first_name).limit(MAX_DIRECTORY_ENTRIES).each do |phone_book_entry|
+ if key_regexp.blank?
+ phone_book_entries = PhoneBookEntry.where(:phone_book_id => phone_book_ids).order(:last_name).order(:first_name).limit(MAX_DIRECTORY_ENTRIES)
+ else
+ phone_book_entries = PhoneBookEntry.where(:phone_book_id => phone_book_ids).order(:last_name).order(:first_name).where('last_name REGEXP ? OR first_name REGEXP ? OR organization REGEXP ?', key_regexp, key_regexp, key_regexp).limit(MAX_DIRECTORY_ENTRIES)
+ end
+
+ phone_book_entries.each do |phone_book_entry|
if phone_book_entry.phone_numbers.count > 1
@phone_xml_object[:entries] << { :text => phone_book_entry.to_s, :number => phone_book_entry.phone_numbers.first }
end
diff --git a/app/models/tenant.rb b/app/models/tenant.rb
index 6f98603..dda94d8 100644
--- a/app/models/tenant.rb
+++ b/app/models/tenant.rb
@@ -223,15 +223,17 @@ class Tenant < ActiveRecord::Base
amooma = general_phone_book.phone_book_entries.create(
:organization => 'AMOOMA GmbH',
:is_organization => true,
- :description => "Hersteller von Gemeinschaft. Rufen Sie uns an, falls Sie kommerziellen Support oder Consulting für Gemeinschaft benötigen.",
- :homepage_organization => 'http://www.amooma.de',
+ :description => "Hersteller von Gemeinschaft. Kommerziellen Support und Consulting für Gemeinschaft.",
+ :homepage_organization => 'http://amooma.de',
:twitter_account => 'amooma_de',
:facebook_account => 'https://www.facebook.com/AMOOMA.GmbH',
)
- amooma.phone_numbers.create(
- :name => 'Office',
- :number => '+492622706480'
- )
+ # This is the new 2013 phone number.
+ #
+ # amooma.phone_numbers.create(
+ # :name => 'Office',
+ # :number => '+4926228998900'
+ # )
amooma.addresses.create(
:street => 'Bachstr. 124',
:zip_code => '56566',