├── nway_ac
├── .idea
│ ├── .name
│ ├── scopes
│ │ └── scope_settings.xml
│ ├── encodings.xml
│ ├── vcs.xml
│ ├── dataSources.ids
│ ├── modules.xml
│ ├── misc.xml
│ ├── dataSources.xml
│ ├── nway_ac.iml
│ └── workspace.xml
├── nway_ac
│ ├── __init__.py
│ ├── urls.pyc
│ ├── wsgi.pyc
│ ├── __init__.pyc
│ ├── settings.pyc
│ ├── wsgi.py
│ ├── urls.py
│ └── settings.py
├── ac_manager
│ ├── __init__.py
│ ├── migrations
│ │ ├── __init__.py
│ │ └── __init__.pyc
│ ├── tests.py
│ ├── views.py
│ ├── admin.pyc
│ ├── models.pyc
│ ├── __init__.pyc
│ ├── storage.pyc
│ ├── storage.py
│ ├── admin.py
│ └── models.py
├── uploads
│ └── rings
│ │ └── 20150621195412_73.wav
└── manage.py
├── todo.md
├── docs
└── nway_ac简易操作手册.docx
├── fs_ac
├── events.py
├── server.py
├── Makefile
├── single_command.py
├── python-config
├── ESL.py
└── nway_ac.py
├── README.md
└── db
└── nway_ac.sql
/nway_ac/.idea/.name:
--------------------------------------------------------------------------------
1 | nway_ac
--------------------------------------------------------------------------------
/nway_ac/nway_ac/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/nway_ac/ac_manager/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/nway_ac/ac_manager/migrations/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/todo.md:
--------------------------------------------------------------------------------
1 | 1. 针对“精准”式外呼的设计实现。
2 | 2. 坐席管理及排队机
3 |
--------------------------------------------------------------------------------
/docs/nway_ac简易操作手册.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nwaycn/nway_ac/HEAD/docs/nway_ac简易操作手册.docx
--------------------------------------------------------------------------------
/nway_ac/nway_ac/urls.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nwaycn/nway_ac/HEAD/nway_ac/nway_ac/urls.pyc
--------------------------------------------------------------------------------
/nway_ac/nway_ac/wsgi.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nwaycn/nway_ac/HEAD/nway_ac/nway_ac/wsgi.pyc
--------------------------------------------------------------------------------
/nway_ac/ac_manager/tests.py:
--------------------------------------------------------------------------------
1 | from django.test import TestCase
2 |
3 | # Create your tests here.
4 |
--------------------------------------------------------------------------------
/nway_ac/ac_manager/views.py:
--------------------------------------------------------------------------------
1 | from django.shortcuts import render
2 |
3 | # Create your views here.
4 |
--------------------------------------------------------------------------------
/nway_ac/ac_manager/admin.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nwaycn/nway_ac/HEAD/nway_ac/ac_manager/admin.pyc
--------------------------------------------------------------------------------
/nway_ac/ac_manager/models.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nwaycn/nway_ac/HEAD/nway_ac/ac_manager/models.pyc
--------------------------------------------------------------------------------
/nway_ac/nway_ac/__init__.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nwaycn/nway_ac/HEAD/nway_ac/nway_ac/__init__.pyc
--------------------------------------------------------------------------------
/nway_ac/nway_ac/settings.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nwaycn/nway_ac/HEAD/nway_ac/nway_ac/settings.pyc
--------------------------------------------------------------------------------
/nway_ac/ac_manager/__init__.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nwaycn/nway_ac/HEAD/nway_ac/ac_manager/__init__.pyc
--------------------------------------------------------------------------------
/nway_ac/ac_manager/storage.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nwaycn/nway_ac/HEAD/nway_ac/ac_manager/storage.pyc
--------------------------------------------------------------------------------
/nway_ac/ac_manager/migrations/__init__.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nwaycn/nway_ac/HEAD/nway_ac/ac_manager/migrations/__init__.pyc
--------------------------------------------------------------------------------
/nway_ac/uploads/rings/20150621195412_73.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nwaycn/nway_ac/HEAD/nway_ac/uploads/rings/20150621195412_73.wav
--------------------------------------------------------------------------------
/nway_ac/.idea/scopes/scope_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/nway_ac/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/nway_ac/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/nway_ac/manage.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | import os
3 | import sys
4 |
5 | if __name__ == "__main__":
6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "nway_ac.settings")
7 |
8 | from django.core.management import execute_from_command_line
9 |
10 | execute_from_command_line(sys.argv)
11 |
--------------------------------------------------------------------------------
/nway_ac/.idea/dataSources.ids:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/nway_ac/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/nway_ac/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/fs_ac/events.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | import string
4 | import sys
5 |
6 | from ESL import *
7 |
8 | con = ESLconnection("localhost","8021","ClueCon")
9 | #are we connected?
10 |
11 | if con.connected:
12 |
13 | con.events("plain", "all");
14 |
15 | while 1:
16 | #my $e = $con->recvEventTimed(100);
17 | e = con.recvEvent()
18 |
19 | if e:
20 | print e.serialize()
21 |
--------------------------------------------------------------------------------
/nway_ac/nway_ac/wsgi.py:
--------------------------------------------------------------------------------
1 | """
2 | WSGI config for nway_ac project.
3 |
4 | It exposes the WSGI callable as a module-level variable named ``application``.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
8 | """
9 |
10 | import os
11 |
12 | from django.core.wsgi import get_wsgi_application
13 |
14 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "nway_ac.settings")
15 |
16 | application = get_wsgi_application()
17 |
--------------------------------------------------------------------------------
/nway_ac/.idea/dataSources.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | postgresql
6 | org.postgresql.Driver
7 | jdbc:postgresql://127.0.0.1:5432/nway_ac
8 | postgres
9 | dfc4dfdddfcbdfd3dff5df98df9adf9bdf9fdfebdfc4dfce
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/fs_ac/server.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | import SocketServer
4 | from ESL import *
5 |
6 | class ESLRequestHandler(SocketServer.BaseRequestHandler ):
7 | def setup(self):
8 | print self.client_address, 'connected!'
9 |
10 | fd = self.request.fileno()
11 | print fd
12 |
13 | con = ESLconnection(fd)
14 | print "Connected: "
15 | print con.connected()
16 | if con.connected():
17 |
18 | info = con.getInfo()
19 |
20 | uuid = info.getHeader("unique-id")
21 | print uuid
22 | con.execute("answer", "", uuid)
23 | con.execute("playback", "/ram/swimp.raw", uuid);
24 |
25 | #server host is a tuple ('host', port)
26 | server = SocketServer.ThreadingTCPServer(('', 8040), ESLRequestHandler)
27 | server.serve_forever()
28 |
29 |
30 |
--------------------------------------------------------------------------------
/nway_ac/.idea/nway_ac.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/fs_ac/Makefile:
--------------------------------------------------------------------------------
1 | LOCAL_CFLAGS=`python ./python-config --includes`
2 | LOCAL_LDFLAGS=`python ./python-config --ldflags`
3 | SITE_DIR=$(DESTDIR)/`python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"`
4 |
5 | all: _ESL.so
6 |
7 | esl_wrap.cpp:
8 | swig -module ESL -classic -python -c++ -DMULTIPLICITY -threads -I../src/include -o esl_wrap.cpp ../ESL.i
9 |
10 | esl_wrap.o: esl_wrap.cpp
11 | $(CXX) $(CXX_CFLAGS) $(CXXFLAGS) $(LOCAL_CFLAGS) -c esl_wrap.cpp -o esl_wrap.o
12 |
13 | _ESL.so: esl_wrap.o
14 | $(CXX) $(SOLINK) esl_wrap.o $(MYLIB) $(LOCAL_LDFLAGS) -o _ESL.so -L. $(LIBS)
15 |
16 | install: _ESL.so
17 | install -m 755 _ESL.so $(SITE_DIR)
18 | install -m 755 ESL.py $(SITE_DIR)
19 |
20 | clean:
21 | rm -f *.o *.so *~
22 |
23 | swigclean:
24 | rm -f esl_wrap.* ESL.so
25 |
26 | reswig: swigclean esl_wrap.cpp
27 |
28 |
--------------------------------------------------------------------------------
/nway_ac/nway_ac/urls.py:
--------------------------------------------------------------------------------
1 | """nway_ac URL Configuration
2 |
3 | The `urlpatterns` list routes URLs to views. For more information please see:
4 | https://docs.djangoproject.com/en/1.8/topics/http/urls/
5 | Examples:
6 | Function views
7 | 1. Add an import: from my_app import views
8 | 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
9 | Class-based views
10 | 1. Add an import: from other_app.views import Home
11 | 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
12 | Including another URLconf
13 | 1. Add an import: from blog import urls as blog_urls
14 | 2. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls))
15 | """
16 | from django.conf.urls import include, url
17 | from django.contrib import admin
18 | admin.autodiscover()
19 | urlpatterns = [
20 | url(r'^admin/', include(admin.site.urls)),
21 | ]
22 |
--------------------------------------------------------------------------------
/fs_ac/single_command.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | import string
4 | import sys
5 | from optparse import OptionParser
6 | from ESL import *
7 |
8 |
9 |
10 | def main(argv):
11 |
12 | try:
13 |
14 | parser = OptionParser()
15 | parser.add_option("-a", "--auth", dest="auth", default="ClueCon",
16 | help="ESL password")
17 | parser.add_option("-s", "--server", dest="server", default="127.0.0.1",
18 | help="FreeSWITCH server IP address")
19 | parser.add_option("-p", "--port", dest="port", default="8021",
20 | help="FreeSWITCH server event socket port")
21 | parser.add_option("-c", "--command", dest="command",
22 | help="command to run, surround mutli word commands in \"\'s")
23 |
24 | (options, args) = parser.parse_args()
25 |
26 |
27 | con = ESLconnection(options.server, options.port, options.auth)
28 | #are we connected?
29 |
30 | if con.connected():
31 | #run command
32 | e = con.api(options.command)
33 | print e.getBody()
34 |
35 | else:
36 |
37 | print "Not Connected"
38 | sys.exit(2)
39 |
40 | except:
41 |
42 | print parser.get_usage()
43 |
44 | if __name__ == "__main__":
45 | main(sys.argv[1:])
46 |
--------------------------------------------------------------------------------
/nway_ac/ac_manager/storage.py:
--------------------------------------------------------------------------------
1 | # coding=utf-8
2 | __Author__ = 'lihao,18621575908'
3 | # -*-coding:utf-8 -*-
4 | '''
5 | 版权所有:上海宁卫信息技术有限公司
6 | 功能说明:本程序只适用于落地与落地间消化话费,而不适用于其它骚扰类型的应用
7 | 授权模式:MPL
8 | bug report:lihao@nway.com.cn
9 | '''
10 | from django.core.files.storage import FileSystemStorage
11 | from django.http import HttpResponse
12 | from django.conf import settings
13 | import os, time, random
14 |
15 |
16 |
17 | class FileStorage(FileSystemStorage):
18 | def __init__(self, location=settings.MEDIA_ROOT, base_url=settings.MEDIA_URL):
19 | #初始化
20 | super(FileStorage, self).__init__(location, base_url)
21 |
22 | #重写 _save方法
23 | def _save(self, name, content):
24 | #文件扩展名
25 | ext = os.path.splitext(name)[1]
26 | #文件目录
27 | d = os.path.dirname(name)
28 | #定义文件名,年月日时分秒随机数
29 | fn = time.strftime("%Y%m%d%H%M%S")
30 | fn = fn + "_%d" % random.randint(0,100)
31 | #重写合成文件名
32 | name = os.path.join(d, fn + ext)
33 |
34 | if (ext.lower() == '.csv'):
35 | pass
36 | else:
37 | pass
38 |
39 | #调用父类方法
40 | return super(FileStorage, self)._save(name, content)
41 |
42 |
--------------------------------------------------------------------------------
/nway_ac/ac_manager/admin.py:
--------------------------------------------------------------------------------
1 | # -*-coding:utf-8 -*-
2 | '''
3 | 版权所有:上海宁卫信息技术有限公司
4 | 功能说明:本程序只适用于落地与落地间消化话费,而不适用于其它骚扰类型的应用
5 | 授权模式:MPL
6 | bug report:lihao@nway.com.cn
7 | '''
8 | from django.contrib import admin
9 | from ac_manager.models import *
10 | class BaseConfigAdmin(admin.ModelAdmin):
11 | list_display = ('config_name','config_param')
12 |
13 | class CallRingsAdmin(admin.ModelAdmin):
14 | list_display = ('id', 'ring_name', 'ring_path')
15 | readonly_fields = ('id',)
16 | fields = ('id', 'ring_name', 'ring_path')
17 |
18 | class CalloutNumbersAdmin(admin.ModelAdmin):
19 | list_display = ('id' , 'call_numbers', 'call_timeout', 'call_ring', 'callout_state', 'is_enable')
20 | readonly_fields = ('id',)
21 |
22 | class NwayCallTasksAdmin(admin.ModelAdmin):
23 | list_display = ('id', 'callout_name', 'begin_time', 'stop_time')
24 | readonly_fields = ('id',)
25 |
26 | class TimePlanAdmin(admin.ModelAdmin):
27 | list_display = ('id', 'start_time', 'stop_time')
28 | readonly_fields = ('id',)
29 |
30 |
31 | # Register your models here.
32 | admin.site.register(BaseConfig, BaseConfigAdmin)
33 | admin.site.register(CallRings, CallRingsAdmin)
34 | admin.site.register(CalloutNumbers, CalloutNumbersAdmin)
35 | admin.site.register(NwayCallTasks, NwayCallTasksAdmin)
36 | admin.site.register(TimePlan, TimePlanAdmin)
--------------------------------------------------------------------------------
/fs_ac/python-config:
--------------------------------------------------------------------------------
1 | #! /usr/bin/python2.5
2 |
3 | import sys
4 | import os
5 | import getopt
6 | from distutils import sysconfig
7 |
8 | valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags',
9 | 'ldflags', 'help']
10 |
11 | def exit_with_usage(code=1):
12 | print >>sys.stderr, "Usage: %s [%s]" % (sys.argv[0],
13 | '|'.join('--'+opt for opt in valid_opts))
14 | sys.exit(code)
15 |
16 | try:
17 | opts, args = getopt.getopt(sys.argv[1:], '', valid_opts)
18 | except getopt.error:
19 | exit_with_usage()
20 |
21 | if not opts:
22 | exit_with_usage()
23 |
24 | opt = opts[0][0]
25 |
26 | pyver = sysconfig.get_config_var('VERSION')
27 | getvar = sysconfig.get_config_var
28 |
29 | if opt == '--help':
30 | exit_with_usage(0)
31 |
32 | elif opt == '--prefix':
33 | print sysconfig.PREFIX
34 |
35 | elif opt == '--exec-prefix':
36 | print sysconfig.EXEC_PREFIX
37 |
38 | elif opt in ('--includes', '--cflags'):
39 | flags = ['-I' + sysconfig.get_python_inc(),
40 | '-I' + sysconfig.get_python_inc(plat_specific=True)]
41 | if opt == '--cflags':
42 | flags.extend(getvar('CFLAGS').split())
43 | print ' '.join(flags)
44 |
45 | elif opt in ('--libs', '--ldflags'):
46 | libs = getvar('LIBS').split() + getvar('SYSLIBS').split()
47 | libs.append('-lpython'+pyver)
48 | # add the prefix/lib/pythonX.Y/config dir, but only if there is no
49 | # shared library in prefix/lib/.
50 | if opt == '--ldflags' and not getvar('Py_ENABLE_SHARED'):
51 | libs.insert(0, '-L' + getvar('LIBPL'))
52 | print ' '.join(libs)
53 |
54 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # NWayRtcSDK介绍
2 |
3 | ## iOS版本:
4 |
5 | https://github.com/nwaycn/NWayRtcDemo-IOS
6 |
7 | ## android版本:
8 |
9 | https://github.com/nwaycn/NWayRtcDemo_Android
10 |
11 | ## AMR版本:
12 |
13 | https://github.com/nwaycn/NWayRtcDemo_ARM
14 |
15 |
16 | ## 能力及标准:
17 | ```
18 | 1 支持标准SIP RFC3261协议。多平台支持(andorid,ios. mac ,windows,linux,嵌入式linux arm)。
19 |
20 | 2 音频:
21 | A 支持编码解码格式:ISAC、G722、G711 ,L16,OPUS,ILBC
22 | B 音频前处理3A算法,AEC (Acoustic Echo Cancellation),ANS (Automatic Noise Suppression),AGC (Automatic Gain Control)。
23 | C 支持动态抖动缓冲区和错误隐藏(丢包补偿)算法NetEQ。
24 | D 支持JitterBuff,FEC,NACK。
25 |
26 | 3 视频:
27 | A 支持编码解码格式:VP8,VP9,H264,H265,支持硬件编解码。
28 | B 支持QOS:
29 | NACK、FEC、SVC、JitterBuffer、IDR Request、PACER、Sender Side BWE、VFR(动态帧率调整策略)、AVSync(音视频同步)、动态分辨率调整。
30 |
31 | 4功能:
32 | A:支持单人,多人视频通话,视频会议。
33 | B:支持主流SIP服务器,如:opensips,freeswitch。
34 | C:支持传输原生编码好的音视频数据。
35 | D:支持ICE P2P模式和服务器转发模式。
36 | E:支持移动平台Push Notification,配合我们定制的opensips服务器可以很好的唤醒sdk接受呼叫
37 | F:服务端支持分布式,集群部署。
38 | ```
39 |
40 |
41 | mobile(wechat) +8618621575908
42 |
43 |
44 | 有不少朋友问,我们如何实现cdr呢,那么可以编译时加pg-core条件,且配置cdr_pg让cdr直接记录到postgresql数据库中。
45 |
46 | # nway_ac
47 | 提醒:如果呼的量比较大的话,可以先关掉log或者把log中的debug,info等去掉。没必要的话,把cdr_csv模块也干掉,不然呼的太快,磁盘受不了。
48 |
49 | 一、 说明
50 |
51 | Nway_ac为nway auto call的缩写,主要用于落地间对接时,可能需要产生一定量的话费消耗,故而采用FreeSWITCH作为后端,使用python作为开发及运行语言来实现定向呼叫。
52 |
53 |
54 | 二、 运行环境搭建(centos为例,debian,windows基本类似)
55 |
56 | 1. 以FreeSWITCH 1.2.24为例,不再另行介绍
57 |
58 | 2. 安装python2.7
59 |
60 |
61 | #wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
62 |
63 | #tar zxvf Python-2.7.3.tgz
64 |
65 | #cd Python-2.7.3
66 |
67 | #./configure --prefix=/usr && make && make install
68 |
69 |
70 | 3. curl https://bootstrap.pypa.io/ez_setup.py | python 用于安装easy_install工具
71 |
72 | 4. 安装postgresql,这里不多讲这个数据库安装的用例
73 |
74 | 5. 安装django:# easy_install django
75 |
76 | 6. 安装 psycopg2:#easy_install psycopg2
77 |
78 | 7. 在FreeSWITCH的源码环境下:#cd libs/esl
79 |
80 | #make pymod
81 |
82 | 8. 下载nway_ac #git clone https://github.com/nwaycn/nway_ac.git
83 |
84 | 9. 导入数据库,安装好的预创建数据库nway_ac 并进入db目录下
85 |
86 | #psql -U postgres -W -d nway_ac-f nway_ac.sql
87 |
88 |
89 | 10. 修改nway_ac/nway_ac/ settings.py 将正确的数据库配置更新在其中
90 |
91 | 11. 修改 fs_ac/ nway_ac.py 将正确的数据库配置更新其中
92 |
93 | 12. 在 nway_ac下运行
94 |
95 | #python manage.py runserver 0.0.0.0:8000
96 | 这样即可在浏览器中ip:8000/admin中访问该页面
97 | 默认的用户名:admin 密码:nway123
98 |
99 | 13. 在fs_ac下运行
100 |
101 | #python nway_ac.py即可开始工作
102 |
103 | 三、 页面简易说明
104 | 1. 所有页面菜单
105 |
106 | 2. 基本配置
107 |
108 | 3. 彩铃管理
109 |
110 | 4. 时间计划(在此时间段内才会有效呼叫,全天的则只需要00:00-24:00即可)
111 |
112 | 5. 呼叫任务管理(和时间计划配合在内实现自动呼叫)
113 |
114 | 6. 号码管理(基本为固定的,和并发量差不多的号码即可)
115 |
116 | 这里用于维护呼叫的号码等
117 | 相关的图在docs中使用说明中有
118 |
--------------------------------------------------------------------------------
/nway_ac/nway_ac/settings.py:
--------------------------------------------------------------------------------
1 | # -*-coding:utf-8 -*-
2 | """
3 | # -*-coding:utf-8 -*-
4 | Django settings for nway_ac project.
5 |
6 | Generated by 'django-admin startproject' using Django 1.8.1.
7 |
8 | For more information on this file, see
9 | https://docs.djangoproject.com/en/1.8/topics/settings/
10 |
11 | For the full list of settings and their values, see
12 | https://docs.djangoproject.com/en/1.8/ref/settings/
13 | """
14 |
15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
16 | import os
17 |
18 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
19 |
20 |
21 | # Quick-start development settings - unsuitable for production
22 | # See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
23 |
24 | # SECURITY WARNING: keep the secret key used in production secret!
25 | SECRET_KEY = '*%i%_vtm)u7itz!%28j-j4_96p64zku5i204#6am8s2ulkfke*'
26 |
27 | # SECURITY WARNING: don't run with debug turned on in production!
28 | DEBUG = True
29 |
30 | ALLOWED_HOSTS = []
31 |
32 |
33 | # Application definition
34 |
35 | INSTALLED_APPS = (
36 | 'django.contrib.admin',
37 | 'django.contrib.auth',
38 | 'django.contrib.contenttypes',
39 | 'django.contrib.sessions',
40 | 'django.contrib.messages',
41 | 'django.contrib.staticfiles',
42 | 'ac_manager',
43 |
44 | )
45 |
46 | MIDDLEWARE_CLASSES = (
47 | 'django.contrib.sessions.middleware.SessionMiddleware',
48 | 'django.middleware.common.CommonMiddleware',
49 | 'django.middleware.csrf.CsrfViewMiddleware',
50 | 'django.contrib.auth.middleware.AuthenticationMiddleware',
51 | 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
52 | 'django.contrib.messages.middleware.MessageMiddleware',
53 | 'django.middleware.clickjacking.XFrameOptionsMiddleware',
54 | 'django.middleware.security.SecurityMiddleware',
55 | )
56 |
57 | ROOT_URLCONF = 'nway_ac.urls'
58 |
59 | TEMPLATES = [
60 | {
61 | 'BACKEND': 'django.template.backends.django.DjangoTemplates',
62 | 'DIRS': [],
63 | 'APP_DIRS': True,
64 | 'OPTIONS': {
65 | 'context_processors': [
66 | 'django.template.context_processors.debug',
67 | 'django.template.context_processors.request',
68 | 'django.contrib.auth.context_processors.auth',
69 | 'django.contrib.messages.context_processors.messages',
70 | ],
71 | },
72 | },
73 | ]
74 |
75 | WSGI_APPLICATION = 'nway_ac.wsgi.application'
76 |
77 |
78 | # Database
79 | # https://docs.djangoproject.com/en/1.8/ref/settings/#databases
80 |
81 | DATABASES = {
82 | 'default': {
83 | 'ENGINE':'django.db.backends.postgresql_psycopg2',
84 | 'NAME': 'nway_ac',
85 | 'USER': 'postgres',
86 | 'PASSWORD': 'nway_2015And',
87 | 'HOST': '127.0.0.1',
88 | 'PORT': '5432',
89 | }
90 | }
91 |
92 |
93 | # Internationalization
94 | # https://docs.djangoproject.com/en/1.8/topics/i18n/
95 |
96 | LANGUAGE_CODE = 'zh-CN'
97 |
98 | #TIME_ZONE = 'UTC'
99 | TIME_ZONE='Asia/Shanghai'
100 |
101 | USE_I18N = True
102 |
103 | USE_L10N = True
104 |
105 | USE_TZ = True
106 |
107 | DEFAULT_FILE_STORAGE = "ac_manager.storage.FileStorage"
108 | # Static files (CSS, JavaScript, Images)
109 | # https://docs.djangoproject.com/en/1.8/howto/static-files/
110 |
111 | STATIC_URL = '/static/'
112 |
--------------------------------------------------------------------------------
/nway_ac/ac_manager/models.py:
--------------------------------------------------------------------------------
1 | # coding=utf-8
2 | # This is an auto-generated Django model module.
3 | # You'll have to do the following manually to clean this up:
4 | # * Rearrange models' order
5 | # * Make sure each model has one field with primary_key=True
6 | # * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table
7 | # Feel free to rename the models, but don't rename db_table values or field names.
8 | #
9 | # Also note: You'll have to insert the output of 'django-admin sqlcustom [app_label]'
10 | # into your database.
11 | '''
12 | 版权所有:上海宁卫信息技术有限公司
13 | 功能说明:本程序只适用于落地与落地间消化话费,而不适用于其它骚扰类型的应用
14 | 授权模式:MPL
15 | bug report:lihao@nway.com.cn
16 | '''
17 | from __future__ import unicode_literals
18 |
19 | from django.db import models
20 | from django.db import connection
21 | import sys
22 | #sys.setdefaultencoding('utf-8')
23 |
24 | class string_with_title(str):
25 | def __new__(cls, value, title):
26 | instance = str.__new__(cls, value)
27 | instance._title = title
28 | return instance
29 |
30 | def title(self):
31 | return self._title
32 |
33 | __copy__ = lambda self: self
34 | __deepcopy__ = lambda self, memodict: self
35 | def get_sequence_val(seq_name):
36 | cursor = connection.cursor()
37 | cursor.execute('select nextval(\'%s\')' % seq_name)
38 | maxvalue = 1
39 | try:
40 | maxvalue = cursor.fetchone()[0]
41 | except:
42 | maxvalue = 1
43 | return maxvalue
44 | class BaseConfig(models.Model):
45 | config_name = models.CharField(primary_key=True, max_length=50)
46 | config_param = models.CharField(max_length=255, blank=True, null=True)
47 |
48 | class Meta:
49 | managed = False
50 | db_table = 'base_config'
51 |
52 |
53 | class CallRings(models.Model):
54 | id = models.BigIntegerField(primary_key=True)
55 | ring_name = models.CharField(max_length=200, blank=True, null=True)
56 | # ring_path = models.CharField(max_length=255, blank=True, null=True)
57 | ring_path = models.FileField(u'文件', upload_to='uploads/rings')
58 | ring_description = models.TextField(blank=True, null=True)
59 | ring_category = models.BigIntegerField(blank=True, null=True)
60 | def save(self, *args, **kwargs):
61 | if (self.id < 1):
62 | self.id = get_sequence_val('call_rings_id_seq')
63 | super(CallRings, self).save(*args, **kwargs)
64 | class Meta:
65 | managed = False
66 | db_table = 'call_rings'
67 | def __unicode__(self):
68 | return self.ring_name
69 |
70 |
71 | class CalloutNumbers(models.Model):
72 | id = models.BigIntegerField(primary_key=True)
73 | call_numbers = models.CharField(max_length=200, blank=True, null=True)
74 | call_timeout = models.IntegerField(blank=True, null=True)
75 | call_ring = models.ForeignKey(CallRings, blank=True, null=True)
76 | callout_state = models.IntegerField(blank=True, null=True)
77 | is_enable = models.NullBooleanField(default=True)
78 | last_call_time = models.DateTimeField(blank=True, null=True)
79 | def save(self, *args, **kwargs):
80 | if (self.id < 1):
81 | self.id = get_sequence_val('callout_numbers_id_seq')
82 | super(CalloutNumbers, self).save(*args, **kwargs)
83 |
84 | class Meta:
85 | managed = False
86 | db_table = 'callout_numbers'
87 |
88 |
89 | class NwayCallTasks(models.Model):
90 | id = models.BigIntegerField(primary_key=True)
91 | callout_name = models.CharField(max_length=200, blank=True, null=True)
92 | begin_time = models.DateTimeField(blank=True, null=True)
93 | stop_time = models.DateTimeField(blank=True, null=True)
94 | def save(self, *args, **kwargs):
95 | if (self.id < 1):
96 | self.id = get_sequence_val('nway_call_tasks_id_seq')
97 | super(NwayCallTasks, self).save(*args, **kwargs)
98 |
99 | class Meta:
100 | managed = False
101 | db_table = 'nway_call_tasks'
102 |
103 |
104 | class TimePlan(models.Model):
105 | id = models.BigIntegerField(primary_key=True)
106 | start_time = models.TimeField(blank=True, null=True)
107 | stop_time = models.TimeField(blank=True, null=True)
108 | def save(self, *args, **kwargs):
109 | if (self.id < 1):
110 | self.id = get_sequence_val('time_plan_id_seq')
111 | super(TimePlan, self).save(*args, **kwargs)
112 |
113 | class Meta:
114 | managed = False
115 | db_table = 'time_plan'
116 |
--------------------------------------------------------------------------------
/fs_ac/ESL.py:
--------------------------------------------------------------------------------
1 | # This file was automatically generated by SWIG (http://www.swig.org).
2 | # Version 1.3.35
3 | #
4 | # Don't modify this file, modify the SWIG interface instead.
5 | # This file is compatible with both classic and new-style classes.
6 |
7 | import _ESL
8 | import new
9 | new_instancemethod = new.instancemethod
10 | def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
11 | if (name == "thisown"): return self.this.own(value)
12 | if (name == "this"):
13 | if type(value).__name__ == 'PySwigObject':
14 | self.__dict__[name] = value
15 | return
16 | method = class_type.__swig_setmethods__.get(name,None)
17 | if method: return method(self,value)
18 | if (not static) or hasattr(self,name):
19 | self.__dict__[name] = value
20 | else:
21 | raise AttributeError("You cannot add attributes to %s" % self)
22 |
23 | def _swig_setattr(self,class_type,name,value):
24 | return _swig_setattr_nondynamic(self,class_type,name,value,0)
25 |
26 | def _swig_getattr(self,class_type,name):
27 | if (name == "thisown"): return self.this.own()
28 | method = class_type.__swig_getmethods__.get(name,None)
29 | if method: return method(self)
30 | raise AttributeError,name
31 |
32 | def _swig_repr(self):
33 | try: strthis = "proxy of " + self.this.__repr__()
34 | except: strthis = ""
35 | return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
36 |
37 | class ESLevent:
38 | __swig_setmethods__ = {}
39 | __setattr__ = lambda self, name, value: _swig_setattr(self, ESLevent, name, value)
40 | __swig_getmethods__ = {}
41 | __getattr__ = lambda self, name: _swig_getattr(self, ESLevent, name)
42 | __repr__ = _swig_repr
43 | __swig_setmethods__["event"] = _ESL.ESLevent_event_set
44 | __swig_getmethods__["event"] = _ESL.ESLevent_event_get
45 | __swig_setmethods__["serialized_string"] = _ESL.ESLevent_serialized_string_set
46 | __swig_getmethods__["serialized_string"] = _ESL.ESLevent_serialized_string_get
47 | __swig_setmethods__["mine"] = _ESL.ESLevent_mine_set
48 | __swig_getmethods__["mine"] = _ESL.ESLevent_mine_get
49 | def __init__(self, *args):
50 | this = apply(_ESL.new_ESLevent, args)
51 | try: self.this.append(this)
52 | except: self.this = this
53 | __swig_destroy__ = _ESL.delete_ESLevent
54 | __del__ = lambda self : None;
55 | def serialize(*args): return apply(_ESL.ESLevent_serialize, args)
56 | def setPriority(*args): return apply(_ESL.ESLevent_setPriority, args)
57 | def getHeader(*args): return apply(_ESL.ESLevent_getHeader, args)
58 | def getBody(*args): return apply(_ESL.ESLevent_getBody, args)
59 | def getType(*args): return apply(_ESL.ESLevent_getType, args)
60 | def addBody(*args): return apply(_ESL.ESLevent_addBody, args)
61 | def addHeader(*args): return apply(_ESL.ESLevent_addHeader, args)
62 | def pushHeader(*args): return apply(_ESL.ESLevent_pushHeader, args)
63 | def unshiftHeader(*args): return apply(_ESL.ESLevent_unshiftHeader, args)
64 | def delHeader(*args): return apply(_ESL.ESLevent_delHeader, args)
65 | def firstHeader(*args): return apply(_ESL.ESLevent_firstHeader, args)
66 | def nextHeader(*args): return apply(_ESL.ESLevent_nextHeader, args)
67 | ESLevent_swigregister = _ESL.ESLevent_swigregister
68 | ESLevent_swigregister(ESLevent)
69 |
70 | class ESLconnection:
71 | __swig_setmethods__ = {}
72 | __setattr__ = lambda self, name, value: _swig_setattr(self, ESLconnection, name, value)
73 | __swig_getmethods__ = {}
74 | __getattr__ = lambda self, name: _swig_getattr(self, ESLconnection, name)
75 | __repr__ = _swig_repr
76 | def __init__(self, *args):
77 | this = apply(_ESL.new_ESLconnection, args)
78 | try: self.this.append(this)
79 | except: self.this = this
80 | __swig_destroy__ = _ESL.delete_ESLconnection
81 | __del__ = lambda self : None;
82 | def socketDescriptor(*args): return apply(_ESL.ESLconnection_socketDescriptor, args)
83 | def connected(*args): return apply(_ESL.ESLconnection_connected, args)
84 | def getInfo(*args): return apply(_ESL.ESLconnection_getInfo, args)
85 | def send(*args): return apply(_ESL.ESLconnection_send, args)
86 | def sendRecv(*args): return apply(_ESL.ESLconnection_sendRecv, args)
87 | def api(*args): return apply(_ESL.ESLconnection_api, args)
88 | def bgapi(*args): return apply(_ESL.ESLconnection_bgapi, args)
89 | def sendEvent(*args): return apply(_ESL.ESLconnection_sendEvent, args)
90 | def sendMSG(*args): return apply(_ESL.ESLconnection_sendMSG, args)
91 | def recvEvent(*args): return apply(_ESL.ESLconnection_recvEvent, args)
92 | def recvEventTimed(*args): return apply(_ESL.ESLconnection_recvEventTimed, args)
93 | def filter(*args): return apply(_ESL.ESLconnection_filter, args)
94 | def events(*args): return apply(_ESL.ESLconnection_events, args)
95 | def execute(*args): return apply(_ESL.ESLconnection_execute, args)
96 | def executeAsync(*args): return apply(_ESL.ESLconnection_executeAsync, args)
97 | def setAsyncExecute(*args): return apply(_ESL.ESLconnection_setAsyncExecute, args)
98 | def setEventLock(*args): return apply(_ESL.ESLconnection_setEventLock, args)
99 | def disconnect(*args): return apply(_ESL.ESLconnection_disconnect, args)
100 | ESLconnection_swigregister = _ESL.ESLconnection_swigregister
101 | ESLconnection_swigregister(ESLconnection)
102 |
103 | eslSetLogLevel = _ESL.eslSetLogLevel
104 |
105 |
106 |
--------------------------------------------------------------------------------
/fs_ac/nway_ac.py:
--------------------------------------------------------------------------------
1 | # coding=utf-8
2 | __author__ = 'lihao,18621575908'
3 | '''
4 | 版权所有:上海宁卫信息技术有限公司
5 | 功能说明:本程序只适用于落地与落地间消化话费,而不适用于其它骚扰类型的应用
6 | 授权模式:GPL
7 | bug report:lihao@nway.com.cn
8 | '''
9 | import time
10 | import thread
11 | import os,sys
12 | import psycopg2
13 | from ESL import *
14 | import string
15 | import datetime
16 | import random
17 | mylock = thread.allocate_lock()
18 | #global var
19 |
20 | fs_ip = '127.0.0.1'
21 | fs_esl_port = '8021'
22 | fs_esl_auth = 'ClueCon'
23 | rings = []
24 | global ring_count
25 | ring_count = 0
26 |
27 | max_call = 30
28 | base_path = '/usr/local/src/nway_ac/nway_ac/'
29 | gateway_url = 'sofia/gateway/tojp/'
30 |
31 | #//global var
32 | def GetDbConn():
33 | conn = psycopg2.connect(database="nway_ac", user="postgres", password="nway_2015And", host="127.0.0.1", port="5432")
34 | return conn
35 |
36 | def GetCurrentPath():
37 | return os.getcwd()
38 |
39 | def SetAllIdle():
40 | conn = GetDbConn()
41 | querysql = 'UPDATE callout_numbers SET callout_state=0, last_call_time=current_timestamp ;'
42 | cur = conn.cursor()
43 | cur.execute(querysql)
44 | conn.commit()
45 | print 'SetNumberIdle:ALL'
46 | cur.close()
47 | conn.close()
48 |
49 | def GetBaseConfig():
50 | conn = GetDbConn()
51 | querysql = 'SELECT config_name, config_param FROM base_config;'
52 | cur = conn.cursor()
53 | cur.execute(querysql)
54 | rows = cur.fetchall()
55 | conn.commit()
56 |
57 | for row in rows:
58 | config_name = row[0]
59 | if (cmp(config_name , 'max_call') == 0):
60 | max_call = row[1]
61 | if (cmp(config_name , 'base_path')==0):
62 | base_path = row[1]
63 | if (cmp(config_name , 'gateway_url')==0):
64 | gateway_url = row[1]
65 | print 'max_call:' + max_call
66 | print 'base_path:' +base_path
67 | print 'gateway_url:'+ gateway_url
68 | cur.close()
69 | conn.close()
70 |
71 | def SetNumberBusy(dest_number):
72 | conn = GetDbConn()
73 | querysql = 'UPDATE callout_numbers SET callout_state=1 WHERE call_numbers =\'' + dest_number +'\''
74 | cur = conn.cursor()
75 | cur.execute(querysql)
76 | conn.commit()
77 | print 'SetNumberBusy:' +dest_number
78 | cur.close()
79 | conn.close()
80 |
81 | def CheckCallTime():
82 | conn = GetDbConn()
83 | querysql = 'SELECT a.id, a.start_time, a.stop_time,b.id \
84 | FROM time_plan a, nway_call_tasks b where (now()::time > a.start_time ) and ' \
85 | '(now()::time < a.stop_time) and (now() b.begin_time);'
86 | cur = conn.cursor()
87 | cur.execute(querysql)
88 | rows = cur.fetchall()
89 | ret_value = False
90 | if cur.rowcount > 0:
91 | ret_value = True
92 | conn.commit()
93 | cur.close()
94 | conn.close()
95 | return ret_value
96 |
97 |
98 | def CallOut(dial_string,call_number):
99 | con = ESLconnection(fs_ip, fs_esl_port, fs_esl_auth)
100 | if con.connected():
101 | e = con.api(dial_string)
102 | SetNumberBusy(call_number)
103 | print e.getBody()
104 | else:
105 | print 'not Connected'
106 | con.disconnect();
107 |
108 | def GetRingPath():
109 | #print 'ring count:' .join(str(rings.count()))
110 | global ring_count
111 | index = random.randint(0,ring_count -1)
112 | print 'ring count:' + str(ring_count) + ',this index:'+ str(index)
113 | return rings[index]
114 | def GetRandomTimeout():
115 | timeout =500
116 | timeout = random.randint(300,5000)
117 | return timeout
118 |
119 | def AutoCall(a,b):
120 |
121 | print 'Start Auto Calls'
122 | while True:
123 | try:
124 | conn = GetDbConn()
125 | if CheckCallTime()==True:
126 | querysql = 'SELECT a.id, a.call_numbers,a. call_timeout, a.call_ring_id, a.callout_state, \
127 | a.is_enable, a.last_call_time\
128 | FROM callout_numbers a where a.is_enable=True and' \
129 | ' a.callout_state =0; '
130 | #OR ceil(abs(extract(epoch from current_timestamp -a. last_call_time))) > a.call_timeout)
131 | #print querysql
132 | cur = conn.cursor()
133 | cur.execute(querysql)
134 | rows = cur.fetchall()
135 | for row in rows:
136 | print cur.rowcount
137 | call_number = row[1]
138 | call_timeout = row[2]
139 | call_ring_id = row[3]
140 | ring_path = base_path + GetRingPath()
141 | dial_string = 'originate {execute_on_pre_answer=start_da,execute_on_answer=stop_da,execute_on_answer=\'sched_hangup +' + str(GetRandomTimeout()) + '\'}'+gateway_url + \
142 | call_number + ' &endless_playback(\'' + ring_path + '\')'
143 | CallOut(dial_string, call_number)
144 | print dial_string
145 | time.sleep(0.070)
146 | cur.close()
147 | conn.close()
148 | except:
149 | print 'access database failed\n'
150 | time.sleep(0.10)
151 | #print 'CheckCallTime'
152 |
153 | #conn.close()
154 | thread.exit_thread()
155 |
156 | def GetAllRings():
157 | conn = GetDbConn()
158 | querysql = 'SELECT ring_path from call_rings;'
159 | cur = conn.cursor()
160 | cur.execute(querysql)
161 | rows = cur.fetchall()
162 | #ring_count = rows.rowcount
163 | #count=0
164 | global ring_count
165 | for row in rows:
166 | rings.append(row[0])
167 | ring_count += 1
168 | # print row[0]
169 | for i in rings:
170 | print i
171 | # ring_count = count
172 | print 'ring_count:' + str(ring_count)
173 | conn.commit()
174 | cur.close()
175 | conn.close()
176 |
177 |
178 | def SetNumberIdle(dest_number):
179 | conn = GetDbConn()
180 | querysql = 'UPDATE callout_numbers SET callout_state=0, last_call_time=current_timestamp WHERE call_numbers =\'' + dest_number +'\''
181 | cur = conn.cursor()
182 | cur.execute(querysql)
183 | conn.commit()
184 | print 'SetNumberIdle:' + dest_number
185 | cur.close()
186 | conn.close()
187 |
188 | if __name__ == '__main__':
189 | GetBaseConfig()
190 | #str='python- String function'
191 | #print '%s startwith t=%s' % (str,str.startswith('t'))
192 | #print '%s' % (str.replace('-',''))
193 | SetAllIdle()
194 | GetAllRings()
195 | con = ESLconnection(fs_ip, fs_esl_port, fs_esl_auth)
196 | if con.connected():
197 | thread.start_new_thread(AutoCall,(1,1))
198 | e = con.events('plain','CHANNEL_HANGUP_COMPLETE CUSTOM:da')
199 | #CUSTOM:da为自定义的电话铃音检测模块消息
200 | while True:
201 | ee = con.recvEvent()
202 | #print ee
203 | event_name = ee.getHeader( 'Event-Name')
204 | event_subclass = ee.getHeader('Event-Subclass')
205 | if ee and event_name == 'CUSTOM' and event_subclass == 'da':
206 | #检测到了电话铃音分析结果
207 | da_type = ee.getHeader('da_type')
208 | #分析结果,由da_type来送出,即空号,忙等
209 | da_similarity = ee.getHeader('da_similarity')
210 | #da_similarity是和样本库中检测的实际样本的相似性百分比
211 | print da_type, da_similarity
212 | if ee and event_name == 'HANGUP_COMPLETE':
213 | my_number = ee.getHeader('Caller-Caller-ID-Number')
214 | dest_number = ee.getHeader('Caller-Destination-Number')
215 | SetNumberIdle(dest_number)
216 | #在此处处理挂机事件
217 | con.disconnect();
218 |
--------------------------------------------------------------------------------
/db/nway_ac.sql:
--------------------------------------------------------------------------------
1 | --
2 | -- PostgreSQL database dump
3 | --
4 |
5 | SET statement_timeout = 0;
6 | SET lock_timeout = 0;
7 | SET client_encoding = 'UTF8';
8 | SET standard_conforming_strings = on;
9 | SET check_function_bodies = false;
10 | SET client_min_messages = warning;
11 |
12 | --
13 | -- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
14 | --
15 |
16 | CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
17 |
18 |
19 | --
20 | -- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
21 | --
22 |
23 | COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
24 |
25 |
26 | SET search_path = public, pg_catalog;
27 |
28 | SET default_tablespace = '';
29 |
30 | SET default_with_oids = false;
31 |
32 | --
33 | -- Name: auth_group; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
34 | --
35 |
36 | CREATE TABLE auth_group (
37 | id integer NOT NULL,
38 | name character varying(80) NOT NULL
39 | );
40 |
41 |
42 | ALTER TABLE public.auth_group OWNER TO postgres;
43 |
44 | --
45 | -- Name: auth_group_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
46 | --
47 |
48 | CREATE SEQUENCE auth_group_id_seq
49 | START WITH 1
50 | INCREMENT BY 1
51 | NO MINVALUE
52 | NO MAXVALUE
53 | CACHE 1;
54 |
55 |
56 | ALTER TABLE public.auth_group_id_seq OWNER TO postgres;
57 |
58 | --
59 | -- Name: auth_group_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
60 | --
61 |
62 | ALTER SEQUENCE auth_group_id_seq OWNED BY auth_group.id;
63 |
64 |
65 | --
66 | -- Name: auth_group_permissions; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
67 | --
68 |
69 | CREATE TABLE auth_group_permissions (
70 | id integer NOT NULL,
71 | group_id integer NOT NULL,
72 | permission_id integer NOT NULL
73 | );
74 |
75 |
76 | ALTER TABLE public.auth_group_permissions OWNER TO postgres;
77 |
78 | --
79 | -- Name: auth_group_permissions_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
80 | --
81 |
82 | CREATE SEQUENCE auth_group_permissions_id_seq
83 | START WITH 1
84 | INCREMENT BY 1
85 | NO MINVALUE
86 | NO MAXVALUE
87 | CACHE 1;
88 |
89 |
90 | ALTER TABLE public.auth_group_permissions_id_seq OWNER TO postgres;
91 |
92 | --
93 | -- Name: auth_group_permissions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
94 | --
95 |
96 | ALTER SEQUENCE auth_group_permissions_id_seq OWNED BY auth_group_permissions.id;
97 |
98 |
99 | --
100 | -- Name: auth_permission; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
101 | --
102 |
103 | CREATE TABLE auth_permission (
104 | id integer NOT NULL,
105 | name character varying(255) NOT NULL,
106 | content_type_id integer NOT NULL,
107 | codename character varying(100) NOT NULL
108 | );
109 |
110 |
111 | ALTER TABLE public.auth_permission OWNER TO postgres;
112 |
113 | --
114 | -- Name: auth_permission_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
115 | --
116 |
117 | CREATE SEQUENCE auth_permission_id_seq
118 | START WITH 1
119 | INCREMENT BY 1
120 | NO MINVALUE
121 | NO MAXVALUE
122 | CACHE 1;
123 |
124 |
125 | ALTER TABLE public.auth_permission_id_seq OWNER TO postgres;
126 |
127 | --
128 | -- Name: auth_permission_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
129 | --
130 |
131 | ALTER SEQUENCE auth_permission_id_seq OWNED BY auth_permission.id;
132 |
133 |
134 | --
135 | -- Name: auth_user; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
136 | --
137 |
138 | CREATE TABLE auth_user (
139 | id integer NOT NULL,
140 | password character varying(128) NOT NULL,
141 | last_login timestamp with time zone,
142 | is_superuser boolean NOT NULL,
143 | username character varying(30) NOT NULL,
144 | first_name character varying(30) NOT NULL,
145 | last_name character varying(30) NOT NULL,
146 | email character varying(254) NOT NULL,
147 | is_staff boolean NOT NULL,
148 | is_active boolean NOT NULL,
149 | date_joined timestamp with time zone NOT NULL
150 | );
151 |
152 |
153 | ALTER TABLE public.auth_user OWNER TO postgres;
154 |
155 | --
156 | -- Name: auth_user_groups; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
157 | --
158 |
159 | CREATE TABLE auth_user_groups (
160 | id integer NOT NULL,
161 | user_id integer NOT NULL,
162 | group_id integer NOT NULL
163 | );
164 |
165 |
166 | ALTER TABLE public.auth_user_groups OWNER TO postgres;
167 |
168 | --
169 | -- Name: auth_user_groups_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
170 | --
171 |
172 | CREATE SEQUENCE auth_user_groups_id_seq
173 | START WITH 1
174 | INCREMENT BY 1
175 | NO MINVALUE
176 | NO MAXVALUE
177 | CACHE 1;
178 |
179 |
180 | ALTER TABLE public.auth_user_groups_id_seq OWNER TO postgres;
181 |
182 | --
183 | -- Name: auth_user_groups_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
184 | --
185 |
186 | ALTER SEQUENCE auth_user_groups_id_seq OWNED BY auth_user_groups.id;
187 |
188 |
189 | --
190 | -- Name: auth_user_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
191 | --
192 |
193 | CREATE SEQUENCE auth_user_id_seq
194 | START WITH 1
195 | INCREMENT BY 1
196 | NO MINVALUE
197 | NO MAXVALUE
198 | CACHE 1;
199 |
200 |
201 | ALTER TABLE public.auth_user_id_seq OWNER TO postgres;
202 |
203 | --
204 | -- Name: auth_user_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
205 | --
206 |
207 | ALTER SEQUENCE auth_user_id_seq OWNED BY auth_user.id;
208 |
209 |
210 | --
211 | -- Name: auth_user_user_permissions; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
212 | --
213 |
214 | CREATE TABLE auth_user_user_permissions (
215 | id integer NOT NULL,
216 | user_id integer NOT NULL,
217 | permission_id integer NOT NULL
218 | );
219 |
220 |
221 | ALTER TABLE public.auth_user_user_permissions OWNER TO postgres;
222 |
223 | --
224 | -- Name: auth_user_user_permissions_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
225 | --
226 |
227 | CREATE SEQUENCE auth_user_user_permissions_id_seq
228 | START WITH 1
229 | INCREMENT BY 1
230 | NO MINVALUE
231 | NO MAXVALUE
232 | CACHE 1;
233 |
234 |
235 | ALTER TABLE public.auth_user_user_permissions_id_seq OWNER TO postgres;
236 |
237 | --
238 | -- Name: auth_user_user_permissions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
239 | --
240 |
241 | ALTER SEQUENCE auth_user_user_permissions_id_seq OWNED BY auth_user_user_permissions.id;
242 |
243 |
244 | --
245 | -- Name: base_config; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
246 | --
247 |
248 | CREATE TABLE base_config (
249 | config_name character varying(50) NOT NULL,
250 | config_param character varying(255)
251 | );
252 |
253 |
254 | ALTER TABLE public.base_config OWNER TO postgres;
255 |
256 | --
257 | -- Name: call_rings; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
258 | --
259 |
260 | CREATE TABLE call_rings (
261 | id bigint NOT NULL,
262 | ring_name character varying(200),
263 | ring_path character varying(255),
264 | ring_description text,
265 | ring_category bigint
266 | );
267 |
268 |
269 | ALTER TABLE public.call_rings OWNER TO postgres;
270 |
271 | --
272 | -- Name: call_rings_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
273 | --
274 |
275 | CREATE SEQUENCE call_rings_id_seq
276 | START WITH 1
277 | INCREMENT BY 1
278 | NO MINVALUE
279 | NO MAXVALUE
280 | CACHE 1;
281 |
282 |
283 | ALTER TABLE public.call_rings_id_seq OWNER TO postgres;
284 |
285 | --
286 | -- Name: call_rings_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
287 | --
288 |
289 | ALTER SEQUENCE call_rings_id_seq OWNED BY call_rings.id;
290 |
291 |
292 | --
293 | -- Name: callout_numbers; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
294 | --
295 |
296 | CREATE TABLE callout_numbers (
297 | id bigint NOT NULL,
298 | call_numbers character varying(200),
299 | call_timeout integer,
300 | call_ring_id bigint,
301 | callout_state integer,
302 | is_enable boolean DEFAULT true,
303 | last_call_time timestamp without time zone DEFAULT now()
304 | );
305 |
306 |
307 | ALTER TABLE public.callout_numbers OWNER TO postgres;
308 |
309 | --
310 | -- Name: COLUMN callout_numbers.last_call_time; Type: COMMENT; Schema: public; Owner: postgres
311 | --
312 |
313 | COMMENT ON COLUMN callout_numbers.last_call_time IS '最后一次呼的时间,防止因为有时消息没回过来造成号码一直呼不出去';
314 |
315 |
316 | --
317 | -- Name: callout_numbers_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
318 | --
319 |
320 | CREATE SEQUENCE callout_numbers_id_seq
321 | START WITH 1
322 | INCREMENT BY 1
323 | NO MINVALUE
324 | NO MAXVALUE
325 | CACHE 1;
326 |
327 |
328 | ALTER TABLE public.callout_numbers_id_seq OWNER TO postgres;
329 |
330 | --
331 | -- Name: callout_numbers_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
332 | --
333 |
334 | ALTER SEQUENCE callout_numbers_id_seq OWNED BY callout_numbers.id;
335 |
336 |
337 | --
338 | -- Name: django_admin_log; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
339 | --
340 |
341 | CREATE TABLE django_admin_log (
342 | id integer NOT NULL,
343 | action_time timestamp with time zone NOT NULL,
344 | object_id text,
345 | object_repr character varying(200) NOT NULL,
346 | action_flag smallint NOT NULL,
347 | change_message text NOT NULL,
348 | content_type_id integer,
349 | user_id integer NOT NULL,
350 | CONSTRAINT django_admin_log_action_flag_check CHECK ((action_flag >= 0))
351 | );
352 |
353 |
354 | ALTER TABLE public.django_admin_log OWNER TO postgres;
355 |
356 | --
357 | -- Name: django_admin_log_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
358 | --
359 |
360 | CREATE SEQUENCE django_admin_log_id_seq
361 | START WITH 1
362 | INCREMENT BY 1
363 | NO MINVALUE
364 | NO MAXVALUE
365 | CACHE 1;
366 |
367 |
368 | ALTER TABLE public.django_admin_log_id_seq OWNER TO postgres;
369 |
370 | --
371 | -- Name: django_admin_log_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
372 | --
373 |
374 | ALTER SEQUENCE django_admin_log_id_seq OWNED BY django_admin_log.id;
375 |
376 |
377 | --
378 | -- Name: django_content_type; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
379 | --
380 |
381 | CREATE TABLE django_content_type (
382 | id integer NOT NULL,
383 | app_label character varying(100) NOT NULL,
384 | model character varying(100) NOT NULL
385 | );
386 |
387 |
388 | ALTER TABLE public.django_content_type OWNER TO postgres;
389 |
390 | --
391 | -- Name: django_content_type_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
392 | --
393 |
394 | CREATE SEQUENCE django_content_type_id_seq
395 | START WITH 1
396 | INCREMENT BY 1
397 | NO MINVALUE
398 | NO MAXVALUE
399 | CACHE 1;
400 |
401 |
402 | ALTER TABLE public.django_content_type_id_seq OWNER TO postgres;
403 |
404 | --
405 | -- Name: django_content_type_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
406 | --
407 |
408 | ALTER SEQUENCE django_content_type_id_seq OWNED BY django_content_type.id;
409 |
410 |
411 | --
412 | -- Name: django_migrations; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
413 | --
414 |
415 | CREATE TABLE django_migrations (
416 | id integer NOT NULL,
417 | app character varying(255) NOT NULL,
418 | name character varying(255) NOT NULL,
419 | applied timestamp with time zone NOT NULL
420 | );
421 |
422 |
423 | ALTER TABLE public.django_migrations OWNER TO postgres;
424 |
425 | --
426 | -- Name: django_migrations_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
427 | --
428 |
429 | CREATE SEQUENCE django_migrations_id_seq
430 | START WITH 1
431 | INCREMENT BY 1
432 | NO MINVALUE
433 | NO MAXVALUE
434 | CACHE 1;
435 |
436 |
437 | ALTER TABLE public.django_migrations_id_seq OWNER TO postgres;
438 |
439 | --
440 | -- Name: django_migrations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
441 | --
442 |
443 | ALTER SEQUENCE django_migrations_id_seq OWNED BY django_migrations.id;
444 |
445 |
446 | --
447 | -- Name: django_session; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
448 | --
449 |
450 | CREATE TABLE django_session (
451 | session_key character varying(40) NOT NULL,
452 | session_data text NOT NULL,
453 | expire_date timestamp with time zone NOT NULL
454 | );
455 |
456 |
457 | ALTER TABLE public.django_session OWNER TO postgres;
458 |
459 | --
460 | -- Name: nway_call_tasks; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
461 | --
462 |
463 | CREATE TABLE nway_call_tasks (
464 | id bigint NOT NULL,
465 | callout_name character varying(200),
466 | begin_time timestamp without time zone,
467 | stop_time timestamp without time zone
468 | );
469 |
470 |
471 | ALTER TABLE public.nway_call_tasks OWNER TO postgres;
472 |
473 | --
474 | -- Name: nway_call_tasks_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
475 | --
476 |
477 | CREATE SEQUENCE nway_call_tasks_id_seq
478 | START WITH 1
479 | INCREMENT BY 1
480 | NO MINVALUE
481 | NO MAXVALUE
482 | CACHE 1;
483 |
484 |
485 | ALTER TABLE public.nway_call_tasks_id_seq OWNER TO postgres;
486 |
487 | --
488 | -- Name: nway_call_tasks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
489 | --
490 |
491 | ALTER SEQUENCE nway_call_tasks_id_seq OWNED BY nway_call_tasks.id;
492 |
493 |
494 | --
495 | -- Name: time_plan; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
496 | --
497 |
498 | CREATE TABLE time_plan (
499 | id bigint NOT NULL,
500 | start_time time without time zone,
501 | stop_time time without time zone
502 | );
503 |
504 |
505 | ALTER TABLE public.time_plan OWNER TO postgres;
506 |
507 | --
508 | -- Name: time_plan_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
509 | --
510 |
511 | CREATE SEQUENCE time_plan_id_seq
512 | START WITH 1
513 | INCREMENT BY 1
514 | NO MINVALUE
515 | NO MAXVALUE
516 | CACHE 1;
517 |
518 |
519 | ALTER TABLE public.time_plan_id_seq OWNER TO postgres;
520 |
521 | --
522 | -- Name: time_plan_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
523 | --
524 |
525 | ALTER SEQUENCE time_plan_id_seq OWNED BY time_plan.id;
526 |
527 |
528 | --
529 | -- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
530 | --
531 |
532 | ALTER TABLE ONLY auth_group ALTER COLUMN id SET DEFAULT nextval('auth_group_id_seq'::regclass);
533 |
534 |
535 | --
536 | -- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
537 | --
538 |
539 | ALTER TABLE ONLY auth_group_permissions ALTER COLUMN id SET DEFAULT nextval('auth_group_permissions_id_seq'::regclass);
540 |
541 |
542 | --
543 | -- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
544 | --
545 |
546 | ALTER TABLE ONLY auth_permission ALTER COLUMN id SET DEFAULT nextval('auth_permission_id_seq'::regclass);
547 |
548 |
549 | --
550 | -- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
551 | --
552 |
553 | ALTER TABLE ONLY auth_user ALTER COLUMN id SET DEFAULT nextval('auth_user_id_seq'::regclass);
554 |
555 |
556 | --
557 | -- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
558 | --
559 |
560 | ALTER TABLE ONLY auth_user_groups ALTER COLUMN id SET DEFAULT nextval('auth_user_groups_id_seq'::regclass);
561 |
562 |
563 | --
564 | -- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
565 | --
566 |
567 | ALTER TABLE ONLY auth_user_user_permissions ALTER COLUMN id SET DEFAULT nextval('auth_user_user_permissions_id_seq'::regclass);
568 |
569 |
570 | --
571 | -- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
572 | --
573 |
574 | ALTER TABLE ONLY call_rings ALTER COLUMN id SET DEFAULT nextval('call_rings_id_seq'::regclass);
575 |
576 |
577 | --
578 | -- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
579 | --
580 |
581 | ALTER TABLE ONLY callout_numbers ALTER COLUMN id SET DEFAULT nextval('callout_numbers_id_seq'::regclass);
582 |
583 |
584 | --
585 | -- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
586 | --
587 |
588 | ALTER TABLE ONLY django_admin_log ALTER COLUMN id SET DEFAULT nextval('django_admin_log_id_seq'::regclass);
589 |
590 |
591 | --
592 | -- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
593 | --
594 |
595 | ALTER TABLE ONLY django_content_type ALTER COLUMN id SET DEFAULT nextval('django_content_type_id_seq'::regclass);
596 |
597 |
598 | --
599 | -- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
600 | --
601 |
602 | ALTER TABLE ONLY django_migrations ALTER COLUMN id SET DEFAULT nextval('django_migrations_id_seq'::regclass);
603 |
604 |
605 | --
606 | -- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
607 | --
608 |
609 | ALTER TABLE ONLY nway_call_tasks ALTER COLUMN id SET DEFAULT nextval('nway_call_tasks_id_seq'::regclass);
610 |
611 |
612 | --
613 | -- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
614 | --
615 |
616 | ALTER TABLE ONLY time_plan ALTER COLUMN id SET DEFAULT nextval('time_plan_id_seq'::regclass);
617 |
618 |
619 | --
620 | -- Data for Name: auth_group; Type: TABLE DATA; Schema: public; Owner: postgres
621 | --
622 |
623 |
624 |
625 | --
626 | -- Name: auth_group_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
627 | --
628 |
629 | SELECT pg_catalog.setval('auth_group_id_seq', 1, false);
630 |
631 |
632 | --
633 | -- Data for Name: auth_group_permissions; Type: TABLE DATA; Schema: public; Owner: postgres
634 | --
635 |
636 |
637 |
638 | --
639 | -- Name: auth_group_permissions_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
640 | --
641 |
642 | SELECT pg_catalog.setval('auth_group_permissions_id_seq', 1, false);
643 |
644 |
645 | --
646 | -- Data for Name: auth_permission; Type: TABLE DATA; Schema: public; Owner: postgres
647 | --
648 |
649 | INSERT INTO auth_permission VALUES (1, 'Can add log entry', 1, 'add_logentry');
650 | INSERT INTO auth_permission VALUES (2, 'Can change log entry', 1, 'change_logentry');
651 | INSERT INTO auth_permission VALUES (3, 'Can delete log entry', 1, 'delete_logentry');
652 | INSERT INTO auth_permission VALUES (4, 'Can add permission', 2, 'add_permission');
653 | INSERT INTO auth_permission VALUES (5, 'Can change permission', 2, 'change_permission');
654 | INSERT INTO auth_permission VALUES (6, 'Can delete permission', 2, 'delete_permission');
655 | INSERT INTO auth_permission VALUES (7, 'Can add group', 3, 'add_group');
656 | INSERT INTO auth_permission VALUES (8, 'Can change group', 3, 'change_group');
657 | INSERT INTO auth_permission VALUES (9, 'Can delete group', 3, 'delete_group');
658 | INSERT INTO auth_permission VALUES (10, 'Can add user', 4, 'add_user');
659 | INSERT INTO auth_permission VALUES (11, 'Can change user', 4, 'change_user');
660 | INSERT INTO auth_permission VALUES (12, 'Can delete user', 4, 'delete_user');
661 | INSERT INTO auth_permission VALUES (13, 'Can add content type', 5, 'add_contenttype');
662 | INSERT INTO auth_permission VALUES (14, 'Can change content type', 5, 'change_contenttype');
663 | INSERT INTO auth_permission VALUES (15, 'Can delete content type', 5, 'delete_contenttype');
664 | INSERT INTO auth_permission VALUES (16, 'Can add session', 6, 'add_session');
665 | INSERT INTO auth_permission VALUES (17, 'Can change session', 6, 'change_session');
666 | INSERT INTO auth_permission VALUES (18, 'Can delete session', 6, 'delete_session');
667 | INSERT INTO auth_permission VALUES (19, 'Can add base config', 7, 'add_baseconfig');
668 | INSERT INTO auth_permission VALUES (20, 'Can change base config', 7, 'change_baseconfig');
669 | INSERT INTO auth_permission VALUES (21, 'Can delete base config', 7, 'delete_baseconfig');
670 | INSERT INTO auth_permission VALUES (22, 'Can add call rings', 8, 'add_callrings');
671 | INSERT INTO auth_permission VALUES (23, 'Can change call rings', 8, 'change_callrings');
672 | INSERT INTO auth_permission VALUES (24, 'Can delete call rings', 8, 'delete_callrings');
673 | INSERT INTO auth_permission VALUES (25, 'Can add callout numbers', 9, 'add_calloutnumbers');
674 | INSERT INTO auth_permission VALUES (26, 'Can change callout numbers', 9, 'change_calloutnumbers');
675 | INSERT INTO auth_permission VALUES (27, 'Can delete callout numbers', 9, 'delete_calloutnumbers');
676 | INSERT INTO auth_permission VALUES (28, 'Can add nway call tasks', 10, 'add_nwaycalltasks');
677 | INSERT INTO auth_permission VALUES (29, 'Can change nway call tasks', 10, 'change_nwaycalltasks');
678 | INSERT INTO auth_permission VALUES (30, 'Can delete nway call tasks', 10, 'delete_nwaycalltasks');
679 | INSERT INTO auth_permission VALUES (31, 'Can add time plan', 11, 'add_timeplan');
680 | INSERT INTO auth_permission VALUES (32, 'Can change time plan', 11, 'change_timeplan');
681 | INSERT INTO auth_permission VALUES (33, 'Can delete time plan', 11, 'delete_timeplan');
682 |
683 |
684 | --
685 | -- Name: auth_permission_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
686 | --
687 |
688 | SELECT pg_catalog.setval('auth_permission_id_seq', 33, true);
689 |
690 |
691 | --
692 | -- Data for Name: auth_user; Type: TABLE DATA; Schema: public; Owner: postgres
693 | --
694 |
695 | INSERT INTO auth_user VALUES (1, 'pbkdf2_sha256$20000$UBPItMKEokzh$MH+TyiXr6XCP9F8GCThrG+o0jXwUo1VPzhvRM++jOiw=', '2015-06-23 14:56:53.275563+08', true, 'admin', '', '', 'lihao_nx@163.com', true, true, '2015-06-21 18:30:42.517+08');
696 |
697 |
698 | --
699 | -- Data for Name: auth_user_groups; Type: TABLE DATA; Schema: public; Owner: postgres
700 | --
701 |
702 |
703 |
704 | --
705 | -- Name: auth_user_groups_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
706 | --
707 |
708 | SELECT pg_catalog.setval('auth_user_groups_id_seq', 1, false);
709 |
710 |
711 | --
712 | -- Name: auth_user_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
713 | --
714 |
715 | SELECT pg_catalog.setval('auth_user_id_seq', 1, true);
716 |
717 |
718 | --
719 | -- Data for Name: auth_user_user_permissions; Type: TABLE DATA; Schema: public; Owner: postgres
720 | --
721 |
722 |
723 |
724 | --
725 | -- Name: auth_user_user_permissions_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
726 | --
727 |
728 | SELECT pg_catalog.setval('auth_user_user_permissions_id_seq', 1, false);
729 |
730 |
731 | --
732 | -- Data for Name: base_config; Type: TABLE DATA; Schema: public; Owner: postgres
733 | --
734 |
735 | INSERT INTO base_config VALUES ('max_call', '200');
736 | INSERT INTO base_config VALUES ('gateway_url', 'sofia/gateway/tojp/');
737 | INSERT INTO base_config VALUES ('base_path', '/usr/local/src/nway_ac/nway_ac/');
738 |
739 |
740 | --
741 | -- Data for Name: call_rings; Type: TABLE DATA; Schema: public; Owner: postgres
742 | --
743 |
744 | INSERT INTO call_rings VALUES (3, 'test', 'uploads/rings/20150621195412_73.wav', NULL, NULL);
745 | INSERT INTO call_rings VALUES (4, 'bgmusic_new', 'uploads/rings/20150623155330_2.wav', NULL, NULL);
746 | INSERT INTO call_rings VALUES (5, 'bgmusic_old', 'uploads/rings/20150623155351_94.wav', NULL, NULL);
747 |
748 |
749 | --
750 | -- Name: call_rings_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
751 | --
752 |
753 | SELECT pg_catalog.setval('call_rings_id_seq', 5, true);
754 |
755 |
756 | --
757 | -- Data for Name: callout_numbers; Type: TABLE DATA; Schema: public; Owner: postgres
758 | --
759 |
760 | INSERT INTO callout_numbers VALUES (1, '018621575908', 200, 4, 1, true, '2015-06-23 18:16:45.529433');
761 | INSERT INTO callout_numbers VALUES (2, '018939892185', 100, 5, 1, true, '2015-06-23 18:15:51.262677');
762 |
763 |
764 | --
765 | -- Name: callout_numbers_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
766 | --
767 |
768 | SELECT pg_catalog.setval('callout_numbers_id_seq', 2, true);
769 |
770 |
771 | --
772 | -- Data for Name: django_admin_log; Type: TABLE DATA; Schema: public; Owner: postgres
773 | --
774 |
775 | INSERT INTO django_admin_log VALUES (1, '2015-06-21 19:54:12.767+08', '3', 'CallRings object', 1, '', 8, 1);
776 | INSERT INTO django_admin_log VALUES (2, '2015-06-23 14:22:43.195263+08', 'max_call', 'BaseConfig object', 1, '', 7, 1);
777 | INSERT INTO django_admin_log VALUES (3, '2015-06-23 14:23:41.088895+08', 'base_path', 'BaseConfig object', 1, '', 7, 1);
778 | INSERT INTO django_admin_log VALUES (4, '2015-06-23 14:25:12.034578+08', 'gateway_url', 'BaseConfig object', 1, '', 7, 1);
779 | INSERT INTO django_admin_log VALUES (5, '2015-06-23 14:57:03.581929+08', '1', 'TimePlan object', 1, '', 11, 1);
780 | INSERT INTO django_admin_log VALUES (6, '2015-06-23 15:50:38.214991+08', '2', 'TimePlan object', 1, '', 11, 1);
781 | INSERT INTO django_admin_log VALUES (7, '2015-06-23 15:53:30.073839+08', '4', 'CallRings object', 1, '', 8, 1);
782 | INSERT INTO django_admin_log VALUES (8, '2015-06-23 15:53:51.954975+08', '5', 'CallRings object', 1, '', 8, 1);
783 | INSERT INTO django_admin_log VALUES (9, '2015-06-23 16:00:13.799411+08', '1', 'NwayCallTasks object', 1, '', 10, 1);
784 | INSERT INTO django_admin_log VALUES (10, '2015-06-23 16:21:57.164188+08', '1', 'CalloutNumbers object', 1, '', 9, 1);
785 | INSERT INTO django_admin_log VALUES (11, '2015-06-23 16:58:58.183662+08', 'gateway_url', 'BaseConfig object', 2, '没有字段被修改。', 7, 1);
786 | INSERT INTO django_admin_log VALUES (12, '2015-06-23 17:14:54.638843+08', 'base_path', 'BaseConfig object', 2, '没有字段被修改。', 7, 1);
787 | INSERT INTO django_admin_log VALUES (13, '2015-06-23 18:12:10.726588+08', '2', 'CalloutNumbers object', 1, '', 9, 1);
788 |
789 |
790 | --
791 | -- Name: django_admin_log_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
792 | --
793 |
794 | SELECT pg_catalog.setval('django_admin_log_id_seq', 13, true);
795 |
796 |
797 | --
798 | -- Data for Name: django_content_type; Type: TABLE DATA; Schema: public; Owner: postgres
799 | --
800 |
801 | INSERT INTO django_content_type VALUES (1, 'admin', 'logentry');
802 | INSERT INTO django_content_type VALUES (2, 'auth', 'permission');
803 | INSERT INTO django_content_type VALUES (3, 'auth', 'group');
804 | INSERT INTO django_content_type VALUES (4, 'auth', 'user');
805 | INSERT INTO django_content_type VALUES (5, 'contenttypes', 'contenttype');
806 | INSERT INTO django_content_type VALUES (6, 'sessions', 'session');
807 | INSERT INTO django_content_type VALUES (7, 'ac_manager', 'baseconfig');
808 | INSERT INTO django_content_type VALUES (8, 'ac_manager', 'callrings');
809 | INSERT INTO django_content_type VALUES (9, 'ac_manager', 'calloutnumbers');
810 | INSERT INTO django_content_type VALUES (10, 'ac_manager', 'nwaycalltasks');
811 | INSERT INTO django_content_type VALUES (11, 'ac_manager', 'timeplan');
812 |
813 |
814 | --
815 | -- Name: django_content_type_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
816 | --
817 |
818 | SELECT pg_catalog.setval('django_content_type_id_seq', 11, true);
819 |
820 |
821 | --
822 | -- Data for Name: django_migrations; Type: TABLE DATA; Schema: public; Owner: postgres
823 | --
824 |
825 | INSERT INTO django_migrations VALUES (1, 'contenttypes', '0001_initial', '2015-06-21 18:30:09.359+08');
826 | INSERT INTO django_migrations VALUES (2, 'auth', '0001_initial', '2015-06-21 18:30:09.533+08');
827 | INSERT INTO django_migrations VALUES (3, 'admin', '0001_initial', '2015-06-21 18:30:09.588+08');
828 | INSERT INTO django_migrations VALUES (4, 'contenttypes', '0002_remove_content_type_name', '2015-06-21 18:30:09.642+08');
829 | INSERT INTO django_migrations VALUES (5, 'auth', '0002_alter_permission_name_max_length', '2015-06-21 18:30:09.667+08');
830 | INSERT INTO django_migrations VALUES (6, 'auth', '0003_alter_user_email_max_length', '2015-06-21 18:30:09.686+08');
831 | INSERT INTO django_migrations VALUES (7, 'auth', '0004_alter_user_username_opts', '2015-06-21 18:30:09.707+08');
832 | INSERT INTO django_migrations VALUES (8, 'auth', '0005_alter_user_last_login_null', '2015-06-21 18:30:09.725+08');
833 | INSERT INTO django_migrations VALUES (9, 'auth', '0006_require_contenttypes_0002', '2015-06-21 18:30:09.729+08');
834 | INSERT INTO django_migrations VALUES (10, 'sessions', '0001_initial', '2015-06-21 18:30:09.758+08');
835 |
836 |
837 | --
838 | -- Name: django_migrations_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
839 | --
840 |
841 | SELECT pg_catalog.setval('django_migrations_id_seq', 10, true);
842 |
843 |
844 | --
845 | -- Data for Name: django_session; Type: TABLE DATA; Schema: public; Owner: postgres
846 | --
847 |
848 | INSERT INTO django_session VALUES ('ueqapubui5gjtk3iy11n4m643nmfz0ts', 'MDQxZjBmNWFiMDAwOGYzYzM2MDdmNWE1MzVmMjFiOTBlNTgzNjM1NDp7Il9hdXRoX3VzZXJfaGFzaCI6IjAyMGE2ZGM2Mzg1MGEzZDg3Y2JlYmU1YWRkZWU4Yjg5MWQ1NzBkNzIiLCJfYXV0aF91c2VyX2JhY2tlbmQiOiJkamFuZ28uY29udHJpYi5hdXRoLmJhY2tlbmRzLk1vZGVsQmFja2VuZCIsIl9hdXRoX3VzZXJfaWQiOiIxIn0=', '2015-07-05 18:31:47.592+08');
849 | INSERT INTO django_session VALUES ('eh7jgnqezh741mmnc2c2ctgv4zktdrun', 'MDQxZjBmNWFiMDAwOGYzYzM2MDdmNWE1MzVmMjFiOTBlNTgzNjM1NDp7Il9hdXRoX3VzZXJfaGFzaCI6IjAyMGE2ZGM2Mzg1MGEzZDg3Y2JlYmU1YWRkZWU4Yjg5MWQ1NzBkNzIiLCJfYXV0aF91c2VyX2JhY2tlbmQiOiJkamFuZ28uY29udHJpYi5hdXRoLmJhY2tlbmRzLk1vZGVsQmFja2VuZCIsIl9hdXRoX3VzZXJfaWQiOiIxIn0=', '2015-07-07 14:15:38.234729+08');
850 | INSERT INTO django_session VALUES ('xy25vvgp58b7l4bagrjtrbic95xtlgqh', 'MDQxZjBmNWFiMDAwOGYzYzM2MDdmNWE1MzVmMjFiOTBlNTgzNjM1NDp7Il9hdXRoX3VzZXJfaGFzaCI6IjAyMGE2ZGM2Mzg1MGEzZDg3Y2JlYmU1YWRkZWU4Yjg5MWQ1NzBkNzIiLCJfYXV0aF91c2VyX2JhY2tlbmQiOiJkamFuZ28uY29udHJpYi5hdXRoLmJhY2tlbmRzLk1vZGVsQmFja2VuZCIsIl9hdXRoX3VzZXJfaWQiOiIxIn0=', '2015-07-07 14:56:53.278349+08');
851 |
852 |
853 | --
854 | -- Data for Name: nway_call_tasks; Type: TABLE DATA; Schema: public; Owner: postgres
855 | --
856 |
857 | INSERT INTO nway_call_tasks VALUES (1, 'lihaotest', '2015-06-23 07:59:00', '2015-06-28 07:59:00');
858 |
859 |
860 | --
861 | -- Name: nway_call_tasks_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
862 | --
863 |
864 | SELECT pg_catalog.setval('nway_call_tasks_id_seq', 1, true);
865 |
866 |
867 | --
868 | -- Data for Name: time_plan; Type: TABLE DATA; Schema: public; Owner: postgres
869 | --
870 |
871 | INSERT INTO time_plan VALUES (1, '07:50:00', '11:30:00');
872 | INSERT INTO time_plan VALUES (2, '13:00:00', '19:00:00');
873 |
874 |
875 | --
876 | -- Name: time_plan_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
877 | --
878 |
879 | SELECT pg_catalog.setval('time_plan_id_seq', 2, true);
880 |
881 |
882 | --
883 | -- Name: PK_CALLOUT_NUMBER; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
884 | --
885 |
886 | ALTER TABLE ONLY callout_numbers
887 | ADD CONSTRAINT "PK_CALLOUT_NUMBER" PRIMARY KEY (id);
888 |
889 |
890 | --
891 | -- Name: PK_CALL_RING_ID; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
892 | --
893 |
894 | ALTER TABLE ONLY call_rings
895 | ADD CONSTRAINT "PK_CALL_RING_ID" PRIMARY KEY (id);
896 |
897 |
898 | --
899 | -- Name: PK_CONFIG_NAME; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
900 | --
901 |
902 | ALTER TABLE ONLY base_config
903 | ADD CONSTRAINT "PK_CONFIG_NAME" PRIMARY KEY (config_name);
904 |
905 |
906 | --
907 | -- Name: PK_TASK_ID; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
908 | --
909 |
910 | ALTER TABLE ONLY nway_call_tasks
911 | ADD CONSTRAINT "PK_TASK_ID" PRIMARY KEY (id);
912 |
913 |
914 | --
915 | -- Name: PK_TIME_PLAN_ID; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
916 | --
917 |
918 | ALTER TABLE ONLY time_plan
919 | ADD CONSTRAINT "PK_TIME_PLAN_ID" PRIMARY KEY (id);
920 |
921 |
922 | --
923 | -- Name: auth_group_name_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
924 | --
925 |
926 | ALTER TABLE ONLY auth_group
927 | ADD CONSTRAINT auth_group_name_key UNIQUE (name);
928 |
929 |
930 | --
931 | -- Name: auth_group_permissions_group_id_permission_id_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
932 | --
933 |
934 | ALTER TABLE ONLY auth_group_permissions
935 | ADD CONSTRAINT auth_group_permissions_group_id_permission_id_key UNIQUE (group_id, permission_id);
936 |
937 |
938 | --
939 | -- Name: auth_group_permissions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
940 | --
941 |
942 | ALTER TABLE ONLY auth_group_permissions
943 | ADD CONSTRAINT auth_group_permissions_pkey PRIMARY KEY (id);
944 |
945 |
946 | --
947 | -- Name: auth_group_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
948 | --
949 |
950 | ALTER TABLE ONLY auth_group
951 | ADD CONSTRAINT auth_group_pkey PRIMARY KEY (id);
952 |
953 |
954 | --
955 | -- Name: auth_permission_content_type_id_codename_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
956 | --
957 |
958 | ALTER TABLE ONLY auth_permission
959 | ADD CONSTRAINT auth_permission_content_type_id_codename_key UNIQUE (content_type_id, codename);
960 |
961 |
962 | --
963 | -- Name: auth_permission_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
964 | --
965 |
966 | ALTER TABLE ONLY auth_permission
967 | ADD CONSTRAINT auth_permission_pkey PRIMARY KEY (id);
968 |
969 |
970 | --
971 | -- Name: auth_user_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
972 | --
973 |
974 | ALTER TABLE ONLY auth_user_groups
975 | ADD CONSTRAINT auth_user_groups_pkey PRIMARY KEY (id);
976 |
977 |
978 | --
979 | -- Name: auth_user_groups_user_id_group_id_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
980 | --
981 |
982 | ALTER TABLE ONLY auth_user_groups
983 | ADD CONSTRAINT auth_user_groups_user_id_group_id_key UNIQUE (user_id, group_id);
984 |
985 |
986 | --
987 | -- Name: auth_user_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
988 | --
989 |
990 | ALTER TABLE ONLY auth_user
991 | ADD CONSTRAINT auth_user_pkey PRIMARY KEY (id);
992 |
993 |
994 | --
995 | -- Name: auth_user_user_permissions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
996 | --
997 |
998 | ALTER TABLE ONLY auth_user_user_permissions
999 | ADD CONSTRAINT auth_user_user_permissions_pkey PRIMARY KEY (id);
1000 |
1001 |
1002 | --
1003 | -- Name: auth_user_user_permissions_user_id_permission_id_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
1004 | --
1005 |
1006 | ALTER TABLE ONLY auth_user_user_permissions
1007 | ADD CONSTRAINT auth_user_user_permissions_user_id_permission_id_key UNIQUE (user_id, permission_id);
1008 |
1009 |
1010 | --
1011 | -- Name: auth_user_username_key; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
1012 | --
1013 |
1014 | ALTER TABLE ONLY auth_user
1015 | ADD CONSTRAINT auth_user_username_key UNIQUE (username);
1016 |
1017 |
1018 | --
1019 | -- Name: django_admin_log_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
1020 | --
1021 |
1022 | ALTER TABLE ONLY django_admin_log
1023 | ADD CONSTRAINT django_admin_log_pkey PRIMARY KEY (id);
1024 |
1025 |
1026 | --
1027 | -- Name: django_content_type_app_label_3ec8c61c_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
1028 | --
1029 |
1030 | ALTER TABLE ONLY django_content_type
1031 | ADD CONSTRAINT django_content_type_app_label_3ec8c61c_uniq UNIQUE (app_label, model);
1032 |
1033 |
1034 | --
1035 | -- Name: django_content_type_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
1036 | --
1037 |
1038 | ALTER TABLE ONLY django_content_type
1039 | ADD CONSTRAINT django_content_type_pkey PRIMARY KEY (id);
1040 |
1041 |
1042 | --
1043 | -- Name: django_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
1044 | --
1045 |
1046 | ALTER TABLE ONLY django_migrations
1047 | ADD CONSTRAINT django_migrations_pkey PRIMARY KEY (id);
1048 |
1049 |
1050 | --
1051 | -- Name: django_session_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
1052 | --
1053 |
1054 | ALTER TABLE ONLY django_session
1055 | ADD CONSTRAINT django_session_pkey PRIMARY KEY (session_key);
1056 |
1057 |
1058 | --
1059 | -- Name: auth_group_name_331666e8_like; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
1060 | --
1061 |
1062 | CREATE INDEX auth_group_name_331666e8_like ON auth_group USING btree (name varchar_pattern_ops);
1063 |
1064 |
1065 | --
1066 | -- Name: auth_group_permissions_0e939a4f; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
1067 | --
1068 |
1069 | CREATE INDEX auth_group_permissions_0e939a4f ON auth_group_permissions USING btree (group_id);
1070 |
1071 |
1072 | --
1073 | -- Name: auth_group_permissions_8373b171; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
1074 | --
1075 |
1076 | CREATE INDEX auth_group_permissions_8373b171 ON auth_group_permissions USING btree (permission_id);
1077 |
1078 |
1079 | --
1080 | -- Name: auth_permission_417f1b1c; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
1081 | --
1082 |
1083 | CREATE INDEX auth_permission_417f1b1c ON auth_permission USING btree (content_type_id);
1084 |
1085 |
1086 | --
1087 | -- Name: auth_user_groups_0e939a4f; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
1088 | --
1089 |
1090 | CREATE INDEX auth_user_groups_0e939a4f ON auth_user_groups USING btree (group_id);
1091 |
1092 |
1093 | --
1094 | -- Name: auth_user_groups_e8701ad4; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
1095 | --
1096 |
1097 | CREATE INDEX auth_user_groups_e8701ad4 ON auth_user_groups USING btree (user_id);
1098 |
1099 |
1100 | --
1101 | -- Name: auth_user_user_permissions_8373b171; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
1102 | --
1103 |
1104 | CREATE INDEX auth_user_user_permissions_8373b171 ON auth_user_user_permissions USING btree (permission_id);
1105 |
1106 |
1107 | --
1108 | -- Name: auth_user_user_permissions_e8701ad4; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
1109 | --
1110 |
1111 | CREATE INDEX auth_user_user_permissions_e8701ad4 ON auth_user_user_permissions USING btree (user_id);
1112 |
1113 |
1114 | --
1115 | -- Name: auth_user_username_94b8aae_like; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
1116 | --
1117 |
1118 | CREATE INDEX auth_user_username_94b8aae_like ON auth_user USING btree (username varchar_pattern_ops);
1119 |
1120 |
1121 | --
1122 | -- Name: django_admin_log_417f1b1c; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
1123 | --
1124 |
1125 | CREATE INDEX django_admin_log_417f1b1c ON django_admin_log USING btree (content_type_id);
1126 |
1127 |
1128 | --
1129 | -- Name: django_admin_log_e8701ad4; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
1130 | --
1131 |
1132 | CREATE INDEX django_admin_log_e8701ad4 ON django_admin_log USING btree (user_id);
1133 |
1134 |
1135 | --
1136 | -- Name: django_session_de54fa62; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
1137 | --
1138 |
1139 | CREATE INDEX django_session_de54fa62 ON django_session USING btree (expire_date);
1140 |
1141 |
1142 | --
1143 | -- Name: django_session_session_key_630ca218_like; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
1144 | --
1145 |
1146 | CREATE INDEX django_session_session_key_630ca218_like ON django_session USING btree (session_key varchar_pattern_ops);
1147 |
1148 |
1149 | --
1150 | -- Name: FK_RING_ID; Type: FK CONSTRAINT; Schema: public; Owner: postgres
1151 | --
1152 |
1153 | ALTER TABLE ONLY callout_numbers
1154 | ADD CONSTRAINT "FK_RING_ID" FOREIGN KEY (call_ring_id) REFERENCES call_rings(id);
1155 |
1156 |
1157 | --
1158 | -- Name: auth_group_permiss_permission_id_23962d04_fk_auth_permission_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
1159 | --
1160 |
1161 | ALTER TABLE ONLY auth_group_permissions
1162 | ADD CONSTRAINT auth_group_permiss_permission_id_23962d04_fk_auth_permission_id FOREIGN KEY (permission_id) REFERENCES auth_permission(id) DEFERRABLE INITIALLY DEFERRED;
1163 |
1164 |
1165 | --
1166 | -- Name: auth_group_permissions_group_id_58c48ba9_fk_auth_group_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
1167 | --
1168 |
1169 | ALTER TABLE ONLY auth_group_permissions
1170 | ADD CONSTRAINT auth_group_permissions_group_id_58c48ba9_fk_auth_group_id FOREIGN KEY (group_id) REFERENCES auth_group(id) DEFERRABLE INITIALLY DEFERRED;
1171 |
1172 |
1173 | --
1174 | -- Name: auth_permiss_content_type_id_51277a81_fk_django_content_type_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
1175 | --
1176 |
1177 | ALTER TABLE ONLY auth_permission
1178 | ADD CONSTRAINT auth_permiss_content_type_id_51277a81_fk_django_content_type_id FOREIGN KEY (content_type_id) REFERENCES django_content_type(id) DEFERRABLE INITIALLY DEFERRED;
1179 |
1180 |
1181 | --
1182 | -- Name: auth_user_groups_group_id_30a071c9_fk_auth_group_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
1183 | --
1184 |
1185 | ALTER TABLE ONLY auth_user_groups
1186 | ADD CONSTRAINT auth_user_groups_group_id_30a071c9_fk_auth_group_id FOREIGN KEY (group_id) REFERENCES auth_group(id) DEFERRABLE INITIALLY DEFERRED;
1187 |
1188 |
1189 | --
1190 | -- Name: auth_user_groups_user_id_24702650_fk_auth_user_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
1191 | --
1192 |
1193 | ALTER TABLE ONLY auth_user_groups
1194 | ADD CONSTRAINT auth_user_groups_user_id_24702650_fk_auth_user_id FOREIGN KEY (user_id) REFERENCES auth_user(id) DEFERRABLE INITIALLY DEFERRED;
1195 |
1196 |
1197 | --
1198 | -- Name: auth_user_user_per_permission_id_3d7071f0_fk_auth_permission_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
1199 | --
1200 |
1201 | ALTER TABLE ONLY auth_user_user_permissions
1202 | ADD CONSTRAINT auth_user_user_per_permission_id_3d7071f0_fk_auth_permission_id FOREIGN KEY (permission_id) REFERENCES auth_permission(id) DEFERRABLE INITIALLY DEFERRED;
1203 |
1204 |
1205 | --
1206 | -- Name: auth_user_user_permissions_user_id_7cd7acb6_fk_auth_user_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
1207 | --
1208 |
1209 | ALTER TABLE ONLY auth_user_user_permissions
1210 | ADD CONSTRAINT auth_user_user_permissions_user_id_7cd7acb6_fk_auth_user_id FOREIGN KEY (user_id) REFERENCES auth_user(id) DEFERRABLE INITIALLY DEFERRED;
1211 |
1212 |
1213 | --
1214 | -- Name: django_admin_content_type_id_5151027a_fk_django_content_type_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
1215 | --
1216 |
1217 | ALTER TABLE ONLY django_admin_log
1218 | ADD CONSTRAINT django_admin_content_type_id_5151027a_fk_django_content_type_id FOREIGN KEY (content_type_id) REFERENCES django_content_type(id) DEFERRABLE INITIALLY DEFERRED;
1219 |
1220 |
1221 | --
1222 | -- Name: django_admin_log_user_id_1c5f563_fk_auth_user_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
1223 | --
1224 |
1225 | ALTER TABLE ONLY django_admin_log
1226 | ADD CONSTRAINT django_admin_log_user_id_1c5f563_fk_auth_user_id FOREIGN KEY (user_id) REFERENCES auth_user(id) DEFERRABLE INITIALLY DEFERRED;
1227 |
1228 |
1229 | --
1230 | -- Name: public; Type: ACL; Schema: -; Owner: postgres
1231 | --
1232 |
1233 | REVOKE ALL ON SCHEMA public FROM PUBLIC;
1234 | REVOKE ALL ON SCHEMA public FROM postgres;
1235 | GRANT ALL ON SCHEMA public TO postgres;
1236 | GRANT ALL ON SCHEMA public TO PUBLIC;
1237 |
1238 |
1239 | --
1240 | -- PostgreSQL database dump complete
1241 | --
1242 |
1243 |
--------------------------------------------------------------------------------
/nway_ac/.idea/workspace.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 | C:\Users\lihao\AppData\Roaming\Subversion
435 | 125
436 |
437 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
455 |
456 |
457 |
458 | 1434880011631
459 | 1434880011631
460 |
461 |
462 |
463 |
464 |
465 |
466 |
467 |
468 |
469 |
470 |
471 |
472 |
473 |
474 |
475 |
476 |
477 |
478 |
479 |
480 |
481 |
482 |
483 |
484 |
485 |
486 |
487 |
488 |
489 |
490 |
491 |
492 |
493 |
494 |
495 |
496 |
497 |
498 |
499 |
500 |
501 |
502 |
503 |
504 |
505 |
506 |
507 | file://$PROJECT_DIR$/nway_ac/urls.py
508 | 15
509 |
510 |
511 |
512 |
513 |
514 |
515 |
516 |
517 |
518 |
519 |
520 |
521 |
522 |
523 |
524 |
525 |
526 |
527 |
528 |
529 |
530 |
531 |
532 |
533 |
534 |
535 |
536 |
537 |
538 |
539 |
540 |
541 |
542 |
543 |
544 |
545 |
546 |
547 |
548 |
549 |
550 |
551 |
552 |
553 |
554 |
555 |
556 |
557 |
558 |
559 |
560 |
561 |
562 |
563 |
564 |
565 |
566 |
567 |
568 |
569 |
570 |
571 |
572 |
573 |
574 |
575 |
576 |
577 |
578 |
579 |
580 |
581 |
582 |
583 |
584 |
585 |
586 |
587 |
588 |
589 |
590 |
591 |
592 |
593 |
594 |
595 |
596 |
597 |
598 |
599 |
600 |
601 |
602 |
603 |
604 |
605 |
606 |
607 |
608 |
609 |
610 |
611 |
612 |
613 |
614 |
615 |
616 |
617 |
618 |
619 |
620 |
621 |
622 |
623 |
624 |
625 |
626 |
627 |
628 |
629 |
630 |
631 |
632 |
633 |
634 |
635 |
636 |
637 |
638 |
639 |
640 |
641 |
642 |
643 |
644 |
645 |
646 |
647 |
648 |
649 |
650 |
651 |
652 |
653 |
654 |
655 |
656 |
657 |
658 |
659 |
660 |
661 |
662 |
663 |
664 |
665 |
666 |
667 |
668 |
669 |
670 |
671 |
672 |
673 |
674 |
675 |
676 |
677 |
678 |
679 |
680 |
681 |
682 |
683 |
684 |
685 |
686 |
687 |
688 |
689 |
690 |
691 |
692 |
693 |
694 |
695 |
696 |
697 |
698 |
699 |
700 |
701 |
702 |
703 |
704 |
705 |
706 |
707 |
708 |
709 |
710 |
711 |
712 |
713 |
714 |
715 |
716 |
717 |
718 |
719 |
720 |
721 |
722 |
723 |
724 |
725 |
726 |
727 |
728 |
729 |
730 |
731 |
732 |
733 |
734 |
735 |
736 |
737 |
738 |
739 |
740 |
741 |
742 |
743 |
744 |
745 |
746 |
747 |
748 |
749 |
750 |
751 |
752 |
753 |
754 |
755 |
756 |
757 |
758 |
759 |
760 |
761 |
762 |
763 |
764 |
765 |
766 |
767 |
768 |
769 |
770 |
771 |
772 |
773 |
774 |
775 |
776 |
777 |
778 |
779 |
780 |
781 |
782 |
783 |
784 |
785 |
786 |
787 |
788 |
789 |
790 |
791 |
792 |
793 |
794 |
795 |
796 |
797 |
798 |
799 |
800 |
801 |
802 |
803 |
804 |
805 |
806 |
807 |
808 |
809 |
810 |
811 |
812 |
813 |
814 |
815 |
816 |
817 |
818 |
819 |
820 |
821 |
822 |
823 |
824 |
825 |
826 |
827 |
828 |
829 |
830 |
831 |
832 |
833 |
834 |
835 |
836 |
837 |
838 |
839 |
840 |
841 |
842 |
843 |
844 |
845 |
846 |
847 |
848 |
849 |
850 |
851 |
852 |
853 |
854 |
855 |
856 |
857 |
858 |
859 |
860 |
861 |
862 |
863 |
864 |
865 |
866 |
867 |
868 |
869 |
870 |
871 |
872 |
873 |
874 |
875 |
876 |
877 |
878 |
879 |
880 |
881 |
882 |
883 |
884 |
885 |
886 |
887 |
888 |
889 |
890 |
891 |
892 |
893 |
894 |
895 |
896 |
897 |
898 |
899 |
900 |
901 |
902 |
903 |
904 |
905 |
906 |
907 |
908 |
909 |
910 |
911 |
912 |
913 |
914 |
915 |
916 |
917 |
918 |
919 |
920 |
921 |
922 |
923 |
924 |
925 |
926 |
927 |
928 |
929 |
930 |
931 |
932 |
933 |
934 |
935 |
936 |
937 |
938 |
939 |
940 |
941 |
942 |
943 |
944 |
945 |
946 |
947 |
948 |
949 |
950 |
951 |
952 |
953 |
954 |
955 |
956 |
957 |
958 |
959 |
960 |
961 |
962 |
963 |
964 |
965 |
966 |
967 |
968 |
969 |
970 |
971 |
972 |
973 |
974 |
975 |
976 |
977 |
978 |
979 |
980 |
981 |
982 |
--------------------------------------------------------------------------------