<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>Danny Tsang &#187; mysql</title> <atom:link href="http://www.dannytsang.co.uk/index.php/tag/mysql/feed/" rel="self" type="application/rss+xml" /><link>http://www.dannytsang.co.uk</link> <description>Eats and spits code by day</description> <lastBuildDate>Tue, 31 Jan 2012 22:47:19 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>FreePBX MySQL Caller Lookup Source</title><link>http://www.dannytsang.co.uk/index.php/freepbx-mysql-caller-lookup-source/</link> <comments>http://www.dannytsang.co.uk/index.php/freepbx-mysql-caller-lookup-source/#comments</comments> <pubDate>Tue, 13 Dec 2011 00:01:39 +0000</pubDate> <dc:creator>Danny</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[PBX]]></category> <category><![CDATA[caller id]]></category> <category><![CDATA[FreePBX]]></category> <category><![CDATA[Gigaset]]></category> <category><![CDATA[MyISAM]]></category> <category><![CDATA[mysql]]></category> <category><![CDATA[siemens]]></category> <category><![CDATA[siemens gigaset]]></category> <category><![CDATA[sql]]></category> <guid
isPermaLink="false">http://www.dannytsang.co.uk/?p=4106</guid> <description><![CDATA[Overview One of the reasons I switched to MySQL instead of using the built in phonebook was because the numbers weren&#8217;t matching the ones in the internal phonebook. The built in phonebook only allows numbers so international numbers with + &#8230; <a
href="http://www.dannytsang.co.uk/index.php/freepbx-mysql-caller-lookup-source/">Continue reading <span
class="meta-nav">&#8594;</span></a> Related posts:<ol><li><a
href='http://www.dannytsang.co.uk/index.php/enabling-remote-access-to-mysql/' rel='bookmark' title='Enabling Remote Access To MySQL'>Enabling Remote Access To MySQL</a></li><li><a
href='http://www.dannytsang.co.uk/index.php/mysql-tuning/' rel='bookmark' title='MySQL Tuning'>MySQL Tuning</a></li><li><a
href='http://www.dannytsang.co.uk/index.php/linksys-spa3102-and-freepbx-on-ubuntu-10-04/' rel='bookmark' title='Linksys SPA3102 And FreePBX On Ubuntu 10.04'>Linksys SPA3102 And FreePBX On Ubuntu 10.04</a></li></ol>]]></description> <content:encoded><![CDATA[<h3>Overview</h3><p>One of the reasons I switched to MySQL instead of using the built in phonebook was because the numbers weren&#8217;t matching the ones in the internal phonebook. The built in phonebook only allows numbers so international numbers with + or numbers with hyphens cannot be matched to phonebook entries. Using a user defined database and query will solve these problems.</p><h3>Setup MySQL</h3><p>We need a schema and a table to store the phonebook and I&#8217;d suggest a new user with at least SELECT <a
href="http://www.dannytsang.co.uk/index.php/tag/privileges/" class="st_tag internal_tag" rel="tag" title="Posts tagged with privileges">privileges</a>. The script below creates a schema called <strong><a
href="http://www.dannytsang.co.uk/index.php/tag/freepbx/" class="st_tag internal_tag" rel="tag" title="Posts tagged with FreePBX">freepbx</a></strong> and a table called <strong>phonebook</strong>:<br
/> <code>--<br
/> -- Create schema freepbx<br
/> --</p><p>CREATE DATABASE IF NOT EXISTS freepbx;<br
/> USE freepbx;</p><p>--<br
/> -- Definition of table `freepbx`.`phonebook`<br
/> --</p><p>DROP TABLE IF EXISTS `freepbx`.`phonebook`;<br
/> CREATE TABLE  `freepbx`.`phonebook` (<br
/> `name` varchar(50) NOT NULL,<br
/> `number` varchar(20) NOT NULL,<br
/> `phone` varchar(10) DEFAULT NULL,<br
/> PRIMARY KEY (`name`,`number`)<br
/> ) ENGINE=MyISAM DEFAULT CHARSET=latin1;</code><br
/> <a
href='http://www.dannytsang.co.uk/wp-content/uploads/2011/09/phonebook.zip'>phonebook.zip</a></p><p>The table contains 3 fields:</p><ul><li>name &#8211; The name of the number</li><li>number &#8211; The matching phone number</li><li>phone &#8211; The type of phone number E.g mob</li></ul><h3>Add Contacts</h3><p>Run the following query to insert new contacts in the phonebook:<br
/> <code>insert freepbx.phonebook (name, number, phone) values ('Danny','123456','mob');</code><br
/> Replace Danny, 123456. mob with your own values. The name and number (the first 2 items in the values) are required and the phone (&#8216;mob in the example) is optional. When omitting the phone field run the following query instead:<br
/> <code>insert freepbx.phonebook (name, number) values ('Danny','123456');</code><br
/> The name and number combined must be unique otherwise it won&#8217;t create an entry in the database. See below for how it will be displayed on the phone / reports.</p><p>The Siemens S68H which comes with the <a
href="http://www.dannytsang.co.uk/index.php/tag/siemens-gigaset/" class="st_tag internal_tag" rel="tag" title="Posts tagged with siemens gigaset">Siemens Gigaset</a> 685IP will display all the <a
href="http://www.dannytsang.co.uk/index.php/tag/caller-id/" class="st_tag internal_tag" rel="tag" title="Posts tagged with caller id">caller ID</a> if it fits on the display but the text will &#8220;just go off the screen&#8221; if it does not, only display the first part of the name. The number is always displayed below the <a
href="http://www.dannytsang.co.uk/index.php/tag/caller-id/" class="st_tag internal_tag" rel="tag" title="Posts tagged with caller id">caller ID</a> where possible.</p><h3>Setup FreePBX</h3><p>Log into FreePBX and go to <code>Tools Setup (tab) > Inbound Call Control > CallerID Lookup Sources</code> Click the <strong>Add CID Lookup Source</strong> button to add a new phonebook directory. Select <strong>MySQL</strong> from the <strong>Source type</strong> This will change the require informations on the page. Enter the following information:</p><blockquote><p>Source Description: MySQL<br
/> Source type: MySQL<br
/> Cache results: yes [tick]<br
/> Host: [<a
href="http://www.dannytsang.co.uk/index.php/tag/server/" class="st_tag internal_tag" rel="tag" title="Posts tagged with server">server</a> address]<br
/> Database: freepbx<br
/> Query: <code>SELECT CONCAT(name, IF(phone IS NOT NULL,CONCAT(' (', phone, ')'), '')) as cid FROM phonebook WHERE number like '[NUMBER]'</code><br
/> Username: [username]<br
/> Password: [password]</p></blockquote><p>Source description can be any name and it will be used a reference in other settings. The Host will typically be <em>localhost</em> unless the MySQL database is installed on a different machine.</p><p>The query will show <em>Danny (mob)</em> if the phone field is populated. The brackets are automatically inserted. If the phone field is empty (NULL in the database) it will just show the name <em>Danny</em></p><p>Press the <strong>Submit Changes</strong> button to save the new caller ID look up.</p><p>Go to <code>Setup (tab) > Inbound Call Control > Inbound <a
href="http://www.dannytsang.co.uk/index.php/tag/routes/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Routes">Routes</a></code> and select an inbound route which will use the new phonebook. Under the <strong>CID Lookup Source</strong> section select the phonebook called MySQL (or what ever it was named in the Source description) in the <strong>Source</strong> dropdown.</p><p>Press the <strong>Submit</strong> button to save the change and repeat for all other inbound routes which will use the MySQL phonebook.</p><p>Apply the changes for all the settings to take hold.</p><h3>Summary</h3><p>Having MySQL as a source makes it a lot more flexible and customizable. Also it can be linked to an existing directory. More technical knowledge is required to manage the contacts but that comes with the flexibility.</p><p><a
href="http://samyantoun.50webs.com/asterisk/freepbx/calleridlookup/" target="_blank">Setup MySQL CallerID Lookup Source on FreePBX</a></p><p>Related posts:<ol><li><a
href='http://www.dannytsang.co.uk/index.php/enabling-remote-access-to-mysql/' rel='bookmark' title='Enabling Remote Access To MySQL'>Enabling Remote Access To MySQL</a></li><li><a
href='http://www.dannytsang.co.uk/index.php/mysql-tuning/' rel='bookmark' title='MySQL Tuning'>MySQL Tuning</a></li><li><a
href='http://www.dannytsang.co.uk/index.php/linksys-spa3102-and-freepbx-on-ubuntu-10-04/' rel='bookmark' title='Linksys SPA3102 And FreePBX On Ubuntu 10.04'>Linksys SPA3102 And FreePBX On Ubuntu 10.04</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://www.dannytsang.co.uk/index.php/freepbx-mysql-caller-lookup-source/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Linksys SPA3102 And FreePBX On Ubuntu 10.04</title><link>http://www.dannytsang.co.uk/index.php/linksys-spa3102-and-freepbx-on-ubuntu-10-04/</link> <comments>http://www.dannytsang.co.uk/index.php/linksys-spa3102-and-freepbx-on-ubuntu-10-04/#comments</comments> <pubDate>Thu, 10 Jun 2010 23:01:47 +0000</pubDate> <dc:creator>Danny</dc:creator> <category><![CDATA[Hardware]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[PBX]]></category> <category><![CDATA[analogue]]></category> <category><![CDATA[Asterisk]]></category> <category><![CDATA[ata]]></category> <category><![CDATA[cisco]]></category> <category><![CDATA[database]]></category> <category><![CDATA[dhcp]]></category> <category><![CDATA[Dial]]></category> <category><![CDATA[DND]]></category> <category><![CDATA[group pickup]]></category> <category><![CDATA[landline number]]></category> <category><![CDATA[linksys]]></category> <category><![CDATA[linksys spa3102]]></category> <category><![CDATA[mysql]]></category> <category><![CDATA[mysqladmin]]></category> <category><![CDATA[pbx]]></category> <category><![CDATA[pbx system]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[pots]]></category> <category><![CDATA[private branch exchange]]></category> <category><![CDATA[pstn]]></category> <category><![CDATA[Routes]]></category> <category><![CDATA[SIP]]></category> <category><![CDATA[softphone]]></category> <category><![CDATA[telephone line]]></category> <category><![CDATA[Trunks]]></category> <category><![CDATA[Ubuntu]]></category> <category><![CDATA[VOIP]]></category> <category><![CDATA[web interface]]></category> <guid
isPermaLink="false">http://www.dannytsang.co.uk/?p=2186</guid> <description><![CDATA[Overview I wanted to setup a Private Branch eXchange(PBX) system using Asterisk server at home. As I already had a traditional land line (PSTN or POTS line) I needed something to bridge the computer to the land line. My idea &#8230; <a
href="http://www.dannytsang.co.uk/index.php/linksys-spa3102-and-freepbx-on-ubuntu-10-04/">Continue reading <span
class="meta-nav">&#8594;</span></a> Related posts:<ol><li><a
href='http://www.dannytsang.co.uk/index.php/freepbx-common-voicemail-box/' rel='bookmark' title='FreePBX &#8211; Common Voicemail Box'>FreePBX &#8211; Common Voicemail Box</a></li><li><a
href='http://www.dannytsang.co.uk/index.php/remote-extension-in-freepbx/' rel='bookmark' title='Remote Extension In FreePBX'>Remote Extension In FreePBX</a></li><li><a
href='http://www.dannytsang.co.uk/index.php/freepbx-symlink-from-modules-failed/' rel='bookmark' title='FreePBX Symlink From Modules Failed'>FreePBX Symlink From Modules Failed</a></li></ol>]]></description> <content:encoded><![CDATA[<h3>Overview</h3><p>I wanted to setup a Private Branch eXchange(<a
href="http://www.dannytsang.co.uk/index.php/tag/pbx/" class="st_tag internal_tag" rel="tag" title="Posts tagged with pbx">PBX</a>) system using Asterisk server at home. As I already had a traditional land line (<a
href="http://www.dannytsang.co.uk/index.php/tag/pstn/" class="st_tag internal_tag" rel="tag" title="Posts tagged with pstn">PSTN</a> or POTS line) I needed something to bridge the computer to the land line. My idea of having a <a
href="http://www.dannytsang.co.uk/index.php/tag/pbx/" class="st_tag internal_tag" rel="tag" title="Posts tagged with pbx">PBX</a> at was to route as many calls over VOIP which tends to be cheaper like Skype and still use a traditional landline for emergencies as well as just having a landline number.</p><h3>History</h3><p>Originally I started writing a post on how to get a PBX with a <a
href="http://www.dannytsang.co.uk/index.php/tag/web-interface/" class="st_tag internal_tag" rel="tag" title="Posts tagged with web interface">web interface</a> going on Ubuntu 8.04. However once I had it all installed it wasn&#8217;t working 100%. I had issues with permissions and <a
href="http://www.dannytsang.co.uk/index.php/tag/freepbx/" class="st_tag internal_tag" rel="tag" title="Posts tagged with FreePBX">FreePBX</a> had problems with the operation panel. Fast forward 2-3 years and I&#8217;m back doing it again but this time on the next LTS release and 7 minor release later from <a
href="http://www.dannytsang.co.uk/index.php/tag/freepbx/" class="st_tag internal_tag" rel="tag" title="Posts tagged with FreePBX">FreePBX</a>.</p><h3>Ubuntu 10.04 LTS</h3><h3>Asterisk</h3><p>Asterisk is a free and open source software for PBX. It&#8217;s what you see in companies to manage and route all their phones calls. Asterisk is a PBX engine which has several front end engines and even a distribution specially for PBX box called <a
href="http://www.trixbox.org/" target="_blank">Trixbox</a>. If you just want a headless PBX then installing Asterix will suffice however I was not technically skilled enough to create all configuration files from scratch and also a nice front end will go a long way for the Wife Acceptance Factor (WAF). This is where FreePBX comes in.</p><h3>FreePBX</h3><p>FreePBX is GUI interface wrapper for Asterisk. Ubuntu has a FreePBX package in it&#8217;s repository. FreePBX uses a web front end so it can be accessed anywhere and makes administration a lot easier. It uses modules to extend the functionally like add-ons in Firefox. These include group pickup to Parking Lots.</p><p>With FreePBX this sorts out the software side of my PBX.</p><h3>Linksys SPA3102</h3><p>This an Analogue Telephone Adaptor(<a
href="http://www.dannytsang.co.uk/index.php/tag/ata/" class="st_tag internal_tag" rel="tag" title="Posts tagged with ata">ATA</a>) which is used to convert a land line to a digital network and a traditional land line phone to the network too. The hardware has been around for a long time and it does work with Asterisk. The SPA(Sipura)3102 can be used as a standalone PBX box too but in my case it will be used to forward incoming and outgoing calls.</p><p>The SPA3102 also has a web interface but it can also be used to act as a router at the same time. The web interface is very basic and not very user friendly but has a lot of options making it very customizable and configurable.</p><h3>Asterisk And FreePBX Install</h3><p>Switch to root user before installing <code>sudo su</code>.</p><p>Install MySQL <code>sudo apt-get install mysql-server</code><br
/> When prompted for password enter one.</p><p>Install MySQL modules, PHP, kernel headers for compiling code, <code>apt-get install build-essential <a
href="http://www.dannytsang.co.uk/index.php/tag/linux/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Linux">linux</a>-headers-`uname -r` openssh-server bison flex <a
href="http://www.dannytsang.co.uk/index.php/tag/apache/" class="st_tag internal_tag" rel="tag" title="Posts tagged with apache">apache</a>2 php5 php5-curl php5-cli php5-mysql php-pear php-db php5-gd curl sox libncurses5-dev libssl-dev libmysqlclient15-dev mpg123 libxml2-dev</code></p><p>Go to /usr/src <code>cd /usr/src/</code><br
/> and download the Asterisk source files</p><blockquote><p>xargs wget << SOURCES</p><p>http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/releases/dahdi-linux-complete-2.2.1+2.2.1.tar.gz</p><p>http://downloads.asterisk.org/pub/telephony/libpri/releases/libpri-1.4.10.2.tar.gz</p><p>http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.6.2.6.tar.gz</p><p>http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-addons-1.6.2.0.tar.gz</p><p>SOURCES</p></blockquote><p>Un-tar(zip) all the source files in /usr/src/ <code>tar xvf dahdi-linux-complete-2.2.1+2.2.1.tar.gz</code><br
/> <code>tar xvf libpri-1.4.10.2.tar.gz</code><br
/> <code>tar xvf asterisk-1.6.2.6.tar.gz</code><br
/> <code>tar xvf asterisk-addons-1.6.2.0.tar.gz</code></p><p>Compile Asterisk in the following order:<br
/> <code>cd dahdi-linux-complete-2.2.1+2.2.1</code><br
/> <code>make all &#038;&#038; make install &#038;&#038; make config</code><br
/> <code>cd ../libpri-1.4.10.2</code><br
/> <code>make &#038;&#038; make install</code><br
/> <code>cd ../asterisk-1.6.2.6</code><br
/> <code>./configure</code><br
/> <code>make &#038;&#038; make install</code><br
/> <code>make samples</code><br
/> <code>cd ../asterisk-addons-1.6.2.0</code><br
/> <code>./configure</code><br
/> <code>make &#038;&#038; make install</code><br
/> <code>make samples</code><br
/> Download and extract extra sounds <code>cd /var/lib/astersik/sounds</code><br
/> <code>wget -O - http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-gsm-current.tar.gz | tar xvfz -</code></p><p>Create an Asterisk user account on the Linux box <code>adduser asterisk --disabled-password --no-create-home --gecos "asterisk PBX user"</code><br
/> <code>adduser www-data asterisk</code></p><p>Make a backup of the Asterisk configuration file <code>cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf_orig</code></p><p>Change the Asterisk config to run as a correct user <code>sed -i 's/^\(User\|Group\).*/\1 asterisk/' /etc/apache2/apache2.conf</code></p><p>Create the Asterisk service script which will start and stop the Asterisk demon:</p><blockquote><p>cat > /etc/init.d/asterisk <<-END_STARTUP<br
/> #!/bin/bash<br
/> ### BEGIN INIT INFO<br
/> # Provides:          asterisk<br
/> # Required-Start:    \$network \$syslog<br
/> # Required-Stop:     \$network \$syslog<br
/> # Default-Start:     2 3 4 5<br
/> # Default-Stop:      0 1 6<br
/> # Short-Description: Asterisk daemon.<br
/> # Description:       This script handles start/stop states of asterisk.<br
/> ### END INIT INFO</p><p>set -e<br
/> set -a<br
/> PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin<br
/> DESC="Asterisk"<br
/> NAME=amportal<br
/> DAEMON=/usr/sbin/\$NAME</p><p>test -x \$DAEMON || exit 0</p><p>d_start() {<br
/> amportal start<br
/> }</p><p>d_stop() {<br
/> amportal stop<br
/> }</p><p>d_reload() {<br
/> amportal restart<br
/> }</p><p>case "\$1" in</p><p>start)<br
/> echo -n "Starting \$DESC: \$NAME"<br
/> d_start<br
/> echo "."<br
/> ;;</p><p>stop)<br
/> echo -n "Stopping \$DESC: \$NAME"<br
/> d_stop<br
/> echo "."<br
/> ;;</p><p>restart|force-reload)<br
/> echo -n "Restarting \$DESC: \$NAME"<br
/> d_stop<br
/> sleep 10<br
/> d_start<br
/> echo "."<br
/> ;;</p><p>*)</p><p> echo "Usage: \$SCRIPTNAME {start|stop|restart|force-reload}" >&#038;2<br
/> exit 3<br
/> ;;</p><p>esac</p><p>exit 0<br
/> END_STARTUP</p></blockquote><p>Ensure the permissions of the demon script is correct <code>chmod 755 /etc/init.d/asterisk</code></p><p>Make Asterisk start up when the computer starts <code>update-rc.d asterisk defaults 90 10</code></p><p>Download and extract FreePBX<br
/> <code>cd /usr/src/</code><br
/> <code>wget -O - http://mirror.freepbx.org/freepbx-2.7.0.tar.gz | tar xvfz -</code><br
/> <code>cd freepbx-2.7.0/</code></p><p>Copy the Amportal configuration <code>cp amportal.conf /etc/</code></p><p>Set environment variables for the current session. These variables will store the password for MySQL access so that the script can be 100% automated. One is the admin password and the other is the Asterisk database user password. These variables should clear once the terminal session ends but it is advised to remove them from the bash history in <strong>~/.bash_history</strong><br
/> <code>export MYSQL_ROOT_PW=abcd</code><br
/> <code>export ASTERISK_DB_PW=wxyz</code></p><p>Run the database scripts:<br
/> <code><a
href="http://www.dannytsang.co.uk/index.php/tag/mysqladmin/" class="st_tag internal_tag" rel="tag" title="Posts tagged with mysqladmin">mysqladmin</a> -u root -p${MYSQL_ROOT_PW} create asterisk</code><br
/> <code>mysqladmin -u root -p${MYSQL_ROOT_PW} create asteriskcdrdb</code><br
/> <code>mysql -u root -p${MYSQL_ROOT_PW} asterisk < SQL/newinstall.sql</code><br
/> <code>mysql -u root -p${MYSQL_ROOT_PW} asteriskcdrdb < SQL/cdr_mysql_table.sql</code></p><blockquote><p>mysql -u root -p${MYSQL_ROOT_PW} <<-END_PRIVS<br
/> GRANT ALL <a
href="http://www.dannytsang.co.uk/index.php/tag/privileges/" class="st_tag internal_tag" rel="tag" title="Posts tagged with privileges">PRIVILEGES</a> ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY "${ASTERISK_DB_PW}";<br
/> GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY "${ASTERISK_DB_PW}";<br
/> flush privileges;<br
/> END_PRIVS</p></blockquote><p>Edit the amportal configuration file with the database username and password<br
/> <code>sed -i "s/# \(AMPDBUSER=.*\)/\1/" /etc/amportal.conf</code><br
/> <code>sed -i "s/# \(AMPDBPASS=\).*/\1${ASTERISK_DB_PW}/" /etc/amportal.conf</code><br
/> <code>sed -i "s@\(AMPWEBROOT=\).*@\1/var/www/@"  /etc/amportal.conf</code><br
/> <code>sed -i "s@\(FOPWEBROOT=\).*@\1/var/www/panel@" /etc/amportal.conf</code><br
/> <code>sed -i "s@\(FOPWEBADDRESS=\).*@PUTIPADDRESS@" /etc/amportal.conf</code></p><p>Change the max PHP file upload size to 120mb in Apache<br
/> <code>sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php5/apache2/php.ini</code></p><p>Change the files and directories so that Asterisk has access to them<br
/> <code>chown asterisk. /var/run/asterisk</code><br
/> <code>chown -R asterisk. /etc/asterisk</code><br
/> <code>chown -R asterisk. /var/{lib,log,spool}/asterisk</code><br
/> <code>chown -R asterisk. /var/www/</code></p><p>Remove line ending from the Asterisk configuration file.<br
/> <code>sed -i '1 s/\(\[directories\]\).*/\1/' /etc/asterisk/asterisk.conf</code></p><p>Start Asterisk<br
/> <code>./start_asterisk start</code></p><p>Install FreePBX<br
/> <code>./install_amp</code></p><p>Restart Apache server<br
/> <code>/etc/init.d/apache2 restart</code></p><p>Create a symlink to the "Music On Hold"(MOH) files<br
/> <code>ln -s /var/lib/asterisk/moh /var/lib/asterisk/mohmp3</code></p><p>Start FreePBX<br
/> <code>amportal start</code></p><h3>Asterisk / PBX Terminology</h3><p>Before I go into configuring the PBX itself it is worth knowing the terminology behind the technology.</p><ul><li>Extension - Can be considered as an internal phone number. Each extension can be associated with a user and the user and the user can "roam" from phone to phone keeping their phone number.</li><li>Feature Codes - Special phone numbers which can put an extension to do not disturb (DND) so that no phone calls will get through to accessing voicemail.</li><li>Trunk - Provides services to the PBX such as land line or to allow calls to another PBX.</li><li>Routes - The path a call may go. Routes consists of inbound, calls coming in and outbound, calls leaving the system routes.</li><li>Dial Rules - Rules defined in ASCII characters which govern routes e.g Only free phone numbers are allowed to take the land line route. All other numbers should go out to a VOIP provider.</li><li>Channels - Number of simultaneous calls a trunk can handle</li></ul><h3>Configure FreePBX</h3><p>First thing to do is set up extensions. Extensions are independent to any available routes as by default Asterisk treats any number dialled as an internal number. Below are steps to create 2 extensions. One number will eventually be assigned to the phone attached to the Linksys SPA3102 and the other for another hard/softphone.</p><div
align="center"><a
href="http://www.dannytsang.co.uk/wp-content/uploads/2010/06/New-Extension.png" rel="lightbox[2186]"><img
src="http://www.dannytsang.co.uk/wp-content/uploads/2010/06/New-Extension-150x150.png" alt="" title="New Extension" width="150" height="150" class="aligncenter size-thumbnail wp-image-2843" /></a></div><ol><li>Go to Setup > Basic > Extensions menu item.</li><li>Ensure "Generic SIP Device" is selected in the Devices drop down box.</li><li>Enter the following details:</li><ol><li>User Extension - Phone number of extension E.G 1000</li><li>Display Name - Friendly name</li><li>Voicemail &#038; Directory Status - Enable this if you want the user to have voicemail facilities</li><li>Secret - Leave blank for now but this is the password for the extension.</li></ol><li>Submit the changes.</li><li>Click on the new extension listed on the right hand side of the Extensions page. This will edit the extension</li><li>Under <strong>Device Options</strong> section change the <strong>Mailbox</strong> by removing the @device suffix and just leave the extension number in the field.</li><li>Submit the changes again.</li><li>Repeat the steps above again to create a second extension, changing the extension number, display name and the mailbox setting E.G 1001</li><li>Apply the changes to make it take effect.</li></ol><p>At this point I would download a SIP softphone such as <a
href="http://www.counterpath.com/x-lite.html" target="_blank">X-Lite</a> on two computers and test out the 2 extensions created. Using the X-Lite or other softphones is beyond this article.</p><p>For Dialling out of the Sipura 3102 a Trunk is needed as well as configuring the outbound route.</p><ol><li>Go to Setup > Basic > Trunks in FreePBX</li><li>Click on the <strong>Add SIP Trunk</strong></li><li>Fill in the following fields:</li><ol><li>Trunk Description - A friendly name for the trunk. This can be anything</li><li>Outbound <a
href="http://www.dannytsang.co.uk/index.php/tag/caller-id/" class="st_tag internal_tag" rel="tag" title="Posts tagged with caller id">Caller ID</a> - Full telephone number of the landline including area code.</li><li>CID Options - Any</li><li>Maximum Channels - 1</li><li>Dial Rules - Leave blank</li><li>Outbound Dial Prefix - Leave blank</li><li>Trunk Name - A memorable name which will be used in the Sipura configuration</li><li>Peer Details:<br
/><blockquote><p>canreinvite=no<br
/> context=from-pstn<br
/> host=[host]<br
/> nat=no<br
/> port=5061<br
/> type=friend<br
/> qualify=yes<br
/> dtmfmode=rfc2833</p></blockquote><p>Change [host] to the IP address of computer hosting Asterisk / FreePBX and [username] to username to be used by Sipura</li><li>Leave the remaining fields blank.</li></ol><li>Submit Changes.</li><li>Go to Setup > Basic > Outbound Routes</li><li>Click on 0 9_outside (or create a new one)</li><li>Change the settings to as follows:</li><ol><li>All fields should be blank or left as default up to Dial Patterns.</li><li>Dial Patterns - <code>9|.</code></li><li>Trunk Sequence - Select the Trunk created above.</li></ol><li>Submit changes.</li><li>Apply the changes.</li></ol><p>The above setting outbound route requires a 9 to be dialled followed by the number to be dialled. The dial pattern can be changed later.</p><p>Create a new inbound route for the landline to Asterisk via SPA3102:</p><ol><li>Go to Setup > Inbound Call Control > Inbound Routes</li><li>Change the following settings:</li><ol><li>Description - A meaningful name for the inbound route</li><li>DID Number - Enter the landline telephone number including the area code.</li><li>Set Destination - Set where the landline call should go to. This can be voicemail or an extension</li></ol><li>Submit changes.</li><li>Apply Settings</li></ol><p>It is worth mentioning here that there is a module in FreePBX called Ring Group which would allow a group of extensions to be named as a destination. This means anyone in the group will have their phone ring when someone rings the landline.</p><div
align="center"><a
href="http://www.dannytsang.co.uk/wp-content/uploads/2010/06/FreePBX-user-authentication.png" rel="lightbox[2186]"><img
src="http://www.dannytsang.co.uk/wp-content/uploads/2010/06/FreePBX-user-authentication-150x150.png" alt="" title="FreePBX user authentication" width="150" height="150" class="aligncenter size-thumbnail wp-image-2815" /></a></div><p>As a recommended step check if a password has been set on the admin web page. Clear out the browser's cookies and cache. Go to the Freepbx page and click on the FreePBX Administration link it should prompt for a password. If not edit the default admin account or add a new account under <code>Setup > Basic > Administration</code></p><div
align="center"><a
href="http://www.dannytsang.co.uk/wp-content/uploads/2010/06/Administrators-account.png" rel="lightbox[2186]"><img
src="http://www.dannytsang.co.uk/wp-content/uploads/2010/06/Administrators-account-150x150.png" alt="" title="Administrators account" width="150" height="150" class="aligncenter size-thumbnail wp-image-2814" /></a></div><p>Notice there is a warning under "General Settings". This means the authentication has not been turned on. Submit the changes and apply them once completed. Go to the Freepbx box and edit the file <code>/etc/amportal.conf</code> Look for the line <code>AUTHTYPE=none</code> and change it from <strong>none</strong> to <strong>database</strong>.</p><h3>Setting Up SPA3102</h3><p>Out of the box the ATA is configured to act as a router and has the web interface disabled on the WAN port. I will be putting SPA3102 into an existing network so I need to enable the WAN port and turn off the <a
href="http://www.dannytsang.co.uk/index.php/tag/dhcp/" class="st_tag internal_tag" rel="tag" title="Posts tagged with dhcp">DHCP</a>. The WAN port needs to be enabled so that it can connect to the local network instead of the box expecting a modem and turning off <a
href="http://www.dannytsang.co.uk/index.php/tag/dhcp/" class="st_tag internal_tag" rel="tag" title="Posts tagged with dhcp">DHCP</a> will stop two devices assigning an IP to the computers on the network.</p><p>Plug a telephone into phone socket of the SPA3102 and the power in the power socket. Pick up the phone and dial ***** (5 asterisks) and then 7932 and then 1. Hang up or press #.</p><p>Now plug the network cable into the Internet port of the SPA3102 <strong>NOT THE ETHERNET PORT</strong>. Point your browser to the IP address of the SPA3102. To find out what the IP is you should be able to check on your router or dial ***** (5 asterisks) > 110 on your phone.</p><p>Just like a router, a webpage with settings and status of the device should appear. Use the screenshots below and set all the settings below:</p><div
align="center"><a
href="http://www.dannytsang.co.uk/wp-content/uploads/2010/06/SPA3102-Voice-System-Tab.png" rel="lightbox[2186]"><img
src="http://www.dannytsang.co.uk/wp-content/uploads/2010/06/SPA3102-Voice-System-Tab-150x150.png" alt="" title="SPA3102 Voice-System Tab" width="150" height="150" class="aligncenter size-thumbnail wp-image-2823" /></a><a
href="http://www.dannytsang.co.uk/wp-content/uploads/2010/06/SPA3102-Voice-SIP-Tab.png" rel="lightbox[2186]"><img
src="http://www.dannytsang.co.uk/wp-content/uploads/2010/06/SPA3102-Voice-SIP-Tab-150x150.png" alt="" title="SPA3102 Voice-SIP Tab" width="150" height="150" class="aligncenter size-thumbnail wp-image-2822" /></a><a
href="http://www.dannytsang.co.uk/wp-content/uploads/2010/06/SPA3102-Voice-Provisioning-Tab.png" rel="lightbox[2186]"><img
src="http://www.dannytsang.co.uk/wp-content/uploads/2010/06/SPA3102-Voice-Provisioning-Tab-150x150.png" alt="" title="SPA3102 Voice-Provisioning Tab" width="150" height="150" class="aligncenter size-thumbnail wp-image-2819" /></a><a
href="http://www.dannytsang.co.uk/wp-content/uploads/2010/06/SPA3102-Voice-Regional-Tab.png" rel="lightbox[2186]"><img
src="http://www.dannytsang.co.uk/wp-content/uploads/2010/06/SPA3102-Voice-Regional-Tab-150x150.png" alt="" title="SPA3102 Voice-Regional Tab" width="150" height="150" class="aligncenter size-thumbnail wp-image-2821" /></a><a
href="http://www.dannytsang.co.uk/wp-content/uploads/2010/06/SPA3102-Voice-Line-1-Tab.png" rel="lightbox[2186]"><img
src="http://www.dannytsang.co.uk/wp-content/uploads/2010/06/SPA3102-Voice-Line-1-Tab-150x150.png" alt="" title="SPA3102 Voice-Line 1 Tab" width="150" height="150" class="aligncenter size-thumbnail wp-image-2818" /></a><a
href="http://www.dannytsang.co.uk/wp-content/uploads/2010/06/SPA3102-Voice-PSTN-Line-Tab.png" rel="lightbox[2186]"><img
src="http://www.dannytsang.co.uk/wp-content/uploads/2010/06/SPA3102-Voice-PSTN-Line-Tab-150x150.png" alt="" title="SPA3102 Voice-PSTN Line Tab" width="150" height="150" class="aligncenter size-thumbnail wp-image-2820" /></a></div><p>The settings are for UK and I have change the tones in the Voice > Regional settings. Others such as the daylight savings are aligned to the UK time zone.</p><p>The following needs to be configured according to the environment.<br
/> <strong>Voice > Line 1 > Proxy and Registration</strong></p><ul><li>Proxy - IP address of the Linux box which will host the Asterisk and FreePBX software.</li></ul><p><strong>Voice > Line 1 > Subscriber Information</strong></p><ul><li>User ID - Extension set in FreePBX</li><li>Password - Leave blank initially for easier debugging but it should match the secret settings in the extensions</li></ul><p><strong>Voice > PSTN Line > Proxy and Registration</strong></p><ul><li>Proxy - IP address of the Linux box which will host the Asterisk and FreePBX software.</li></ul><p><strong>Voice > PSTN Line > Dial Plans</strong></p><ul><li>Dial Plan 2 - S0(<:xxxxxxxxxx>) where x is the phone number of your land land including the area code e.g 01323123456</li></ul><p><a
href="http://www.asterisk.org/" target="_blank">Asterisk</a><br
/> <a
href="http://www.trixbox.org/" target="_blank">Trixbox</a><br
/> <a
href="http://www.freepbx.org/" target="_blank">FreePBX</a><br
/> <a
href="http://hmontoliu.blogspot.com/2010/03/installing-asterisk-and-freepbx-on.html">Installing Asterisk and FreePBX on a vmware instance of Ubuntu 10.04 (Lucid) alpha3</a></p><div
align="center"></div> <a
href='http://www.dannytsang.co.uk/index.php/linksys-spa3102-and-freepbx-on-ubuntu-10-04/freepbx-user-authentication/' title='FreePBX user authentication'><img
width="150" height="150" src="http://www.dannytsang.co.uk/wp-content/uploads/2010/06/FreePBX-user-authentication-150x150.png" class="attachment-thumbnail" alt="FreePBX user authentication" title="FreePBX user authentication" /></a> <a
href='http://www.dannytsang.co.uk/index.php/linksys-spa3102-and-freepbx-on-ubuntu-10-04/administrators-account/' title='Administrators account'><img
width="150" height="150" src="http://www.dannytsang.co.uk/wp-content/uploads/2010/06/Administrators-account-150x150.png" class="attachment-thumbnail" alt="Administrators account" title="Administrators account" /></a> <a
href='http://www.dannytsang.co.uk/index.php/linksys-spa3102-and-freepbx-on-ubuntu-10-04/spa3102-voice-line-1-tab/' title='SPA3102 Voice-Line 1 Tab'><img
width="150" height="150" src="http://www.dannytsang.co.uk/wp-content/uploads/2010/06/SPA3102-Voice-Line-1-Tab-150x150.png" class="attachment-thumbnail" alt="SPA3102 Voice-Line 1 Tab" title="SPA3102 Voice-Line 1 Tab" /></a> <a
href='http://www.dannytsang.co.uk/index.php/linksys-spa3102-and-freepbx-on-ubuntu-10-04/spa3102-voice-provisioning-tab/' title='SPA3102 Voice-Provisioning Tab'><img
width="150" height="150" src="http://www.dannytsang.co.uk/wp-content/uploads/2010/06/SPA3102-Voice-Provisioning-Tab-150x150.png" class="attachment-thumbnail" alt="SPA3102 Voice-Provisioning Tab" title="SPA3102 Voice-Provisioning Tab" /></a> <a
href='http://www.dannytsang.co.uk/index.php/linksys-spa3102-and-freepbx-on-ubuntu-10-04/spa3102-voice-regional-tab/' title='SPA3102 Voice-Regional Tab'><img
width="150" height="150" src="http://www.dannytsang.co.uk/wp-content/uploads/2010/06/SPA3102-Voice-Regional-Tab-150x150.png" class="attachment-thumbnail" alt="SPA3102 Voice-Regional Tab" title="SPA3102 Voice-Regional Tab" /></a> <a
href='http://www.dannytsang.co.uk/index.php/linksys-spa3102-and-freepbx-on-ubuntu-10-04/spa3102-voice-sip-tab/' title='SPA3102 Voice-SIP Tab'><img
width="150" height="150" src="http://www.dannytsang.co.uk/wp-content/uploads/2010/06/SPA3102-Voice-SIP-Tab-150x150.png" class="attachment-thumbnail" alt="SPA3102 Voice-SIP Tab" title="SPA3102 Voice-SIP Tab" /></a> <a
href='http://www.dannytsang.co.uk/index.php/linksys-spa3102-and-freepbx-on-ubuntu-10-04/spa3102-voice-system-tab/' title='SPA3102 Voice-System Tab'><img
width="150" height="150" src="http://www.dannytsang.co.uk/wp-content/uploads/2010/06/SPA3102-Voice-System-Tab-150x150.png" class="attachment-thumbnail" alt="SPA3102 Voice-System Tab" title="SPA3102 Voice-System Tab" /></a> <a
href='http://www.dannytsang.co.uk/index.php/linksys-spa3102-and-freepbx-on-ubuntu-10-04/spa3102-voice-pstn-line-tab/' title='SPA3102 Voice-PSTN Line Tab'><img
width="150" height="150" src="http://www.dannytsang.co.uk/wp-content/uploads/2010/06/SPA3102-Voice-PSTN-Line-Tab-150x150.png" class="attachment-thumbnail" alt="SPA3102 Voice-PSTN Line Tab" title="SPA3102 Voice-PSTN Line Tab" /></a> <a
href='http://www.dannytsang.co.uk/index.php/linksys-spa3102-and-freepbx-on-ubuntu-10-04/new-extension/' title='New Extension'><img
width="150" height="150" src="http://www.dannytsang.co.uk/wp-content/uploads/2010/06/New-Extension-150x150.png" class="attachment-thumbnail" alt="New Extension" title="New Extension" /></a><p>Related posts:<ol><li><a
href='http://www.dannytsang.co.uk/index.php/freepbx-common-voicemail-box/' rel='bookmark' title='FreePBX &#8211; Common Voicemail Box'>FreePBX &#8211; Common Voicemail Box</a></li><li><a
href='http://www.dannytsang.co.uk/index.php/remote-extension-in-freepbx/' rel='bookmark' title='Remote Extension In FreePBX'>Remote Extension In FreePBX</a></li><li><a
href='http://www.dannytsang.co.uk/index.php/freepbx-symlink-from-modules-failed/' rel='bookmark' title='FreePBX Symlink From Modules Failed'>FreePBX Symlink From Modules Failed</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://www.dannytsang.co.uk/index.php/linksys-spa3102-and-freepbx-on-ubuntu-10-04/feed/</wfw:commentRss> <slash:comments>18</slash:comments> </item> <item><title>MediaTomb DLNA To Playstation 3</title><link>http://www.dannytsang.co.uk/index.php/mediatomb-dlna-to-playstation-3/</link> <comments>http://www.dannytsang.co.uk/index.php/mediatomb-dlna-to-playstation-3/#comments</comments> <pubDate>Mon, 08 Feb 2010 00:01:19 +0000</pubDate> <dc:creator>Danny</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[apache]]></category> <category><![CDATA[divx]]></category> <category><![CDATA[DLNA]]></category> <category><![CDATA[MediaTomb]]></category> <category><![CDATA[mysql]]></category> <category><![CDATA[myth]]></category> <category><![CDATA[MythTV]]></category> <category><![CDATA[Playstation]]></category> <category><![CDATA[Sony]]></category> <category><![CDATA[sony playstation]]></category> <category><![CDATA[sony playstation 3]]></category> <category><![CDATA[SQLite]]></category> <category><![CDATA[UPNP]]></category> <category><![CDATA[upnp server]]></category> <category><![CDATA[XML]]></category> <category><![CDATA[XviD]]></category> <guid
isPermaLink="false">http://www.dannytsang.co.uk/?p=2566</guid> <description><![CDATA[Overview I found the Video plugin for MythTV 0.21 to be inadequate for streaming to the Sony Playstation 3. It didn&#8217;t update fast enough when you dropped a video into the UPnP directory and also there was no external way &#8230; <a
href="http://www.dannytsang.co.uk/index.php/mediatomb-dlna-to-playstation-3/">Continue reading <span
class="meta-nav">&#8594;</span></a> Related posts:<ol><li><a
href='http://www.dannytsang.co.uk/index.php/full-disk-mediatomb-hog/' rel='bookmark' title='Full Disk &#8211; MediaTomb Hog'>Full Disk &#8211; MediaTomb Hog</a></li><li><a
href='http://www.dannytsang.co.uk/index.php/ubuntu-music-streaming-server-ampache/' rel='bookmark' title='Ubuntu Music Streaming Server &#8211; Ampache'>Ubuntu Music Streaming Server &#8211; Ampache</a></li><li><a
href='http://www.dannytsang.co.uk/index.php/all-things-digital-interview/' rel='bookmark' title='All Things Digital Interview'>All Things Digital Interview</a></li></ol>]]></description> <content:encoded><![CDATA[<h3>Overview</h3><p>I found the Video plugin for <a
href="http://www.dannytsang.co.uk/index.php/tag/mythtv/" class="st_tag internal_tag" rel="tag" title="Posts tagged with MythTV">MythTV</a> 0.21 to be inadequate for streaming to the <a
href="http://www.dannytsang.co.uk/index.php/tag/sony-playstation/" class="st_tag internal_tag" rel="tag" title="Posts tagged with sony playstation">Sony Playstation</a> 3. It didn&#8217;t update fast enough when you dropped a video into the <a
href="http://www.dannytsang.co.uk/index.php/tag/upnp/" class="st_tag internal_tag" rel="tag" title="Posts tagged with UPNP">UPnP</a> directory and also there was no external way of telling it to refresh it&#8217;s list of files without starting up Myth Frontend.</p><h3>MediaTomb</h3><p>MediaTomb is a UPnP <a
href="http://www.dannytsang.co.uk/index.php/tag/server/" class="st_tag internal_tag" rel="tag" title="Posts tagged with server">server</a> which can run as a standalone or as a daemon. It uses an <a
href="http://www.dannytsang.co.uk/index.php/tag/xml/" class="st_tag internal_tag" rel="tag" title="Posts tagged with XML">XML</a> configuration file for it&#8217;s settings (pretty neat stuff) and is pretty small in size. The software comes with it&#8217;s own web <a
href="http://www.dannytsang.co.uk/index.php/tag/server/" class="st_tag internal_tag" rel="tag" title="Posts tagged with server">server</a> so you don&#8217;t have to install a full <a
href="http://www.dannytsang.co.uk/index.php/tag/apache/" class="st_tag internal_tag" rel="tag" title="Posts tagged with apache">apache</a> install to get to the control panel and it uses SQLite by default so no big database backend to be installed.</p><h3>Install &#038; Configure MediaTomb</h3><p>Install MediaTomb and ffmeg thumbnailer<br
/> <code>sudo apt-get install mediatomb ffmpegthumbnailer</code><br
/> That&#8217;s it for the install!</p><p>edit the file config file in <strong>/etc/mediatomb/config.xml</strong> and change the following settings:</p><p>Enable PS3 support change this:</p><blockquote><p>&lt;protocolInfo extend=&#8221;no&#8221;/&gt;&lt;!&#8211; For PS3 support change to &#8220;yes&#8221; &#8211;&gt;</p></blockquote><p>to</p><blockquote><p>&lt;protocolInfo extend=&#8221;yes&#8221;/>&lt;!&#8211; For PS3 support change to &#8220;yes&#8221; &#8211;&gt;</p></blockquote><p>and also</p><blockquote><p>&lt;!&#8211; &lt;map from=&#8221;avi&#8221; to=&#8221;video/divx&#8221;/&gt; &#8211;&gt;</p></blockquote><p>to</p><blockquote><p>&lt;map from=&#8221;avi&#8221; to=&#8221;video/divx&#8221;/&gt;</p></blockquote><p>Add the line<br
/> <code>&lt;pc-directory upnp-hide="yes"/&gt;</code><br
/> below<br
/> <code>&lt;webroot&gt;/usr/share/mediatomb/web&lt;/webroot&gt;</code><br
/> so that it looks like this<br
/> <code>&lt;webroot&gt;/usr/share/mediatomb/web&lt;/webroot&gt;<br
/> &lt;pc-directory upnp-hide="yes"/&gt;</code><br
/> This hides the full directory path from the Playstation so it can only view the directories added and not the full system.</p><p>Add the following to enable thumbnail previews. I have found this does not work 100% of the time.</p><p>Enable transcoding<br
/> <code>&lt;transcoding enabled="no"&gt;</code><br
/> to<br
/> <code>&lt;transcoding enabled="yes"&gt;</code></p><p>Add the following transcode mappings under <strong>&lt;mimetype-profile-mappings&gt;</strong> tag:</p><blockquote><p>&lt;transcode mimetype=&#8221;video/divx&#8221; using=&#8221;video-thumbnail&#8221;/&gt;<br
/> &lt;transcode mimetype=&#8221;video/mpeg&#8221; using=&#8221;video-thumbnail&#8221;/&gt;<br
/> &lt;transcode mimetype=&#8221;video/mp4&#8243; using=&#8221;video-thumbnail&#8221;/&gt;<br
/> &lt;transcode mimetype=&#8221;video/x-ms-wmv&#8221; using=&#8221;video-thumbnail&#8221;/&gt;</p></blockquote><p>Add the following settings between the <strong>&lt;profiles&gt;&lt;/profiles&gt;</strong> elements. Not the parent is plural and each profile is singular.</p><blockquote><p>&lt;profile name=&#8221;video-thumbnail&#8221; enabled=&#8221;yes&#8221; type=&#8221;external&#8221;&gt;<br
/> &lt;mimetype&gt;image/jpeg&lt;/mimetype&gt;<br
/> &lt;accept-url&gt;yes&lt;/accept-url&gt;<br
/> &lt;thumbnail&gt;yes&lt;/thumbnail&gt;<br
/> &lt;resolution&gt;128&#215;128&lt;/resolution&gt;<br
/> &lt;agent command=&#8221;/usr/bin/ffmpegthumbnailer&#8221; arguments=&#8221;-i %in -o %out -s 128&#8243;/&gt;<br
/> &lt;<a
href="http://www.dannytsang.co.uk/index.php/tag/buffer/" class="st_tag internal_tag" rel="tag" title="Posts tagged with buffer">buffer</a> size=&#8221;524288&#8243; chunk-size=&#8221;512&#8243; fill-size=&#8221;1024&#8243;/&gt;<br
/> &lt;/profile&gt;</p></blockquote><p>Restart MediaTomb service <code>sudo /etc/init.d/mediatomb restart</code> If it fails to restart then double check the config file for errors.</p><p>Go to the machine in a web browser on port 49152 e.g http://localhost:49152</p><div
align="center"><a
href="http://www.dannytsang.co.uk/wp-content/uploads/2010/02/MediaTomb-Adding-directory.png" rel="lightbox[2566]"><img
src="http://www.dannytsang.co.uk/wp-content/uploads/2010/02/MediaTomb-Adding-directory-150x150.png" alt="" title="MediaTomb Adding directories" width="150" height="150" class="aligncenter size-thumbnail wp-image-2588" /></a></div><p>On this web page configures the directories available over UPnP. The Database section shows what directories are visible / registered to MediaTomb and Filesystem shows the computer directories that can be added for DLNA / UPnP visibility. When a directory is added MediaTomb scans the directory and register them so they show up on the Playstation. These can include <a
href="http://www.dannytsang.co.uk/index.php/tag/music/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Music">music</a>, videos and pictures.</p><div
align="center"><a
href="http://www.dannytsang.co.uk/wp-content/uploads/2010/02/MediaTomb-Update-Frequency.png" rel="lightbox[2566]"><img
src="http://www.dannytsang.co.uk/wp-content/uploads/2010/02/MediaTomb-Update-Frequency-150x150.png" alt="" title="MediaTomb Update Frequency" width="150" height="150" class="aligncenter size-thumbnail wp-image-2663" /></a></div><p>In the top right hand corner there is a plus &#8220;+&#8221; with two arrows around it. Clicking on it loads a new page in the main window, replacing the file lists in the directory. This is the page for setting how often it scans for changes.</p><p>Go to the Playstation, turn it on and go to the relevant category e.g photo in the menu. There should be a MediaTomb server in the list. If it does not appear go towards the top and scan for more media servers to look for MediaTomb.</p><h3>Summary</h3><p>The software is pretty self contained but I would have liked the option to use Apache and <a
href="http://www.dannytsang.co.uk/index.php/tag/mysql/" class="st_tag internal_tag" rel="tag" title="Posts tagged with mysql">MySQL</a> because those are already installed on my system.</p><p>MediaTomb does the job for now and whilst I cannot get the thumbnails to work on all the media it still does a brillant job of streaming the media to the Playstation. Unfortunately it&#8217;s not integrated into MythTV so records will still have to be done via MythTV but this is not a problem because all recorded TV shows are registered in the database.</p><p>A problem I did encounter was that I added multiple directories but reguardless of where they reside on the computer, all videos appear in one directory on the Playstation. I&#8217;m not  sure if this is a bug or how it&#8217;s suppose to work.</p><p><a
href="http://ubuntuforums.org/showthread.php?t=650020&#038;page=5" target="_blank">[HOWTO]:Stream DivX/XviD to a PS3 with firmware 2.10 using MediaTomb and Ubuntu 7</a></p> <a
href='http://www.dannytsang.co.uk/index.php/mediatomb-dlna-to-playstation-3/mediatomb-adding-directory/' title='MediaTomb Adding directories'><img
width="150" height="150" src="http://www.dannytsang.co.uk/wp-content/uploads/2010/02/MediaTomb-Adding-directory-150x150.png" class="attachment-thumbnail" alt="MediaTomb Adding directories" title="MediaTomb Adding directories" /></a> <a
href='http://www.dannytsang.co.uk/index.php/mediatomb-dlna-to-playstation-3/mediatomb-update-frequency/' title='MediaTomb Update Frequency'><img
width="150" height="150" src="http://www.dannytsang.co.uk/wp-content/uploads/2010/02/MediaTomb-Update-Frequency-150x150.png" class="attachment-thumbnail" alt="MediaTomb Update Frequency" title="MediaTomb Update Frequency" /></a><p>Related posts:<ol><li><a
href='http://www.dannytsang.co.uk/index.php/full-disk-mediatomb-hog/' rel='bookmark' title='Full Disk &#8211; MediaTomb Hog'>Full Disk &#8211; MediaTomb Hog</a></li><li><a
href='http://www.dannytsang.co.uk/index.php/ubuntu-music-streaming-server-ampache/' rel='bookmark' title='Ubuntu Music Streaming Server &#8211; Ampache'>Ubuntu Music Streaming Server &#8211; Ampache</a></li><li><a
href='http://www.dannytsang.co.uk/index.php/all-things-digital-interview/' rel='bookmark' title='All Things Digital Interview'>All Things Digital Interview</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://www.dannytsang.co.uk/index.php/mediatomb-dlna-to-playstation-3/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Ubuntu Music Streaming Server &#8211; Ampache</title><link>http://www.dannytsang.co.uk/index.php/ubuntu-music-streaming-server-ampache/</link> <comments>http://www.dannytsang.co.uk/index.php/ubuntu-music-streaming-server-ampache/#comments</comments> <pubDate>Tue, 21 Jul 2009 23:01:11 +0000</pubDate> <dc:creator>Danny</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Music]]></category> <category><![CDATA[album art]]></category> <category><![CDATA[ampache]]></category> <category><![CDATA[apache]]></category> <category><![CDATA[buffer]]></category> <category><![CDATA[Flash]]></category> <category><![CDATA[gnump3d]]></category> <category><![CDATA[music collection]]></category> <category><![CDATA[mysql]]></category> <category><![CDATA[perl]]></category> <category><![CDATA[plugins]]></category> <category><![CDATA[server]]></category> <category><![CDATA[shoutcast]]></category> <category><![CDATA[stream]]></category> <category><![CDATA[Ubuntu]]></category> <category><![CDATA[Web]]></category> <category><![CDATA[windows media player]]></category> <guid
isPermaLink="false">http://www.dannytsang.co.uk/?p=2207</guid> <description><![CDATA[Overview I wanted a music server for personal use so that I can access my music collection remotely or locally. A web front end with the ability to stream to various players would be key. It had to run on &#8230; <a
href="http://www.dannytsang.co.uk/index.php/ubuntu-music-streaming-server-ampache/">Continue reading <span
class="meta-nav">&#8594;</span></a> Related posts:<ol><li><a
href='http://www.dannytsang.co.uk/index.php/music-live-more-or-less/' rel='bookmark' title='Music Live (More Or Less)'>Music Live (More Or Less)</a></li><li><a
href='http://www.dannytsang.co.uk/index.php/mythweb-preview/' rel='bookmark' title='MythWeb Preview'>MythWeb Preview</a></li><li><a
href='http://www.dannytsang.co.uk/index.php/sennheiser-hd555/' rel='bookmark' title='Sennheiser HD555'>Sennheiser HD555</a></li></ol>]]></description> <content:encoded><![CDATA[<h3>Overview</h3><p>I wanted a <a
href="http://www.dannytsang.co.uk/index.php/tag/music/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Music">music</a> <a
href="http://www.dannytsang.co.uk/index.php/tag/server/" class="st_tag internal_tag" rel="tag" title="Posts tagged with server">server</a> for personal use so that I can access my <a
href="http://www.dannytsang.co.uk/index.php/tag/music/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Music">music</a> collection remotely or locally. A <a
href="http://www.dannytsang.co.uk/index.php/tag/web/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Web">web</a> front end with the ability to stream to various players would be key. It had to run on my <a
href="http://www.dannytsang.co.uk/index.php/tag/ubuntu/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Ubuntu">Ubuntu</a> system.</p><p>I do not / this article does not condone the use for piracy in any way.</p><h3><a
href="http://www.gnu.org/software/gnump3d/" target="_blank">GNUMP3d</a></h3><p><a
href="http://www.gnu.org/software/gnump3d/" target="_blank">GNUMP3d</a> is a GNU music server. It is in the Ubuntu 8.04 repository and includes it&#8217;s own light weight server (good and bad points to this method). It&#8217;s all self contained so it does not require Apache or a <a
href="http://www.dannytsang.co.uk/index.php/tag/database/" class="st_tag internal_tag" rel="tag" title="Posts tagged with database">database</a> installed to run it.</p><p>The web front end is very basic with only text on the web page but has the ability to record statistics. Being a basic music server it does not support album art but it does have a lot of themes built in. All settings are changed in the config file but cannot be changed using the web front end. This means starting up SSH to even change a small setting like your chosen theme.</p><p>It runs on any system which has perl installed. The problem I had with this set up was the lack of user authentication. It had a &#8220;weak&#8221; and basic method of using a .password file which can be placed in the root of the music directory but this support was removed in the new version because it was &#8220;weak&#8221;. I do not want my server to be publicly accessible (that&#8217;s just asking for trouble). I went ahead and removed it.</p><h3><a
href="http://ampache.org/" target="_blank">Ampache</a></h3><p><a
href="http://ampache.org/" target="_blank">Ampache</a> has more weight to it than <a
href="http://www.gnu.org/software/gnump3d/" target="_blank">GNUMP3d</a>. It requires a web server, PHP and <a
href="http://www.dannytsang.co.uk/index.php/tag/mysql/" class="st_tag internal_tag" rel="tag" title="Posts tagged with mysql">MySQL</a> (Not tried it with any other database). It supports tags and album art, There is also an option for lyrics but I have yet to see this in action.</p><p>The music server has many options including different playlist formats:</p><li>M3U</li><li>M3U Simple</li><li>PLS</li><li>ASX</li><li>RAM</li><li>XSPF</li><p>And also different streaming formats like shoutcast as well as different playback methods. The best part about <a
href="http://ampache.org/" target="_blank">Ampache</a> is the built in <a
href="http://www.dannytsang.co.uk/index.php/tag/flash/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Flash">flash</a> player. Just like the BBC Radio player it opens a new window with the player and controls.</p><p>The web front end allows you to create and modify playlists, upload, download, and find duplicate music files. <a
href="http://ampache.org/" target="_blank">Ampache</a> has built in access control level (ACL) which is basic but it works.</p><p>There are only 2 themes included and last.fm plugin. The non default theme is &#8220;pretty&#8221; but I find the font to be too small and there is no way of changing it. It has statistics and recently played songs which are bonus features.</p><h3>Pre-Requisite To <a
href="http://ampache.org/" target="_blank">Ampache</a></h3><p>Install Apache and MySQL if not already done so:<br
/> <code>sudo apt-get install apache mysql</code><br
/> When prompted, enter the root password.</p><p>Ensure Apache is up and running by typing <code>http://localhost</code> in a web browser. A message saying &#8220;It works!&#8221; should appear.</p><blockquote><p> Optional:<br
/> Install MySQL Administrator to easily maintain the MySQL database:<br
/> <code>sudo apt-get install mysql-admin</code></p></blockquote><p>The following steps are beyond the scope of this how to:<br
/> Connect to the database using your root account (using MySQL Admin).</p><p>Create a username and password for <a
href="http://ampache.org/" target="_blank">Ampache</a> as well as a schema. For remained of this post I will user the username=<a
href="http://ampache.org/" target="_blank">Ampache</a> and password=password using the database schema <a
href="http://ampache.org/" target="_blank">Ampache</a>.</p><p>Ensure the <a
href="http://ampache.org/" target="_blank">Ampache</a> database user has all privileges to the <a
href="http://ampache.org/" target="_blank">Ampache</a> schema.</p><h3>Install <a
href="http://ampache.org/" target="_blank">Ampache</a></h3><p>Download the latest <a
href="http://ampache.org/" target="_blank">Ampache</a> from <a
href="http://ampache.org/" target="_blank">Ampache</a>.org/&#8221;>http://<a
href="http://ampache.org/" target="_blank">Ampache</a>.org/</a> In my case it was 3.5.1<br
/> <code>wget http://<a
href="http://ampache.org/" target="_blank">Ampache</a>.org/downloads/<a
href="http://ampache.org/" target="_blank">Ampache</a>-3.5.1.tar.gz</code></p><p>Extract the compressed files:<br
/> <code>tar -xzvf <a
href="http://ampache.org/" target="_blank">Ampache</a>-3.5.1.tar.gz</code></p><p>Move (and rename) the directory <a
href="http://ampache.org/" target="_blank">Ampache</a>-3.5.1 to the web directory (by default in /var/www). Depending on where you want to access <a
href="http://ampache.org/" target="_blank">Ampache</a> will depend on where you move the directory. Do <strong>ONE</strong> of the following:</p><blockquote><p> For <a
href="http://ampache.org/" target="_blank">Ampache</a> to appear in the &#8220;root&#8221; directory e.g http://www.dannytsang.co.uk move all the files in <a
href="http://ampache.org/" target="_blank">Ampache</a>-3.5.1 to /var/www:<br
/> <code>cd <a
href="http://ampache.org/" target="_blank">Ampache</a>-3.5.1</code><br
/> <code>sudo mv * /var/www</code></p></blockquote><blockquote><p> For <a
href="http://ampache.org/" target="_blank">Ampache</a> to appear in the sub directory e.g http://www.dannytsang.co.uk/<a
href="http://ampache.org/" target="_blank">Ampache</a> move all the files in <a
href="http://ampache.org/" target="_blank">Ampache</a>-3.5.1 to /var/www:<br
/> <code>sudo mv <a
href="http://ampache.org/" target="_blank">Ampache</a>-3.5.1 /var/www/<a
href="http://ampache.org/" target="_blank">Ampache</a></code></p></blockquote><p>Ensure you have got your <a
href="http://ampache.org/" target="_blank">Ampache</a> files in the place you want to access them. I had to re-install it because I kept the directory as <a
href="http://ampache.org/" target="_blank">Ampache</a>-3.5.1 which made it http://www.dannytsang.co.uk/<a
href="http://ampache.org/" target="_blank">Ampache</a>-3.5.1/<br
/> To re-install I have to remove the file <code>/etc/apache/config.d/<a
href="http://ampache.org/" target="_blank">Ampache</a></code> and go back to the beginning to copying the file.</p><p>Next step is to ensure the file permissions are set correctly. For method one:<br
/> <code>sudo chmod -R 774 /var/www</code></p><p>For method two:<br
/> <code>sudo chmod -R 774 /var/www/<a
href="http://ampache.org/" target="_blank">Ampache</a></code><br
/> <code>sudo chown -R root:www-data /var/www/<a
href="http://ampache.org/" target="_blank">Ampache</a></code></p><p>Head over to http://localhost or http://www.localhost/<a
href="http://ampache.org/" target="_blank">Ampache</a> and follow the on screen instructions to install <a
href="http://ampache.org/" target="_blank">Ampache</a>.</p><h3>Post Install</h3><p>Everything else can be configured from the web interface with the exception of the music directory. Where ever you want to add music to <a
href="http://ampache.org/" target="_blank">Ampache</a>, you have to make sure it has at least xx4 (read) file permission otherwise the Apache / <a
href="http://ampache.org/" target="_blank">Ampache</a> will not be able to see the file. If you want to allow <a
href="http://ampache.org/" target="_blank">Ampache</a> to manage files e.g upload new music files to your library you will need to give it write access too. The best way to deal with this is to add www-data to your username group. Either way I do not recommend allowing write access for security reasons.</p><h3>Review</h3><div
align="center"><img
src="http://www.dannytsang.co.uk/wp-content/uploads/2009/07/Ampache-Login-Page-150x150.jpg" alt="Ampache Login Page" title="Ampache Login Page" width="150" height="150" class="aligncenter size-thumbnail wp-image-2218" /></div><p>I intend on using the server whilst I&#8217;m not at home e.g abroad or at work. I can listen to all my collection without carrying it around with me and now my iPhone has more juice. I only use my iPhone to listen to music when I&#8217;m not in the office or listen to podcasts.</p><p>The reason why I won&#8217;t use it for podcasts is because it doesn&#8217;t have speed playback and no bookmarking feature which allows you to resume from where you left off.</p><div
align="center"><img
src="http://www.dannytsang.co.uk/wp-content/uploads/2009/07/Flash-Player-150x150.jpg" alt="Flash Player" title="Flash Player" width="150" height="150" class="aligncenter size-thumbnail wp-image-2210" /></div><p>The Flash player was usable. It showed a dark grey buffering bar and a light grey bar for the currently playing track. A good visual of how much has been downloaded from the stream. All the tracks for the current play list is shown along with the album art cover (nice touch).</p><div
align="center"><img
src="http://www.dannytsang.co.uk/wp-content/uploads/2009/07/WMP-Player-150x150.png" alt="WMP Player" title="WMP Player" width="150" height="150" class="aligncenter size-thumbnail wp-image-2211" /></div><p>M3U streaming to Windows Media Player (WMP) worked very well. It too showed the album art and this method I could use the media keys on the computer.</p><p>Both players had reasonably good quality but the flash player lacked settings to adjust the buffer rate. The problem with both methods was the buffering. Not only did it need to buffer for each track but it had to re-buffer if a song has already played &#8211; something common to streaming media except for QuickTime.</p><p>WMP did lack the track titles until it got to the track itself. All it shows is index in the play list for the track if it hadn&#8217;t gotten to it yet.</p><p>I suffered a lot of pauses from the flash player because it had to buffer a lot through random moments through the day. However, WMP also had it&#8217;s buffering problems too but I could set the buffer limits to cope. When this happens I had to turn to the player to see what was going on, distracting me from work.</p><div
align="center"><img
src="http://www.dannytsang.co.uk/wp-content/uploads/2009/07/Ampache-Track-List-150x150.jpg" alt="Ampache Track List" title="Ampache Track List" width="150" height="150" class="aligncenter size-thumbnail wp-image-2222" /></div><p>Playlists can be a powerful tool but in this case it&#8217;s pretty simply use. There is a current playlist which you add you tracks to. You can save this list determinately as one playlist which adds a date time stamp and your username. <del
datetime="2009-07-23T18:58:00+00:00">You cannot rename it to something more useful</del>. The current playlist can be formed of multiple store playlists as well as adhoc tracks.</p><p>Ampache supports tags and track ratings. Ratings can be changed online too. It includes the usual filtering and sort of tracks by artists and albums as well as search.</p><p>Adding libraries are fairly easy. You give it a directory path and it will index the given path. Libraries may exist locally or remotely. Options to update, clean, etc will automate management of songs.</p><div
align="center"><img
src="http://www.dannytsang.co.uk/wp-content/uploads/2009/07/Ampache-ACL-150x150.jpg" alt="Ampache ACL" title="Ampache ACL" width="150" height="150" class="aligncenter size-thumbnail wp-image-2216" /></div><p>Working with Ampache User Access Control Level (ACL) was easy but may be too simple for power users. It has a drop down of all available groups for a given feature. The bad part is it assumes that any group above the selected group also has access to that feature. I believe it does not allow you to add new groups either.</p><h3>Summary</h3><p><a
href="http://ampache.org/" target="_blank">Ampache</a> is a good but media server. As always the user interface could be tweaked and a lot more plugins and features can be added e.g HTML 5 player, uPNP but that&#8217;s like asking for the world. The set up was very easily to do and does all the basics I want.</p><p><a
href="http://www.gnu.org/software/gnump3d/" target="_blank">GNUMP3d Website</a></p><p><a
href="http://ampache.org/" target="_blank">Ampache Website</a></p> <a
href='http://www.dannytsang.co.uk/index.php/ubuntu-music-streaming-server-ampache/flash-player/' title='Flash Player'><img
width="150" height="150" src="http://www.dannytsang.co.uk/wp-content/uploads/2009/07/Flash-Player-150x150.jpg" class="attachment-thumbnail" alt="Flash Player" title="Flash Player" /></a> <a
href='http://www.dannytsang.co.uk/index.php/ubuntu-music-streaming-server-ampache/wmp-player/' title='WMP Player'><img
width="150" height="150" src="http://www.dannytsang.co.uk/wp-content/uploads/2009/07/WMP-Player-150x150.png" class="attachment-thumbnail" alt="WMP Player" title="WMP Player" /></a> <a
href='http://www.dannytsang.co.uk/index.php/ubuntu-music-streaming-server-ampache/ampache-acl/' title='Ampache ACL'><img
width="150" height="150" src="http://www.dannytsang.co.uk/wp-content/uploads/2009/07/Ampache-ACL-150x150.jpg" class="attachment-thumbnail" alt="Ampache ACL" title="Ampache ACL" /></a> <a
href='http://www.dannytsang.co.uk/index.php/ubuntu-music-streaming-server-ampache/ampache-front-page/' title='Ampache Front Page'><img
width="150" height="150" src="http://www.dannytsang.co.uk/wp-content/uploads/2009/07/Ampache-Front-Page-150x150.jpg" class="attachment-thumbnail" alt="Ampache Front Page" title="Ampache Front Page" /></a> <a
href='http://www.dannytsang.co.uk/index.php/ubuntu-music-streaming-server-ampache/ampache-login-page/' title='Ampache Login Page'><img
width="150" height="150" src="http://www.dannytsang.co.uk/wp-content/uploads/2009/07/Ampache-Login-Page-150x150.jpg" class="attachment-thumbnail" alt="Ampache Login Page" title="Ampache Login Page" /></a> <a
href='http://www.dannytsang.co.uk/index.php/ubuntu-music-streaming-server-ampache/ampache-statistics/' title='Ampache Statistics'><img
width="150" height="150" src="http://www.dannytsang.co.uk/wp-content/uploads/2009/07/Ampache-Statistics-150x150.jpg" class="attachment-thumbnail" alt="Ampache Statistics" title="Ampache Statistics" /></a> <a
href='http://www.dannytsang.co.uk/index.php/ubuntu-music-streaming-server-ampache/ampache-track-list/' title='Ampache Track List'><img
width="150" height="150" src="http://www.dannytsang.co.uk/wp-content/uploads/2009/07/Ampache-Track-List-150x150.jpg" class="attachment-thumbnail" alt="Ampache Track List" title="Ampache Track List" /></a><p>Related posts:<ol><li><a
href='http://www.dannytsang.co.uk/index.php/music-live-more-or-less/' rel='bookmark' title='Music Live (More Or Less)'>Music Live (More Or Less)</a></li><li><a
href='http://www.dannytsang.co.uk/index.php/mythweb-preview/' rel='bookmark' title='MythWeb Preview'>MythWeb Preview</a></li><li><a
href='http://www.dannytsang.co.uk/index.php/sennheiser-hd555/' rel='bookmark' title='Sennheiser HD555'>Sennheiser HD555</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://www.dannytsang.co.uk/index.php/ubuntu-music-streaming-server-ampache/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Enabling Remote Access To MySQL</title><link>http://www.dannytsang.co.uk/index.php/enabling-remote-access-to-mysql/</link> <comments>http://www.dannytsang.co.uk/index.php/enabling-remote-access-to-mysql/#comments</comments> <pubDate>Sun, 28 Dec 2008 16:29:54 +0000</pubDate> <dc:creator>Danny</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Networking]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[mysql]]></category> <category><![CDATA[privileges]]></category> <category><![CDATA[remote access]]></category> <guid
isPermaLink="false">http://www.dannytsang.co.uk/?p=1521</guid> <description><![CDATA[I recently set up a virtual machine with Linux running on it to test stuff out. I ran into the issue which I have solved many times when I had installed my server at home which has a LAMP set &#8230; <a
href="http://www.dannytsang.co.uk/index.php/enabling-remote-access-to-mysql/">Continue reading <span
class="meta-nav">&#8594;</span></a> Related posts:<ol><li><a
href='http://www.dannytsang.co.uk/index.php/mysql-tuning/' rel='bookmark' title='MySQL Tuning'>MySQL Tuning</a></li><li><a
href='http://www.dannytsang.co.uk/index.php/freepbx-mysql-caller-lookup-source/' rel='bookmark' title='FreePBX MySQL Caller Lookup Source'>FreePBX MySQL Caller Lookup Source</a></li><li><a
href='http://www.dannytsang.co.uk/index.php/netgear-dg834n-on-o2-broadband/' rel='bookmark' title='Netgear DG834N On O2 Broadband'>Netgear DG834N On O2 Broadband</a></li></ol>]]></description> <content:encoded><![CDATA[<p>I recently set up a virtual machine with <a
href="http://www.dannytsang.co.uk/index.php/tag/linux/" class="st_tag internal_tag" rel="tag" title="Posts tagged with Linux">Linux</a> running on it to test stuff out. I ran into the issue which I have solved many times when I had installed my <a
href="http://www.dannytsang.co.uk/index.php/tag/server/" class="st_tag internal_tag" rel="tag" title="Posts tagged with server">server</a> at home which has a LAMP set up. By default <a
href="http://www.dannytsang.co.uk/index.php/tag/mysql/" class="st_tag internal_tag" rel="tag" title="Posts tagged with mysql">MySQL</a> restricts access to the <a
href="http://www.dannytsang.co.uk/index.php/tag/database/" class="st_tag internal_tag" rel="tag" title="Posts tagged with database">database</a> to only root (because this is the only account that have been created) and on the local machine access only.</p><p>First edit the MySQL configuration file. On Fedora this is located at:<br
/> <code>/etc/my.cnf</code><br
/> and comment out or delete this line:</p><blockquote><p>bind-address                127.0.0.1</p></blockquote><p>to</p><blockquote><p>#bind-address                127.0.0.1</p></blockquote><p>Save the file and edit the permissions in mysql<br
/> <code>mysql -u root -p</code><br
/> A password prompt for root should appear. Once logged into MySQL execute this command:<br
/> <code>GRANT ALL <a
href="http://www.dannytsang.co.uk/index.php/tag/privileges/" class="st_tag internal_tag" rel="tag" title="Posts tagged with privileges">PRIVILEGES</a> ON *.* TO ''@'%' IDENTIFIED BY 'password'</code></p><p>where:</p><ul><li>GRANT ALL PRIVILEGES ON &#8211; Gives full access to&#8230;</li><li>*.* &#8211; All tables. May be replaced with database or schema name</li><li>&#8216;root&#8217; &#8211; user to grant permission to. May be replaced with other user names</li><li>&#8216;%&#8217; &#8211; Any host wildcard. Can be replaced with domain or IP address to allow user to connect from</li><li>&#8216;password&#8217; &#8211; The password for the user. May had different passwords for different domain / location of connection e.g localhost can have one password and 192.168.0.1 may have another</li></ul><p>Restart MySQL:<br
/> <code>sudo /etc/init.d/mysql restart</code></p><p>Related posts:<ol><li><a
href='http://www.dannytsang.co.uk/index.php/mysql-tuning/' rel='bookmark' title='MySQL Tuning'>MySQL Tuning</a></li><li><a
href='http://www.dannytsang.co.uk/index.php/freepbx-mysql-caller-lookup-source/' rel='bookmark' title='FreePBX MySQL Caller Lookup Source'>FreePBX MySQL Caller Lookup Source</a></li><li><a
href='http://www.dannytsang.co.uk/index.php/netgear-dg834n-on-o2-broadband/' rel='bookmark' title='Netgear DG834N On O2 Broadband'>Netgear DG834N On O2 Broadband</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://www.dannytsang.co.uk/index.php/enabling-remote-access-to-mysql/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
