chan-sccp-b: 74/head
authorDiederik de Groot <ddegroot@talon.nl>
Thu, 25 Jun 2015 15:28:59 +0000 (17:28 +0200)
committerDiederik de Groot <ddegroot@talon.nl>
Thu, 25 Jun 2015 15:28:59 +0000 (17:28 +0200)
 - Update revision to point to stable V4.2 release
 - Add sqlite3 realtime example files

net/chan-sccp-b/Makefile
net/chan-sccp-b/files/extconfig.conf.sccp_sample [new file with mode: 0644]
net/chan-sccp-b/files/res_config_sqlite3.conf.sccp_sample [new file with mode: 0644]
net/chan-sccp-b/files/sccp.conf
net/chan-sccp-b/files/sccp.conf.realtime_sample [new file with mode: 0644]
net/chan-sccp-b/files/sccp_sqlite3.sql [new file with mode: 0644]

index 09ce0b2c17fe1cde4a1c5eb494a50ba1cde4b847..9a2399e9c84f592312a728caf0c9beb9bfb7eb7d 100644 (file)
@@ -9,12 +9,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=chan-sccp-b
-PKG_REV:=5845
+PKG_REV:=6139
 PKG_VERSION:=v4.2-r$(PKG_REV)
-PKG_RELEASE:=1
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://svn.code.sf.net/p/chan-sccp-b/code/tags/openwrt
+PKG_SOURCE_URL:=http://svn.code.sf.net/p/chan-sccp-b/code/branches/V4.2
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_VERSION:=$(PKG_REV)
 PKG_SOURCE_PROTO:=svn
@@ -77,6 +77,10 @@ endif
 
 define Package/conffiles/Default
 /etc/asterisk/sccp.conf
+/etc/asterisk/extconfig.conf.sccp_sample
+/etc/asterisk/res_config_sqlite3.conf.sccp_sample
+/etc/asterisk/sccp_sqlite3.sql
+/etc/asterisk/sccp.conf.realtime_sample
 endef
 
 Package/asterisk18-chan-sccp-b/conffiles = $(Package/conffiles/Default)
@@ -95,6 +99,13 @@ define Package/Install/Default
        $(CP) ./files/sccp.conf $(1)/etc/asterisk/sccp.conf
        $(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_sccp.so $(1)/usr/lib/asterisk/modules/
+       if [ -f /usr/bin/sqlite3 ]; then
+               $(CP) ./files/extconfig.conf.sccp_sample $(1)/etc/asterisk/extconfig.conf.sccp_sample
+               $(CP) ./files/res_config_sqlite3.conf.sccp_sample $(1)/etc/asterisk/res_config_sqlite3.conf.sccp_sample
+               $(CP) ./files/sccp_sqlite3.sql $(1)/etc/asterisk/sccp_sqlite3.sql
+               $(CP) ./files/sccp.conf.realtime_sample $(1)/etc/asterisk/sccp.conf.realtime_sample
+               /usr/bin/sqlite3 /usr/lib/asterisk/realtime.sqlite3 < /etc/asterisk/sccp_sqlite3.sql
+       fi
 endef
 
 Package/asterisk18-chan-sccp-b/install = $(Package/Install/Default)
diff --git a/net/chan-sccp-b/files/extconfig.conf.sccp_sample b/net/chan-sccp-b/files/extconfig.conf.sccp_sample
new file mode 100644 (file)
index 0000000..18b0e34
--- /dev/null
@@ -0,0 +1,3 @@
+[settings]
+sccpdevice => sqlite3,asterisk,sccpdeviceconfig
+sccpline => sqlite3,asterisk,sccpline
diff --git a/net/chan-sccp-b/files/res_config_sqlite3.conf.sccp_sample b/net/chan-sccp-b/files/res_config_sqlite3.conf.sccp_sample
new file mode 100644 (file)
index 0000000..a237d47
--- /dev/null
@@ -0,0 +1,5 @@
+[asterisk]
+dbfile => /usr/lib/asterisk/realtime.sqlite3
+debug=yes
+requirements=warn
+;batch=1000
index 5aa96afa5ceb4473328f0e9c968492c59fc25b9d..abc57f98f7e7e0d5bfb10686a41990379c9ba9fd 100644 (file)
@@ -44,7 +44,7 @@ allow = alaw
 allow = gsm
 directrtp = on
 
-[SEP00a1a2a3a4a5]
+[SEP00A1B2C3D4E5]
 type = device
 description = Phone Number Two
 devicetype = 7960
diff --git a/net/chan-sccp-b/files/sccp.conf.realtime_sample b/net/chan-sccp-b/files/sccp.conf.realtime_sample
new file mode 100644 (file)
index 0000000..cb65e85
--- /dev/null
@@ -0,0 +1,30 @@
+[general]
+servername = Openwrt
+keepalive = 60
+debug = core
+context = default
+dateformat = D/M/Y
+bindaddr = ::
+port = 2000
+disallow = all
+allow = ulaw 
+allow = alaw
+allow = g729
+firstdigittimeout = 16
+digittimeout = 6
+autoanswer_ring_time = 1
+transfer_on_hangup = off
+musicclass = default
+language = en
+deny = 0.0.0.0/0.0.0.0
+permit = internal
+dndFeature = on
+echocancel = off
+silencesuppression = off
+
+hotline_enabled = yes
+hotline_context = default
+hotline_extension = 111
+
+devicetable = sccpdevice
+linetable = sccpline
diff --git a/net/chan-sccp-b/files/sccp_sqlite3.sql b/net/chan-sccp-b/files/sccp_sqlite3.sql
new file mode 100644 (file)
index 0000000..60e2adb
--- /dev/null
@@ -0,0 +1,123 @@
+/*
+ * this is for users how like to sepatet device and button configuration
+ * You have to change the table names to:
+ *
+ * sccpdevices -> sccpdeviceconfig
+ * sccplines -> sccpline  
+*/
+
+PRAGMA auto_vacuum=2;
+--
+-- Table with line-configuration
+--
+CREATE TABLE sccpdevice (
+  type                                 varchar(45)     DEFAULT NULL,
+  addon                        varchar(45)     DEFAULT NULL,
+  description                  varchar(45)     DEFAULT NULL,
+  tzoffset                     varchar(5)      DEFAULT NULL,
+  transfer                     varchar(5)      DEFAULT 'on',
+  cfwdall                      varchar(5)      DEFAULT 'on',
+  cfwdbusy                     varchar(5)      DEFAULT 'on',
+  imageversion                 varchar(45)     DEFAULT NULL,
+  deny                                 varchar(45)     DEFAULT NULL,
+  permit                       varchar(45)     DEFAULT NULL,
+  dndFeature                   varchar(5)      DEFAULT 'on',
+  directrtp                    varchar(3)      DEFAULT 'off',
+  earlyrtp                     varchar(8)      DEFAULT 'off',
+  mwilamp                      varchar(5)      DEFAULT 'on',
+  mwioncall                    varchar(5)      DEFAULT 'off',
+  pickupexten                  varchar(5)      DEFAULT 'on',
+  pickupcontext                varchar(100)    DEFAULT '',
+  pickupmodeanswer             varchar(5)      DEFAULT 'on',
+  private                      varchar(5)      DEFAULT 'off',
+  privacy                      varchar(100)    DEFAULT 'full',
+  nat                          varchar(4)      DEFAULT 'auto',
+  softkeyset                   varchar(100)    DEFAULT '',
+  audio_tos                    varchar(11)     DEFAULT NULL,
+  audio_cos                    varchar(1)      DEFAULT NULL,
+  video_tos                    varchar(11)     DEFAULT NULL,
+  video_cos                    varchar(1)      DEFAULT NULL,
+  conf_allow                   varchar(3)      DEFAULT 'on',
+  conf_play_general_announce   varchar(3)      DEFAULT 'on',
+  conf_play_part_announce      varchar(3)      DEFAULT 'on',   
+  conf_mute_on_entry           varchar(3)      DEFAULT 'off',
+  conf_music_on_hold_class      varchar(80)    DEFAULT 'default',
+  conf_show_conflist            varchar(3)      DEFAULT 'on',
+  backgroundImage              varchar(255)    DEFAULT '',
+  ringtone                     varchar(255)    DEFAULT '',
+  setvar                       varchar(100)    DEFAULT NULL,
+  disallow                     varchar(255)    DEFAULT NULL,
+  allow                        varchar(255)    DEFAULT NULL,
+  name                                 varchar(15)     NOT NULL DEFAULT '',
+  PRIMARY KEY  (name)
+);
+
+--
+-- Table with device-configuration
+--
+CREATE TABLE sccpline (
+  id                           varchar(4)      DEFAULT NULL,
+  pin                          varchar(45)     DEFAULT NULL,
+  label                        varchar(45)     DEFAULT NULL,
+  description                  varchar(45)     DEFAULT NULL,
+  context                      varchar(45)     DEFAULT NULL,
+  incominglimit                        varchar(45)     DEFAULT NULL,
+  transfer                     varchar(45)     DEFAULT NULL,
+  mailbox                      varchar(45)     DEFAULT NULL,
+  vmnum                        varchar(45)     DEFAULT NULL,
+  cid_name                     varchar(45)     DEFAULT NULL,
+  cid_num                      varchar(45)     DEFAULT NULL,
+  trnsfvm                      varchar(45)     DEFAULT NULL,
+  secondary_dialtone_digits    varchar(45)     DEFAULT NULL,
+  secondary_dialtone_tone      varchar(45)     DEFAULT NULL,
+  musicclass                   varchar(45)     DEFAULT NULL,
+  language                     varchar(45)     DEFAULT NULL,
+  accountcode                  varchar(45)     DEFAULT NULL,
+  echocancel                   varchar(45)     DEFAULT NULL,
+  silencesuppression           varchar(45)     DEFAULT NULL,
+  callgroup                    varchar(45)     DEFAULT NULL,
+  pickupgroup                  varchar(45)     DEFAULT NULL,
+  namedcallgroup               varchar(45)     DEFAULT NULL,
+  namedpickupgroup             varchar(45)     DEFAULT NULL,
+  dnd                          varchar(7)      DEFAULT 'reject',
+  amaflags                     varchar(45)     DEFAULT NULL,
+  defaultSubscriptionId_number         varchar(5)      DEFAULT NULL,
+  setvar                       varchar(50)     DEFAULT NULL,
+  name                                 varchar(45)     NOT NULL DEFAULT '',
+  PRIMARY KEY  (name)
+);
+
+CREATE TABLE buttontype (
+  type                                 varchar(9)      DEFAULT NULL,
+  PRIMARY KEY (type)
+);
+
+INSERT INTO buttontype (type) VALUES ('line');
+INSERT INTO buttontype (type) VALUES ('speeddial');
+INSERT INTO buttontype (type) VALUES ('service');
+INSERT INTO buttontype (type) VALUES ('feature');
+INSERT INTO buttontype (type) VALUES ('empty');
+--
+-- Table with button-configuration for device
+--
+CREATE TABLE buttonconfig (
+  device                       varchar(15)     NOT NULL DEFAULT '',
+  instance                     tinyint(4)      NOT NULL DEFAULT '0',
+  type                                 varchar(9),
+  name                                 varchar(36)     DEFAULT NULL,
+  options                      varchar(100)    DEFAULT NULL,
+  PRIMARY KEY  (device,instance),
+  FOREIGN KEY (device) REFERENCES sccpdevice (device),
+  FOREIGN KEY (type) REFERENCES buttontype (type) 
+);
+
+--
+-- View for merging device and button configuration
+--
+CREATE VIEW sccpdeviceconfig AS 
+       SELECT  sccpdevice.*, 
+               group_concat(buttonconfig.type||","||buttonconfig.name||","||buttonconfig.options,";") as button 
+       FROM buttonconfig, sccpdevice 
+       WHERE buttonconfig.device=sccpdevice.name 
+       GROUP BY sccpdevice.name
+       ORDER BY sccpdevice.name, buttonconfig.instance;