summaryrefslogtreecommitdiff
path: root/db/migrate/20130612120200_add_gateway_defaults.rb
blob: eddba9d5e83f1f9d0266032d36f34d9d72929480 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class AddGatewayDefaults < ActiveRecord::Migration
  def up
    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}>', :class_type => 'String')
    GsParameter.create(:entity => 'sip_gateways', :section => 'settings', :name => 'from_clir',  :value => '"Anonymous" <sip:anonymous@{domain}>', :class_type => 'String')
    GsParameter.create(:entity => 'sip_gateways', :section => 'settings', :name => 'asserted_identity',  :value => '"{caller_id_name}" <sip:{caller_id_number}@{domain}>', :class_type => 'String')
    GsParameter.create(:entity => 'sip_gateways', :section => 'settings', :name => 'asserted_identity_clir',  :value => '"Anonymous" <sip:{caller_id_number}@{domain}>', :class_type => 'String')
  end

  def down
    GsParameter.where(:entity => 'sip_gateways', :section => 'settings').destroy_all
  end
end