From: <abe...@us...> - 2013-03-11 15:13:01
|
Revision: 5986 http://astlinux.svn.sourceforge.net/astlinux/?rev=5986&view=rev Author: abelbeck Date: 2013-03-11 15:12:51 +0000 (Mon, 11 Mar 2013) Log Message: ----------- web interface, SQL-Data tab, add topic help text, tweak default SQL schema, reduce size of left navigation, Thanks to Michael Keuter Modified Paths: -------------- branches/1.0/package/webinterface/altweb/common/phpliteadmin.css branches/1.0/package/webinterface/altweb/common/sqldata.sql branches/1.0/package/webinterface/altweb/common/topics.info Modified: branches/1.0/package/webinterface/altweb/common/phpliteadmin.css =================================================================== --- branches/1.0/package/webinterface/altweb/common/phpliteadmin.css 2013-03-11 04:00:21 UTC (rev 5985) +++ branches/1.0/package/webinterface/altweb/common/phpliteadmin.css 2013-03-11 15:12:51 UTC (rev 5986) @@ -56,7 +56,7 @@ #container { padding:10px; } /* div of left box with log, list of databases, etc. */ #leftNav{ - float:left; width:250px; padding:0px; + float:left; width:200px; padding:0px; border:#3B3B3B 1px solid; background-color:#FFF; padding-bottom:15px; border-radius:5px; -moz-border-radius:5px; -webkit-box-shadow: 2px 2px 2px 2px rgba(33, 33, 33, 0.5); @@ -139,4 +139,4 @@ #tt{ position:absolute; display:block; } #tttop { display:block; height:5px; margin-left:5px; overflow:hidden } #ttcont { display:block; padding:2px 12px 3px 7px; margin-left:5px; background:#f3cece; color:#333 } -#ttbot { display:block; height:5px; margin-left:5px; overflow:hidden } \ No newline at end of file +#ttbot { display:block; height:5px; margin-left:5px; overflow:hidden } Modified: branches/1.0/package/webinterface/altweb/common/sqldata.sql =================================================================== --- branches/1.0/package/webinterface/altweb/common/sqldata.sql 2013-03-11 04:00:21 UTC (rev 5985) +++ branches/1.0/package/webinterface/altweb/common/sqldata.sql 2013-03-11 15:12:51 UTC (rev 5986) @@ -4,13 +4,13 @@ 'sipuser' TEXT NOT NULL, 'lastname' TEXT, 'firstname' TEXT, - 'out_contextid' INTEGER DEFAULT 7, + 'out_cxid' INTEGER DEFAULT 7, 'vm' INTEGER DEFAULT 0, - 'mailbox' TEXT, + 'vmbox' TEXT, 'email' TEXT, - 'exten_intern' TEXT, - 'exten_exten' TEXT, - 'fax_number' TEXT, + 'ext_intern' TEXT, + 'ext_extern' TEXT, + 'fax_ext' TEXT, 'fax_email' TEXT, 'xmpp_jid' TEXT ); @@ -23,8 +23,8 @@ CREATE TABLE IF NOT EXISTS 'ip_phones' ( 'phone_id' INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - 'phone_type1' TEXT, - 'phone_fw1' TEXT, + 'phone_type' TEXT, + 'phone_fw' TEXT, 'phone_ip' TEXT, 'phone_mac' TEXT, 'userid' INTEGER Modified: branches/1.0/package/webinterface/altweb/common/topics.info =================================================================== --- branches/1.0/package/webinterface/altweb/common/topics.info 2013-03-11 04:00:21 UTC (rev 5985) +++ branches/1.0/package/webinterface/altweb/common/topics.info 2013-03-11 15:12:51 UTC (rev 5986) @@ -288,7 +288,46 @@ SQL-Data Tab: +The SQL-Data Tab adds a web dialog to edit the SQLite3 database (added in AstLinux 1.1.1). +The database exists in "/mnt/kd/asterisk-odbc.sqlite3". +The Prefs tab contains a relevant option under "SQL-Data Tab Options:". + +The "Create default SIP & Phone SQL Schema if not defined" (checked by default), +automatically creates the default table structure for the SQLite3 database. + +You can access the database via Asterisk with user defined "func_odbc" functions, where +you can define customized database queries and more. A quite universal example for an entry +in the "func_odbc.conf" would be: + +Credit: Michael Keuter +---- /etc/asterisk/func_odbc.conf snippet ---- + +[SIPUSERS] +dsn=asterisk +readsql=SELECT ${SQL_ESC(${ARG1})} FROM sip_users WHERE ${SQL_ESC(${ARG2})}='${SQL_ESC(${ARG3})}' + +---- /etc/asterisk/func_odbc.conf snippet ---- + +For example, if you want to find the SIP-user belonging to the internal extension "101" +(as defined in your database), this could be accessed in the Asterisk dialplan +like this: + +---- /etc/asterisk/extensions.conf snippet ---- + +; ODBC Test +exten => 999,1,NoOp(ODBC Query Test) +; +; ODBC_SIPUSERS: SELECT ARG1 FROM sip_users WHERE ARG2=ARG3 +; in the case: SELECT sipuser FROM sip_users WHERE ext_intern=101 +; +same => n,Set(val=${ODBC_SIPUSERS(sipuser,ext_intern,101)}) +same => n,NoOp(ODBC-ReturnValue: ${val}) +same => n,Hangup() + +---- /etc/asterisk/extensions.conf snippet ---- + + [[xmpp-shared-groups]] XMPP Shared Groups: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |