Permalink
Browse files

clean provider gateway - Add port - close #134

  • Loading branch information...
mwolff44
mwolff44 committed Apr 6, 2018
1 parent 3c5e07e commit 827db5b4014f00e7b9e3790fa2eb40e72dc26bfe
View
@@ -97,7 +97,7 @@ Vagrant.configure("2") do |config|
config.ssh.insert_key = false
config.vm.boot_timeout = 240
config.vbguest.auto_update = true
config.vbguest.auto_reboot = true
config.vbguest.installer_arguments = ['--nox11']
#config.vbguest.auto_update = true
#config.vbguest.auto_reboot = true
#config.vbguest.installer_arguments = ['--nox11']
end
View
@@ -97,6 +97,7 @@
'solo',
'django_filters',
'migrate_sql',
'currencies', # A virer
)
PROJECT_APPS = (
@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-04-06 15:32
from __future__ import unicode_literals
from django.db import migrations
import migrate_sql.operations
class Migration(migrations.Migration):
dependencies = [
('customerdirectory', '0017_auto_20180207_1116'),
]
operations = [
migrate_sql.operations.ReverseAlterSQL(
name=b'address_view',
sql=b'DROP VIEW IF EXISTS address CASCADE ',
reverse_sql=b'DROP VIEW IF EXISTS address CASCADE; CREATE OR REPLACE VIEW address AS SELECT row_number() OVER () AS id, * FROM ( SELECT 1 AS grp, CAST(LEFT(CAST(c.sip_ip AS VARCHAR), LENGTH(CAST(c.sip_ip AS VARCHAR)) - 3) AS VARCHAR) AS ip_addr, CAST(RIGHT(CAST(c.sip_ip AS VARCHAR), 2) AS INTEGER) AS mask, CAST(c.sip_port AS INTEGER) AS port, CAST(c.name AS VARCHAR) AS tag FROM customer_directory c WHERE c.enabled=True and c.registration=False UNION ALL SELECT 10 AS grp, CAST(sg.proxy AS VARCHAR) AS ip_addr, 32 AS mask, 5060 AS port, sg.name AS tag FROM sofia_gateway sg WHERE sg.enabled=True and sg.register=False) v;',
),
migrate_sql.operations.AlterSQL(
name=b'address_view',
sql=b'DROP VIEW IF EXISTS address CASCADE; CREATE OR REPLACE VIEW address AS SELECT row_number() OVER () AS id, * FROM ( SELECT 1 AS grp, CAST(LEFT(CAST(c.sip_ip AS VARCHAR), LENGTH(CAST(c.sip_ip AS VARCHAR)) - 3) AS VARCHAR) AS ip_addr, CAST(RIGHT(CAST(c.sip_ip AS VARCHAR), 2) AS INTEGER) AS mask, CAST(c.sip_port AS INTEGER) AS port, CAST(c.name AS VARCHAR) AS tag FROM customer_directory c WHERE c.enabled=True and c.registration=False UNION ALL SELECT 10 AS grp, CAST(sg.proxy AS VARCHAR) AS ip_addr, 32 AS mask, CAST(sg.sip_port AS INTEGER) AS port, sg.name AS tag FROM sofia_gateway sg WHERE sg.enabled=True and sg.register=False) v;',
reverse_sql=b'DROP VIEW IF EXISTS address CASCADE ',
),
]
@@ -50,7 +50,7 @@
' 10 AS grp,'
' CAST(sg.proxy AS VARCHAR) AS ip_addr,'
' 32 AS mask,'
' 5060 AS port,'
' CAST(sg.sip_port AS INTEGER) AS port,'
' sg.name AS tag '
'FROM sofia_gateway sg '
'WHERE sg.enabled=True and sg.register=False) v;'
@@ -818,22 +818,19 @@ def has_change_permission(self, request, obj=None):
class SofiaGatewayAdmin(admin.ModelAdmin):
list_display = ['name',
'sip_profile',
'company',
'channels',
'proxy',
'transport',
'sip_port',
'get_enabled_display',
'get_register_display',
'date_added',
'date_modified']
ordering = ['company',
'name',
'proxy']
list_filter = ['company',
'proxy',
'enabled',
'sip_profile']
'enabled']
search_fields = ['^company__name',
'proxy']
# actions = [sofiaupdate]
@@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-04-06 15:31
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pyfreebill', '0020_auto_20180406_1708'),
]
operations = [
migrations.RemoveField(
model_name='sofiagateway',
name='sip_profile',
),
migrations.AddField(
model_name='sofiagateway',
name='sip_port',
field=models.PositiveIntegerField(default=b'5060', help_text='Gateway SIP port (Default 5060).', verbose_name='SIP port'),
),
migrations.AlterField(
model_name='sofiagateway',
name='sip_cid_type',
field=models.CharField(choices=[(b'none', 'none'), (b'default', 'default'), (b'pid', 'pid'), (b'rpid', 'P-Asserted-Identity')], default=b'rpid', help_text='Modify callerID in SIP\n Headers.', max_length=10, verbose_name='SIP CID type'),
),
]
@@ -1419,11 +1419,6 @@ class SofiaGateway(models.Model):
verbose_name=_(u"SIP domain"),
help_text=_(u"""A gateway must belong to a domain.
This domain must be used in SIP message"""))
sip_profile = models.ForeignKey('SipProfile',
verbose_name=_(u"SIP profile"),
help_text=_(u"""Which Sip Profile
communication with this gateway will
take place on."""))
company = models.ForeignKey(Company,
verbose_name=_(u"Provider"),
db_index=True)
@@ -1491,6 +1486,10 @@ class SofiaGateway(models.Model):
default="udp",
choices=SIP_TRANSPORT_CHOICES,
help_text=_(u"Which transport to use for register"))
sip_port = models.PositiveIntegerField(
_(u"""SIP port"""),
default="5060",
help_text=_(u"""Gateway SIP port (Default 5060)."""))
extension = models.CharField(_(u"extension number"),
max_length=50,
blank=True,
@@ -1529,13 +1528,13 @@ class SofiaGateway(models.Model):
('none', _(u'none')),
('default', _(u'default')),
('pid', _(u'pid')),
('rpid', _(u'rpid')),
('rpid', _(u'P-Asserted-Identity')),
)
sip_cid_type = models.CharField(_(u'SIP CID type'),
max_length=10,
choices=SIP_CID_TYPE_CHOICES,
default='rpid',
help_text=_(u"""Modify callerID in SDP
help_text=_(u"""Modify callerID in SIP
Headers."""))
date_added = models.DateTimeField(_(u'date added'),
auto_now_add=True)
View
@@ -73,6 +73,12 @@ django-countries==5.1.1
# py3
django-crispy-forms==1.7.0
# Currencies management
# https://github.com/panosl/django-currencies/
# BSD
# py3
django-currencies==0.4.0
# widget for DateField, Timefiled and DateTimeField in Django framework.
# https://github.com/asaglimbeni/django-datetime-widget/
# BSD
View
@@ -20,6 +20,7 @@ django-braces==1.12.0
django-chroniker==1.0.10
django-countries==5.1.1
django-crispy-forms==1.7.0
django-currencies==0.4.0
django-datetime-widget==0.9.3
django-extensions==1.9.9
django-filter==1.1.0
View
@@ -22,6 +22,7 @@ django-braces==1.12.0
django-chroniker==1.0.10
django-countries==5.1.1
django-crispy-forms==1.7.0
django-currencies==0.4.0
django-datetime-widget==0.9.3
django-debug-toolbar==1.9.1
django-extensions==1.9.9
View
@@ -20,6 +20,7 @@ django-braces==1.12.0
django-chroniker==1.0.10
django-countries==5.1.1
django-crispy-forms==1.7.0
django-currencies==0.4.0
django-datetime-widget==0.9.3
django-extensions==1.9.9
django-filter==1.1.0

0 comments on commit 827db5b

Please sign in to comment.