From 1b147b009412a42a3b8664dea5cb0b89b4e68ca2 Mon Sep 17 00:00:00 2001
From: Tilghman Lesher <tilghman@meg.abyt.es>
Date: Thu, 10 Sep 2009 23:12:16 +0000
Subject: Make calltoken support work with realtime users and peers. In the
 course of this, I also found that the results of ast_gethostbyname were being
 used incorrectly in both chan_iax2 and chan_sip, so both have been fixed.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@217916 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 contrib/scripts/iax-friends.sql | 89 +++++++++++++++++++++--------------------
 1 file changed, 46 insertions(+), 43 deletions(-)

(limited to 'contrib/scripts/iax-friends.sql')

diff --git a/contrib/scripts/iax-friends.sql b/contrib/scripts/iax-friends.sql
index 9f8cd5ccd..a83d8ce46 100644
--- a/contrib/scripts/iax-friends.sql
+++ b/contrib/scripts/iax-friends.sql
@@ -4,51 +4,54 @@
 
 CREATE TABLE `iaxfriends` (
   `name` varchar(40) NOT NULL default '',
-  `username` varchar(40) NOT NULL default '',
-  `secret` varchar(40) NOT NULL default '',
-  `dbsecret` varchar(40) NOT NULL default '',
-  `context` varchar(40) NOT NULL default '',
-  `regcontext` varchar(40) NOT NULL default '',
-  `host` varchar(40) NOT NULL default 'dynamic',
-  `ipaddr` varchar(20) NOT NULL default '',
-  `port` int(6) NOT NULL default '0',
-  `defaultip` varchar(20) NOT NULL default '',
-  `sourceaddress` varchar(20) NOT NULL default '',
-  `mask` varchar(20) NOT NULL default '',
-  `regexten` varchar(40) NOT NULL default '',
-  `regseconds` int(11) NOT NULL default '0',
-  `accountcode` varchar(20) NOT NULL default '', 
-  `mohinterpret` varchar(20) NOT NULL default '', 
-  `mohsuggest` varchar(20) NOT NULL default '', 
-  `inkeys` varchar(40) NOT NULL default '', 
-  `outkey` varchar(40) NOT NULL default '', 
-  `language` varchar(10) NOT NULL default '', 
-  `callerid` varchar(40) NOT NULL default '', 
-  `cid_number` varchar(40) NOT NULL default '', 
-  `sendani` varchar(10) NOT NULL default '', 
-  `fullname` varchar(40) NOT NULL default '', 
-  `trunk` varchar(10) NOT NULL default '', 
-  `auth` varchar(20) NOT NULL default '', 
-  `maxauthreq` varchar(15) NOT NULL default '', 
-  `encryption` varchar(20) NOT NULL default '', 
-  `transfer` varchar(10) NOT NULL default '', 
-  `jitterbuffer` varchar(10) NOT NULL default '', 
-  `forcejitterbuffer` varchar(10) NOT NULL default '', 
-  `disallow` varchar(40) NOT NULL default 'all', 
-  `allow` varchar(40) NOT NULL default '', 
-  `codecpriority` varchar(40) NOT NULL default '', 
-  `qualify` varchar(10) NOT NULL default '', 
-  `qualifysmoothing` varchar(10) NOT NULL default '', 
-  `qualifyfreqok` varchar(10) NOT NULL default '', 
-  `qualifyfreqnotok` varchar(10) NOT NULL default '', 
-  `timezone` varchar(20) NOT NULL default '', 
-  `adsi` varchar(10) NOT NULL default '', 
-  `amaflags` varchar(20) NOT NULL default '', 
-  `setvar` varchar(200) NOT NULL default '', 
+  `type` varchar(10) NOT NULL default 'friend', -- friend/user/peer
+  `username` varchar(40) NULL, -- username to send as peer
+  `mailbox` varchar(40) NULL, -- mailbox@context
+  `secret` varchar(40) NULL,
+  `dbsecret` varchar(40) NULL, -- In AstDB, location to store/retrieve secret
+  `context` varchar(40) NULL,
+  `regcontext` varchar(40) NULL,
+  `host` varchar(40) NULL default 'dynamic',
+  `ipaddr` varchar(20) NULL, -- Must be updateable by Asterisk user
+  `port` int(5) NULL, -- Must be updateable by Asterisk user
+  `defaultip` varchar(20) NULL,
+  `sourceaddress` varchar(20) NULL,
+  `mask` varchar(20) NULL,
+  `regexten` varchar(40) NULL,
+  `regseconds` int(11) NULL, -- Must be updateable by Asterisk user
+  `accountcode` varchar(20) NULL, 
+  `mohinterpret` varchar(20) NULL, 
+  `mohsuggest` varchar(20) NULL, 
+  `inkeys` varchar(40) NULL, 
+  `outkey` varchar(40) NULL, 
+  `language` varchar(10) NULL, 
+  `callerid` varchar(100) NULL, -- The whole callerid string, or broken down in the next 3 fields
+  `cid_number` varchar(40) NULL, -- The number portion of the callerid
+  `sendani` varchar(10) NULL, -- yes/no
+  `fullname` varchar(40) NULL, -- The name portion of the callerid
+  `trunk` varchar(3) NULL, -- Yes/no
+  `auth` varchar(20) NULL, -- RSA/md5/plaintext
+  `maxauthreq` varchar(5) NULL, -- Maximum outstanding AUTHREQ calls {1-32767}
+  `requirecalltoken` varchar(4) NULL, -- yes/no/auto
+  `encryption` varchar(20) NULL, -- aes128/yes/no
+  `transfer` varchar(10) NULL, -- mediaonly/yes/no
+  `jitterbuffer` varchar(3) NULL, -- yes/no
+  `forcejitterbuffer` varchar(3) NULL, -- yes/no
+  `disallow` varchar(40) NULL, -- all/{list-of-codecs}
+  `allow` varchar(40) NULL, -- all/{list-of-codecs}
+  `codecpriority` varchar(40) NULL, 
+  `qualify` varchar(10) NULL, -- yes/no/{number of milliseconds}
+  `qualifysmoothing` varchar(10) NULL, -- yes/no
+  `qualifyfreqok` varchar(10) NULL, -- {number of milliseconds}|60000
+  `qualifyfreqnotok` varchar(10) NULL, -- {number of milliseconds}|10000
+  `timezone` varchar(20) NULL, 
+  `adsi` varchar(10) NULL, -- yes/no
+  `amaflags` varchar(20) NULL, 
+  `setvar` varchar(200) NULL, 
   PRIMARY KEY  (`name`),
   INDEX name (name, host),
   INDEX name2 (name, ipaddr, port),
   INDEX ipaddr (ipaddr, port),
-  INDEX host (host, port),
-) TYPE=MyISAM;
+  INDEX host (host, port)
+);
 
-- 
cgit v1.2.3

