Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

Asterisk Installing

sudo apt-get update
sudo apt-get install asterisk asterisk-mysql

Ubuntu 10.04 has broken asterisk-mysql version:

aptitude purge asterisk-mysql
cd /tmp
apt-get build-dep asterisk-mysql
apt-get -b source asterisk-mysql
dpkg -i asterisk-mysql_1.6.2.0-1_i386.deb

Now we should enable asterisk mysql realtime module.

Add string “load => res_config_mysql.so” to file /etc/asterisk/modules.conf
into the “modules” section.

Openmeetings will create mysql tables required for asterisk at install.
If we will manage asterisk manually, we need to create tables in mysql
By default openmeetings creates tables:

USE openmeetings;

CREATE TABLE `sipusers` (
 `id` int(11) NOT NULL AUTO_INCREMENT,
 `accountcode` varchar(20) DEFAULT NULL,
 `disallow` varchar(100) DEFAULT 'all',
 `allow` varchar(100) DEFAULT 'g729;ilbc;gsm;ulaw;alaw',
 `allowoverlap` enum('yes','no') DEFAULT 'yes',
 `allowsubscribe` enum('yes','no') DEFAULT 'yes',
 `allowtransfer` varchar(3) DEFAULT NULL,
 `amaflags` varchar(13) DEFAULT NULL,
 `autoframing` varchar(3) DEFAULT NULL,
 `auth` varchar(40) DEFAULT NULL,
 `buggymwi` enum('yes','no') DEFAULT 'no',
 `callgroup` varchar(10) DEFAULT NULL,
 `callerid` varchar(80) DEFAULT NULL,
 `cid_number` varchar(40) DEFAULT NULL,
 `fullname` varchar(40) DEFAULT NULL,
 `call-limit` int(8) DEFAULT '0',
 `callingpres` varchar(80) DEFAULT NULL,
 `canreinvite` char(6) DEFAULT 'yes',
 `context` varchar(80) DEFAULT NULL,
 `defaultip` varchar(15) DEFAULT NULL,
 `dtmfmode` varchar(7) DEFAULT NULL,
 `fromuser` varchar(80) DEFAULT NULL,
 `fromdomain` varchar(80) DEFAULT NULL,
 `fullcontact` varchar(80) DEFAULT NULL,
 `g726nonstandard` enum('yes','no') DEFAULT 'no',
 `host` varchar(31) NOT NULL DEFAULT '',
 `insecure` varchar(20) DEFAULT NULL,
 `ipaddr` varchar(15) NOT NULL DEFAULT '',
 `language` char(2) DEFAULT NULL,
 `lastms` varchar(20) DEFAULT NULL,
 `mailbox` varchar(50) DEFAULT NULL,
 `maxcallbitrate` int(8) DEFAULT '384',
 `mohsuggest` varchar(80) DEFAULT NULL,
 `md5secret` varchar(80) DEFAULT NULL,
 `musiconhold` varchar(100) DEFAULT NULL,
 `name` varchar(80) NOT NULL DEFAULT '',
 `nat` varchar(5) NOT NULL DEFAULT 'no',
 `outboundproxy` varchar(80) DEFAULT NULL,
 `deny` varchar(95) DEFAULT NULL,
 `permit` varchar(95) DEFAULT NULL,
 `pickupgroup` varchar(10) DEFAULT NULL,
 `port` varchar(5) NOT NULL DEFAULT '',
 `progressinband` enum('yes','no','never') DEFAULT 'no',
 `promiscredir` enum('yes','no') DEFAULT 'no',
 `qualify` char(3) DEFAULT NULL,
 `regexten` varchar(80) NOT NULL DEFAULT '',
 `regseconds` int(11) NOT NULL DEFAULT '0',
 `rfc2833compensate` enum('yes','no') DEFAULT 'no',
 `rtptimeout` char(3) DEFAULT NULL,
 `rtpholdtimeout` char(3) DEFAULT NULL,
 `secret` varchar(80) DEFAULT NULL,
 `sendrpid` enum('yes','no') DEFAULT 'yes',
 `setvar` varchar(100) NOT NULL DEFAULT '',
 `subscribecontext` varchar(80) DEFAULT NULL,
 `subscribemwi` varchar(3) DEFAULT NULL,
 `t38pt_udptl` enum('yes','no') DEFAULT 'no',
 `trustrpid` enum('yes','no') DEFAULT 'no',
 `type` varchar(6) NOT NULL DEFAULT 'friend',
 `useclientcode` enum('yes','no') DEFAULT 'no',
 `username` varchar(80) NOT NULL DEFAULT '',
 `usereqphone` varchar(3) NOT NULL DEFAULT 'no',
 `videosupport` enum('yes','no') DEFAULT 'yes',
 `vmexten` varchar(80) DEFAULT NULL,
 PRIMARY KEY (`id`),
 UNIQUE KEY `name` (`name`),
 KEY `name_2` (`name`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC

CREATE TABLE `meetme` (
 `confno` varchar(80) NOT NULL DEFAULT '0',
 `pin` varchar(20) DEFAULT NULL,
 `adminpin` varchar(20) DEFAULT NULL,
 `members` int(11) NOT NULL DEFAULT '0',
 PRIMARY KEY (`confno`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8

CREATE TABLE `extensions` (
 `id` int(11) NOT NULL AUTO_INCREMENT,
 `context` varchar(20) NOT NULL DEFAULT '',
 `exten` varchar(20) NOT NULL DEFAULT '',
 `priority` tinyint(4) NOT NULL DEFAULT '0',
 `app` varchar(20) NOT NULL DEFAULT '',
 `appdata` varchar(128) NOT NULL DEFAULT '',
 KEY `id` (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8

Configure mysql realtime module:

Create file /etc/asterisk/res_mysql.conf and add lines:

[general]
dbhost=127.0.0.1
dbname=openmeetings
dbuser=root
dbpass=
dbport=3306

Add next lines into file /etc/asterisk/extconfig.conf:

[settings]
sipusers => mysql,general,sipusers
sippeers => mysql,general,sipusers
extensions => mysql,general,extensions
meetme => mysql,general,meetme

Add next lines into file /etc/asterisk/extensions.conf:

[rooms]
switch => Realtime/@

Restart asterisk:

> service asterisk restart

Insert, for example, SIP user with name ‘test1’:

insert into sipusers (allow, context, disallow, host, name, secret) values ('g729;ilbc;gsm;ulaw;alaw' , 'rooms' , NULL, 'dynamic' , 'test1', '12345');

Then create MeetMe conference:

insert into extensions (context, exten, priority, app, appdata) values (‘rooms’, ‘400’,   1, ‘MeetMe’, ‘400,dM’);

insert into meetme (confno, adminpin) values (‘400’, ‘12345’);

Now we can register SIP user from any SIP phone with next settings:

name: test1
domain: example
password: 12345
auth id: test1
sip proxy: <address of asterisk server>:5060

Setup red5sip transport

Unpack red5sip to /opt/red5sip

Install jsvc:

apt-get install jsvc

Insert proper values to /opt/red5sip/settings.properties

red5.host - red5 server address
sip.obproxy - asterisk adderss
sip.phone - sip phone number
sip.authid - sip auth id
sip.secret -  sip password
sip.realm - sip realm, “asterisk” by default
sip.proxy -
rooms - ids of openmeetings rooms, can be, for example, 2,3,5,6

Add red5sip to autostart:

ln -s /opt/red5sip/red5sip.sh /etc/init.d/red5sip
chmod a+x /etc/init.d/red5sip
update-rc.d /etc/init.d/red5sip defaults

Start red5sip transport:

service red5sip start

Setup asterisk to external SIP-provider

Add to /etc/sip.conf:

[general]
register => <name>:<password>@sipnet.ru/<number>

[SIPNET]
type=friend
username=<name>
secret=<password>
callerid=<caller id>
host=sipnet.ru
nat=route
fromuser=<fromuser>
fromdomain=sipnet.ru
dtmfmode=rfc2833
insecure=very
context=rooms
disallow=all
allow=alaw
canreinvite=no
callbackextension=<extension for incoming calls>

Add to /etc/asterisk/extensions.conf:

[rooms]
switch => Realtime/@

Wiki Markup
exten => \_400X\!,1,MeetMe(${EXTEN},dM)


exten => <extension>,1,Set(SIP_NO=<number to call with sipnet>)
exten => <extension>,2,Goto(sipnet-out,s,1)

exten => _.,1,Answer
exten => _.,2,Playback(invalid)
exten => _.,3,Hangup

[sipnet-out]

exten => s,1,Answer
Wiki Markup
exten => s,n,Dial(SIP/${SIP_NO}@SIPNET,30)

exten => s,n,HangUp