diff options
author | Peter Kozak <spag@golwen.net> | 2013-08-05 07:45:24 +0200 |
---|---|---|
committer | Peter Kozak <spag@golwen.net> | 2013-08-05 07:45:24 +0200 |
commit | d3eddf2d14fb2c41fdf208f21944320677a20b3b (patch) | |
tree | e26c447c77c0ef783c6e19e38c08adcba97b380c /db/migrate | |
parent | 7337f8fe676041999d5e97a99faf668ed6eb7920 (diff) |
default gateway parameters/headers
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20130804201900_add_gateway_default_headers.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/db/migrate/20130804201900_add_gateway_default_headers.rb b/db/migrate/20130804201900_add_gateway_default_headers.rb new file mode 100644 index 0000000..c695589 --- /dev/null +++ b/db/migrate/20130804201900_add_gateway_default_headers.rb @@ -0,0 +1,28 @@ +class AddGatewayDefaultHeaders < ActiveRecord::Migration + def up + GsParameter.where(:entity => 'sip_gateways', :section => 'settings', :name => 'from').destroy_all + GsParameter.where(:entity => 'sip_gateways', :section => 'settings', :name => 'from_clir').destroy_all + GsParameter.where(:entity => 'sip_gateways', :section => 'settings', :name => 'asserted_identity').destroy_all + GsParameter.where(:entity => 'sip_gateways', :section => 'settings', :name => 'asserted_identity_clir').destroy_all + + GsParameter.create(:entity => 'sip_gateways', :section => 'settings', :name => 'dtmf', :value => 'rfc2833', :class_type => 'String') + + GsParameter.create(:entity => 'sip_gateways', :section => 'headers_default', :name => 'INVITE', :value => '"sip:{destination_number}@{domain}', :class_type => 'String') + GsParameter.create(:entity => 'sip_gateways', :section => 'headers_default', :name => 'To', :value => '<sip:{destination_number}@{domain}>', :class_type => 'String') + GsParameter.create(:entity => 'sip_gateways', :section => 'headers_default_clir_off', :name => 'From', :value => '"{caller_id_name}" <sip:{caller_id_number}@{domain_local}>', :class_type => 'String') + GsParameter.create(:entity => 'sip_gateways', :section => 'headers_default_clir_on', :name => 'From', :value => '"Anonymous" <sip:anonymous@{domain_local}>', :class_type => 'String') + GsParameter.create(:entity => 'sip_gateways', :section => 'headers_default_clir_off', :name => 'P-Asserted-Identity', :value => '"{caller_id_name}" <sip:{caller_id_number}@{domain_local}>', :class_type => 'String') + GsParameter.create(:entity => 'sip_gateways', :section => 'headers_default_clir_on', :name => 'P-Asserted-Identity', :value => '"Anonymous" <sip:{caller_id_number}@{domain_local}>', :class_type => 'String') + GsParameter.create(:entity => 'sip_gateways', :section => 'headers_default_clir_on', :name => 'Privacy', :value => 'id', :class_type => 'String') + end + + def down + GsParameter.create(:entity => 'sip_gateways', :section => 'settings', :name => 'domain', :value => '192.168.1.1', :class_type => 'String') + GsParameter.create(:entity => 'sip_gateways', :section => 'settings', :name => 'auth_source', :value => 'sip_received_ip', :class_type => 'String') + GsParameter.create(:entity => 'sip_gateways', :section => 'settings', :name => 'auth_pattern', :value => '^192.168.1.1$', :class_type => 'String') + GsParameter.create(:entity => 'sip_gateways', :section => 'settings', :name => 'from', :value => '"{caller_id_name}" <sip:{caller_id_number}@{domain_local}>', :class_type => 'String') + GsParameter.create(:entity => 'sip_gateways', :section => 'settings', :name => 'from_clir', :value => '"Anonymous" <sip:anonymous@{domain_local}>', :class_type => 'String') + GsParameter.create(:entity => 'sip_gateways', :section => 'settings', :name => 'asserted_identity', :value => '"{caller_id_name}" <sip:{caller_id_number}@{domain_local}>', :class_type => 'String') + GsParameter.create(:entity => 'sip_gateways', :section => 'settings', :name => 'asserted_identity_clir', :value => '"Anonymous" <sip:{caller_id_number}@{domain_local}>', :class_type => 'String') + end +end |