<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://secure.freeside.biz/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=IsletaCordova</id>
		<title>Freeside - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://secure.freeside.biz/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=IsletaCordova"/>
		<link rel="alternate" type="text/html" href="https://secure.freeside.biz/mediawiki/index.php/Special:Contributions/IsletaCordova"/>
		<updated>2026-08-26T09:13:56Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.7</generator>

	<entry>
		<id>https://secure.freeside.biz/mediawiki/index.php?title=3rd_party_software/Asterisk&amp;diff=6625</id>
		<title>3rd party software/Asterisk</title>
		<link rel="alternate" type="text/html" href="https://secure.freeside.biz/mediawiki/index.php?title=3rd_party_software/Asterisk&amp;diff=6625"/>
				<updated>2011-11-15T15:00:34Z</updated>
		
		<summary type="html">&lt;p&gt;IsletaCordova: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:3rd_party_software]]&lt;br /&gt;
&lt;br /&gt;
Asterisk can be used as &amp;lt;b&amp;gt;&amp;lt;em&amp;gt;Soft Switch&amp;lt;/em&amp;gt;&amp;lt;/b&amp;gt; (among many other things).  Freeside can examine recorded CDR data for subscriber billing purposes.&lt;br /&gt;
&lt;br /&gt;
== cdr_pgsql ==&lt;br /&gt;
&lt;br /&gt;
Call detail records are stored by asterisk (by means of the cdr_pgsql extension) into a [[postgres]] database of our choice.  We will need to edit &amp;lt;code&amp;gt;/etc/asterisk/cdr_pgsql.conf&amp;lt;/code&amp;gt;, add the asterisk user to postgres, add rights for asterisk to access the cdr table, and verify settings actually work.&lt;br /&gt;
&lt;br /&gt;
=== cdr_pgsql.conf ===&lt;br /&gt;
&lt;br /&gt;
This is our example config file.  You will need to change the password to suit your install.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;; Sample Asterisk config file for CDR logging to PostgresSQL&lt;br /&gt;
&lt;br /&gt;
[global]&lt;br /&gt;
hostname=postgres&lt;br /&gt;
port=5432&lt;br /&gt;
dbname=freeside&lt;br /&gt;
password=FIXTHIS&lt;br /&gt;
user=asterisk&lt;br /&gt;
table=cdr               ;SQL table where CDRs will be inserted&lt;br /&gt;
spool=pgsql.spool&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== pg_hba.conf ===&lt;br /&gt;
&lt;br /&gt;
This &amp;lt;code&amp;gt;pg_hba.conf&amp;lt;/code&amp;gt; sample is only a snippet of the ACL to permit asterisk to connect.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# TYPE          DATABASE        USER            CIDR-ADDRESS            METHOD&lt;br /&gt;
hostssl         freeside        asterisk        10.14.0.0/24              md5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Reload postgres'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;freeside:~# /etc/init.d/postgresql-8.1 reload&lt;br /&gt;
Reloading PostgreSQL 8.1 database server: main.&lt;br /&gt;
freeside:~#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you forget these steps, you might see this error message on the asterisk console (or logs) after the call is finished. (eg, at hangup)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Feb 20 21:39:52 ERROR[4322]: cdr_pgsql.c:89 pgsql_log: cdr_pgsql: Reason: FATAL:  no pg_hba.conf entry for host &amp;quot;10.141.0.5&amp;quot;, user &amp;quot;asterisk&amp;quot;, database &amp;quot;freeside&amp;quot;, SSL off&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See Also: [http://www.postgresql.org/docs/8.1/interactive/client-authentication.html#AUTH-PG-HBA-CONF pg_hba.conf at postgres.org] for more information on Postgres client authentication.&lt;br /&gt;
&lt;br /&gt;
=== Create asterisk pg user ===&lt;br /&gt;
&lt;br /&gt;
As the postgres superuser, create a non-privileged asterisk user, and set the password saved in &amp;lt;code&amp;gt;cdr_pgsql.conf&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;postgres@freeside:~$ createuser -P asterisk&lt;br /&gt;
Enter password for user &amp;quot;asterisk&amp;quot;: &lt;br /&gt;
Enter it again: &lt;br /&gt;
Shall the new role be a superuser? (y/n) n&lt;br /&gt;
Shall the new role be allowed to create databases? (y/n) n&lt;br /&gt;
Shall the new role be allowed to create more new roles? (y/n) n&lt;br /&gt;
CREATE ROLE&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== psql login test ===&lt;br /&gt;
&lt;br /&gt;
We login to the database from the asterisk server to verify our setup is (so far) working okay.  '''pghostname''' is the postgres host where your freeside database is.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pbx:~$ psql -h pghostname -U asterisk freeside&lt;br /&gt;
Password for user asterisk:&lt;br /&gt;
Welcome to psql 8.1.11, the PostgreSQL interactive terminal.&lt;br /&gt;
&lt;br /&gt;
Type:  \copyright for distribution terms&lt;br /&gt;
       \h for help with SQL commands&lt;br /&gt;
       \? for help with psql commands&lt;br /&gt;
       \g or terminate with semicolon to execute query&lt;br /&gt;
       \q to quit&lt;br /&gt;
&lt;br /&gt;
SSL connection (cipher: DHE-RSA-AES256-SHA, bits: 256)&lt;br /&gt;
&lt;br /&gt;
freeside=&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== GRANT asterisk permissions ===&lt;br /&gt;
&lt;br /&gt;
We are allowing asterisk limited access to the Freeside database.  Freeside isn't expected to have GRANT permissions on the freeside database.  Connect as the [[postgres superuser]].&lt;br /&gt;
&lt;br /&gt;
Code snippet to '''GRANT''' selective permissions to asterisk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;GRANT INSERT ON cdr TO asterisk;&lt;br /&gt;
GRANT UPDATE ON cdr_acctid_seq to asterisk;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The psql client will respond similar to this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;freeside:~# su - postgres&lt;br /&gt;
postgres@freeside:~$ psql freeside&lt;br /&gt;
Welcome to psql 8.1.11, the PostgreSQL interactive terminal.&lt;br /&gt;
&lt;br /&gt;
Type:  \copyright for distribution terms&lt;br /&gt;
       \h for help with SQL commands&lt;br /&gt;
       \? for help with psql commands&lt;br /&gt;
       \g or terminate with semicolon to execute query&lt;br /&gt;
       \q to quit&lt;br /&gt;
&lt;br /&gt;
freeside=# GRANT INSERT ON cdr TO asterisk;&lt;br /&gt;
GRANT&lt;br /&gt;
freeside=# GRANT UPDATE ON cdr_acctid_seq to asterisk;&lt;br /&gt;
GRANT&lt;br /&gt;
freeside=#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reload cdr_pgsql ===&lt;br /&gt;
&lt;br /&gt;
Changes to the cdr_pgsql.conf only need a reload of the &amp;lt;code&amp;gt;cdr_pgsql.so&amp;lt;/code&amp;gt; module for changes to be applied immediately.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;asterisk -rx &amp;quot;reload cdr_pgsql.so&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Make a test call ===&lt;br /&gt;
&lt;br /&gt;
If your asterisk configuration is able to make calls, place a test call that applies to your needs of freeside and asterisk (eg, a sample call that would be billed).&lt;br /&gt;
&lt;br /&gt;
=== Verify new data records ===&lt;br /&gt;
&lt;br /&gt;
We check for CDR entries to confirm our call progress is being recorded properly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;freeside=# SELECT acctid,calldate,src,dst,duration,billsec,disposition from cdr;&lt;br /&gt;
 acctid |        calldate        |     src    |    dst      | duration | billsec | disposition&lt;br /&gt;
--------+------------------------+------------+-------------+----------+---------+-------------&lt;br /&gt;
      1 | 2008-02-20 15:40:00+00 | 8005550149 | 18004664411 |       19 |       0 | NO ANSWER&lt;br /&gt;
      2 | 2008-02-20 15:48:52+00 | 8005550149 | 18004664411 |       14 |      10 | ANSWERED&lt;br /&gt;
(2 rows)&lt;br /&gt;
&lt;br /&gt;
freeside=#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting ===&lt;br /&gt;
&lt;br /&gt;
Trouble may arise due to insufficent permissions, invalid username or password in the config files, failure to reload cdr_pgsql after settings are updated, and a number of other related factors.  The system logs and asterisk console are a good starting point when attempting to isolate underlying causes of your issue.&lt;br /&gt;
&lt;br /&gt;
This sample was due to insufficent '''GRANT''' permissions to asterisk on the cdr_acctid_seq object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Feb 20 15:37:40 ERROR[3404]: cdr_pgsql.c:159 pgsql_log: cdr_pgsql: Failed to insert call detail record into database!&lt;br /&gt;
Feb 20 15:37:40 ERROR[3404]: cdr_pgsql.c:160 pgsql_log: cdr_pgsql: Reason: ERROR:  permission denied for sequence cdr_acctid_seq&lt;br /&gt;
Feb 20 15:37:40 ERROR[3404]: cdr_pgsql.c:161 pgsql_log: cdr_pgsql: Connection may have been lost... attempting to reconnect.&lt;br /&gt;
Feb 20 15:37:40 ERROR[3404]: cdr_pgsql.c:164 pgsql_log: cdr_pgsql: Connection reestablished.&lt;br /&gt;
Feb 20 15:37:40 ERROR[3404]: cdr_pgsql.c:170 pgsql_log: cdr_pgsql: HARD ERROR!  Attempted reconnection failed.  DROPPING CALL RECORD!&lt;br /&gt;
Feb 20 15:37:40 ERROR[3404]: cdr_pgsql.c:171 pgsql_log: cdr_pgsql: Reason: ERROR:  permission denied for sequence cdr_acctid_seq&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Related Topics ==&lt;br /&gt;
* [[Freeside:1.7:Documentation:Administration:VoIP]]&lt;br /&gt;
[[Category:svc_phone]]&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [http://en.wikipedia.org/w/index.php?title=Telephone_switch Telephone Switching] on Wikipedia.&lt;br /&gt;
* [http://www.voip-info.org/wiki/view/Asterisk+cdr+pgsql voip-info.org asterisk cdr_pgsql howto]&lt;br /&gt;
* [http://www.postgresql.org/docs/manuals/ Manuals at postgres.org]&lt;br /&gt;
[http://custom-essay.ws/index.php essay paper]&lt;/div&gt;</summary>
		<author><name>IsletaCordova</name></author>	</entry>

	<entry>
		<id>https://secure.freeside.biz/mediawiki/index.php?title=RPM_Build_system&amp;diff=6624</id>
		<title>RPM Build system</title>
		<link rel="alternate" type="text/html" href="https://secure.freeside.biz/mediawiki/index.php?title=RPM_Build_system&amp;diff=6624"/>
				<updated>2011-11-15T15:00:26Z</updated>
		
		<summary type="html">&lt;p&gt;IsletaCordova: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Current system =&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
* Uses &amp;quot;mock&amp;quot;, &amp;quot;createrepo&amp;quot; and &amp;quot;ovid&amp;quot; (not necessarily attached to those tools)&lt;br /&gt;
* Controlled from Debian 5 server in conjunction with CentOS 5 vserver.  (Not attached to this architecture; can move more things to the CentOS side and/or setup a vmware image instead of a vserver if either helps)&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
* enrpm is used to package new Perl deps from CPAN or .tar.gz files and update the repo&lt;br /&gt;
* cvs-check-and-build is used to package new Freeside versions and update the repo&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
* [http://freeside.biz/~ivan/rpm_buildsys.tar.gz http://freeside.biz/~ivan/rpm_buildsys.tar.gz]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Freeside:Documentation:RPMBuildSystem]]&lt;br /&gt;
* [[Freeside:Documentation:CreatingRPMRepo]]&lt;br /&gt;
&lt;br /&gt;
= Targets =&lt;br /&gt;
&lt;br /&gt;
== Primary ==&lt;br /&gt;
&lt;br /&gt;
* Freeside 2.1, RHEL and CentOS 5&lt;br /&gt;
&lt;br /&gt;
== Secondary ==&lt;br /&gt;
&lt;br /&gt;
* RHEL and CentOS 6&lt;br /&gt;
* Freeside 1.7, SLES 10&lt;br /&gt;
&lt;br /&gt;
== Tertiary ==&lt;br /&gt;
&lt;br /&gt;
* Current verions, SLES 10&lt;br /&gt;
* SLES 11&lt;br /&gt;
&lt;br /&gt;
= Future directions =&lt;br /&gt;
&lt;br /&gt;
# get a repo going for Freeside 2.1 on RHEL/CentOS 5, perl deps, etc.&lt;br /&gt;
# Fix problems reliably building current code from CVS (default &amp;quot;force flag&amp;quot; on?), overhaul build system as necessary.  current build system keeps including old code when we try to iterate fixes out to customers.&lt;br /&gt;
# Fix to work with current yum/createrepo/mock (drop RHEL/CentOS 4)&lt;br /&gt;
# Check build system into CVS, figure out how to have rpm signing stuff pull the passphrase from elsewhere, update to new key&lt;br /&gt;
# Optimize build times, omit unneeded platforms, parallelize things, add options to do a specific build only&lt;br /&gt;
# get a repo going for Freeside 2.1 on RHEL/CentOS 5&lt;br /&gt;
# Add RT to build (2.1+, RHEL5+)&lt;br /&gt;
[http://custom-essay.ws/index.php custom essays]&lt;/div&gt;</summary>
		<author><name>IsletaCordova</name></author>	</entry>

	</feed>