Archive

Author Archive

Sphinx search server

March 2nd, 2011

Sphinx is an open source search engine designed to search text extremely quickly. It can be included in your programs to provide custom search functionality. In this document I am trying to explain you how to set it up in a linux machine and how php programs, that use mysql database, can call the sphinx search engine to provide custom search feature. So let us start with the installation part.

Download and extract the tarball of sphinx


$ tar xzvf sphinx-0.9.8.tar.gz
$ cd sphinx

Run the configuration program:


$ ./configure

We can specify the location where sphinx should be installed by using –prefix option.
Build the binaries.


$ make

Install the binaries.

$ make install

By default, Sphinx utilities are installed in /usr/local/bin/. Sphinx has three components: an index generator, a search engine, and a command-line search utility: The index generator is called indexer. It queries your database, indexes each column in each row of the result, and ties each index entry to the row’s primary key. The search engine is a daemon called searchd. The daemon receives search terms and other parameters, scours one or more indices, and returns a result. If a match is made, searchd returns an array of primary keys. Given those keys, an application can run a query against the associated database to find the complete records that comprise the match. Searchd communicates to applications through a socket connection on port 3312. The handy search utility lets you conduct searches from the command line without writing code. If searchd returns a match, search queries the database and displays the rows in the match set. The search utility is useful for debugging your Sphinx configuration.

To use Sphinx, you will need to create a configuration file. Default configuration file name is sphinx.conf. All Sphinx programs look for this file in current working directory by default. Sample configuration file, sphinx.conf.dist, which has all the options documented, is created by configure. Copy and edit that sample file to make your own configuration.

$ cd /usr/local/etc
$ cp sphinx.conf.dist sphinx.conf

To start with sphinx, you must define one or more sources and one or more indexes. A source identifies the database to index, provides authentication information, and defines the query to use to construct each row. An index requires a source (that is, a set of rows) and defines how the data extracted from the source should be cataloged. You define your source(s) and index(es) in the sphinx.conf file. Sample configuration file is setup to index documents table from Mysql database test. So there’s example.sql sample data file to populate that table with a few documents for testing purposes.


$ mysql -u test < /usr/local/sphinx/etc/example.sql

We need to specify database information in configuration file like the following.


source src1
{
# data source type. mandatory, no default value
# known types are mysql, pgsql, mssql, xmlpipe, xmlpipe2, odbc
type                                    = mysql

#####################################################################
## SQL settings (for 'mysql' and 'pgsql' types)
#####################################################################

# some straightforward parameters for SQL source types
sql_host                                = localhost
sql_user                                = test
sql_pass                                = test
sql_db                                  = test
sql_port                                = 3306  # optional, default is 3306

Next, create a query to produce rows to be indexed. The sql_query must include the primary key you want to use for subsequent lookups, and it must include all the fields you want to index and use as groups. It is specified in the configuration file as the following.

sql_query                               = \
SELECT id, group_id, UNIX_TIMESTAMP(date_added) AS date_added, title, content \
FROM documents

And the search utility uses sql_query_info to find the records that match. In the query, $id is replaced with each primary key that searchd returns.

sql_query_info          = SELECT * FROM documents WHERE id=$id

Next we need to build an index.

index test1
{
# document source(s) to index
source= src1
# index files path and file name, without extension
# mandatory, path must be writable, extensions will be auto-appended
path                    = /var/test1
}

Here source is src1 and path defines where to store the index data. You have to make sure that this directory exists before generating the index. The searchd section at bottom configures the searchd daemon itself.

searchd
{
port                = 3312
log                    = /var/log/searchd/searchd.log
query_log            = /var/log/searchd/query.log
pid_file            = /var/log/searchd/searchd.pid
}

We are now ready to build the index for the database table. Before running indexer program to generate indices you have to make sure that mysql program is running.

$/usr/local/bin/indexer --config /usr/local/etc/sphinx.conf --all
Sphinx 0.9.9-release (r2117)
Copyright (c) 2001-2009, Andrew Aksyonoff
using config file '/usr/local/etc/sphinx.conf'...
indexing index 'test1'...
collected 6 docs, 0.0 MB
sorted 0.0 Mhits, 100.0% done
total 6 docs, 243 bytes
total 0.018 sec, 12926 bytes/sec, 319.16 docs/sec

The -all argument rebuilds all the indexes listed in sphinx.conf. You can use a different argument to rebuild fewer if you don’t need to rebuild every index.

You can now test the index with the search utility

# /usr/local/bin/search --config /usr/local/etc/sphinx.conf spark
Sphinx 0.9.9-release (r2117)
Copyright (c) 2001-2009, Andrew Aksyonoff

using config file '/usr/local/etc/sphinx.conf'...
index 'test1': query 'spark ': returned 2 matches of 2 total in 0.006 sec

displaying matches:
1. document=5, weight=2, group_id=2, date_added=Sun Feb 13 11:50:30 2011
id=5
group_id=2
group_id2=9
date_added=2011-02-13 11:50:30
title=spark
content=spark support
2. document=6, weight=2, group_id=2, date_added=Sun Feb 13 11:53:30 2011
id=6
group_id=2
group_id2=10
date_added=2011-02-13 11:53:30
title=spark cochin
content=spark support cochin

To query the index from your PHP scripts, you need to run the search daemon which your script will talk to and Include the API (it’s located in api/sphinxapi.php) into your own scripts and use it.

VN:F [1.9.6_1107]
Rating: 9.3/10 (3 votes cast)
VN:F [1.9.6_1107]
Rating: 0 (from 2 votes)

Tino Thomas linux

Xen Bridge Networking

December 19th, 2010

Xen provides couple of different networking options like bridge networking, nat networking and route networking. Bridging is a technique used for connecting different network segments. It is the default option for Xen networking as it simply connects all the virtual machines to the outside world through virtual network interfaces connected to the bridges created by Xen. When using bridged networking, Xen creates a network bridge and then connects the actual physical network interface to this bridge. Virtual network interfaces are then created for dom0 and each of the guest domains; these are all attached to the network bridge. In this manner, all the domains can connect to any address to which the physical network interface can connect.

In the Xend configuration file /etc/xen/xend-config.sxp, the default directives related to the virtual network are shown below. Notice that the network-bridge and vif-bridge lines are the only ones uncommented. These are the lines needed for bridged networking.


(network-script network-bridge)
(vif-script vif-bridge)
# (network-script network-route)
# (vif-script vif-route)
# (network-script network-nat)
# (vif-script vif-nat)

The network script network-bridge is in the directory /etc/xen/scripts. It sets up the networking environment and uses the bridge-utils tool to set up the software bridge xenbr0. The vif script vif-bridge is also in the same directory as the network script. It sets up the backend vif for the guest domain when a guest domain boots up.

Before creating any guest domains if you check the network interfaces in Dom0 by typing ‘ifconfig’ command, you can see an output like the following.

[root@localhost xen]# ifconfig
eth0   Link encap:Ethernet  HWaddr 48:5B:39:89:E5:43
       inet addr:192.168.1.86  Bcast:192.168.1.255 Mask:255.255.255.0
lo     Link encap:Local Loopback
       inet addr:127.0.0.1  Mask:255.0.0.0
peth0  Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF
       inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link
vif0.0 Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF
       inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link
xenbr0 Link encap:Ethernet  HWaddr B2:8B:2C:4C:ED:0E
       UP BROADCAST RUNNING NOARP  MTU:1500 Metric:1

You may be wondering how and when all these network interfaces are created. Here is the sequence of events that happen when you boot up your Xen server and xend starts up (only dom0 is started and no guest domains set to auto start by xend. I only have one physical network interface on my server and it is named eth0).

1. Execute the /etc/xen/scripts/network-bridge script in /etc/xen/xend-config.sxp

2. This will create a new network bridge called xenbr0.

3. Copy the MAC address and IP address from the physical network
interface eth0.

4. Stop the physical network interface eth0.

5. Create a new pair of connected virtual ethernet interfaces—veth0 and vif0.0.

6. Assign the previously copied MAC address and IP address to the virtual  interface   veth0.

7. Rename the physical network interface to peth0 from eth0.

8. Rename the virtual network interface veth0 to eth0.

9. Attach peth0 and vif0.0 to the bridge xenbr0.

10. Bring up the bridge xenbr0, and the network interfaces peth0, eth0, and vif0.0.

For each new domU, Xen creates a new pair of “connected virtual ethernet interfaces”, with one end in domU and the other in dom0. For linux domU’s, the device name it sees is named eth0. The other end of that virtual ethernet interface pair exists within dom0 as interface vif<id#>.0. When a domU is shutdown, the virtual ethernet interfaces for it are deleted.

when a domU starts up, xend (running in dom0) runs the vif-bridge script, which:
- attaches vif<id#>.0 to xenbr0
- vif<id#>.0 is brought up

So you would be able to see additional network interfaces after creating new guest domains.

[root@localhost xen]# ifconfig
eth0   Link encap:Ethernet  HWaddr 48:5B:39:89:E5:43
       inet addr:192.168.1.86  Bcast:192.168.1.255  Mask:255.255.255.0
lo     Link encap:Local Loopback
       inet addr:127.0.0.1  Mask:255.0.0.0
peth0  Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF
       inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link
vif0.0 Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF
       inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link
vif1.0 Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF
       inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link
vif2.0 Link encap:Ethernet  HWaddr FE:FF:FF:FF:FF:FF
       inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link
xenbr0 Link encap:Ethernet  HWaddr B2:8B:2C:4C:ED:0E
       UP BROADCAST RUNNING NOARP  MTU:1500 Metric:1

Here you can see the newly added interfaces vif1.0 and vif2.0 , which are virtual interfaces for the new guest domains created.

Inside the guest domain, the network interfaces look the same as on a typical machine.

[user@DomU]# ifconfig -a
eth0   Link encap:Ethernet  HWaddr 00:16:3E:5A:32:DA
       inet addr:128.153.144.96 Bcast:128.153.145.255 Mask:255.255.254.0
       inet6 addr: fe80::216:3eff:fe5a:32da/64 Scope:Link
lo     Link encap:Local Loopback
       inet addr:127.0.0.1  Mask:255.0.0.0
       inet6 addr: ::1/128 Scope:Host

In a guest domain, whether the Xen network is in bridging mode or routing mode, the network interface looks the same as it would in a nonvirtualized machine.

Each DomU (guest domain) have a configuration file where we can specify the network settings associated with that domain. It is specified as the following in the corresponding configuration file.


vif = [mac=00:16:3E:02:00:41,bridge=xenbr0' ]

vif: Specifies the virtual network interface configuration for the domain. This is provided in the following format:
vif = [ "key1 = value1", "key2 = value2" ]
The common options used for this configuration directive are
bridge: Specifies the network bridge that will be used for this interface.
mac: Specifies the MAC address for this virtual interface.
If you do not provide a MAC address, it is set to a random MAC address by Xen on boot.The random address is selected from the range of addresses assigned to Xensource by IEEE. At this point you understand how all the interfaces that have been listed  in Dom0 are created
and what they mean. Next we can have a look at the packet flow in bridged networking. For that please refer the following figure.

.
.

Packet arrives at hardware, is handled by dom0 Ethernet driver and appears on peth0. peth0  is bound to to the bridge, so its passed to the bridge from there.We can see that peth0, xenbr0, vif0.0, and vif1.0 are sharing the same MAC address FE:FF:FF:FF:FF:FF, which is the Ethernet broadcast address. This indicates that the physical interface, the loopback device of Domain0, and the backend interfaces of guest domains are all broadcasting to the bridge interface xenbr0. When the physical network interface receives the packets, it sends them all directly to the bridge interface xenbr0. Now the bridge distributes the packet, just like a switch would.The software bridge determines which domain’s backend interface to forward those packets to by the receiver’s MAC addresses. So, peth0 does not need to have an IP, only a MAC address. The vif interface puts the packet into Xen, which then puts the packet back to the domain the vif leads to.Its also done that way for dom0, hence the vif0.0->eth0 pair.

If you want to use a bridge name other than the default one( xenbr0) you can specify it in the xend configuration file like the following.


(network-script 'network-bridge bridge=<name>')

where <name> is the desired name of bridge.

Note also that network-bridge defaults to binding eth0 to the bridge. To change the physical network card, use


(network-script 'network-bridge bridge=<name> netdev=eth1')

If a server has more than one physical network interface, it may be useful to separate traffic between interfaces by creating additional bridges. In this way, one could connect xenbr0 to peth0 and xenbr1 to peth1 and give a virtual machine in say dom1 exclusive access to xenbr1. Everything necessary for this is present in the network-bridge script.

While useful from the command line, the /etc/xen/xend-config.sxp script will require some tuning in order to create bridges automatically during boot. By default, this script calls the network-bridge script; however, this script can only be called once. To avoid this problem, you need to create a network-wrapper script, which can be configured to call the network-bridge script twice. Use the following steps to configure this:

1. Create a script /etc/xen/scripts/network-wrapper with the following contents:


#!/bin/sh
/etc/xen/scripts/network-bridge $1 netdev=eth0 bridge=xenbr0
/etc/xen/scripts/network-bridge $1 netdev=eth1 bridge=xenbr1

Tune the /etc/xen/xend-config.sxp script so that it calls this network wrapper script, by adding the following:


(network-script network-bridge-wrapper)

3. Make sure that in the configuration file for each of the unprivileged domains, you indicate what network bridge to use. This would make the vif lines look like the following example line:


vif=[ 'bridge=xenbr1', 'mac=00:16:3e:07:d2:0e', ]
VN:F [1.9.6_1107]
Rating: 10.0/10 (3 votes cast)
VN:F [1.9.6_1107]
Rating: +2 (from 2 votes)

Tino Thomas linux , , , , , , , , ,

How to connect to IM gateways through openfire

July 31st, 2010

The IM Gateway plugin for Openfire provides connectivity to other IM networks (AIM, ICQ, IRC, MSN, Yahoo, etc). It uses internal mechanisms to smooth the interaction with the various transports that standard transports can not currently provide. This plugin is called kracken im gateway plugin. It can be downloaded from the following link.


http://sourceforge.net/projects/kraken-gateway/

Openfire admin panel provides an option to upload new plugins into it. The file should be in .jar format.

.

Once the plugin file is uploaded it will be listed under plugin section in admin panel.

Next step is to select the networks that we want to connect from openfire. For that you need to go to Gateways in admin panel and select the gateways you want to connect to and its setttings.

Checking a gateway enables the service.

You can test the connection to the gateway network from the openfire server by clicking the ‘Tests’ link.

Also there is an option to specify the users who all are allowed to connect to the gateway service.

Next you need to do gateway service registration for a particular openfire user. For that click on “Registrations” in the left-hand menu. Then click on “Add a new registration.”

Here user is the openfire user which we want to connect to a gateway. Dropdown window for ‘gateways’ lists gateways we selected in one of the earlier steps. You can select the desired one from it. username and password should be corresponding gateway service account credentials. Here it should be login credentials of msn messanger.

You can associate all the gateway services, you want, to a particular openfire user by adding like this. Once you associate gateway services like this you can login into your openfire account through one of the clients, here i am using pidgin to connect to the openfire server. Once you login into openfire account through a client you may be able to see all the gateway services associated with that user are listed in the client.

Thus you will be able to login into all the associated gateways by just logging in to the openfire user account and you can have all your gateway services at once place.

VN:F [1.9.6_1107]
Rating: 7.5/10 (2 votes cast)
VN:F [1.9.6_1107]
Rating: +1 (from 1 vote)

Tino Thomas linux , , , , , , , ,

Dynamic Agent Login in AsteriskNOW

July 21st, 2010

This blog explains how an agent can login to a queue directly through an extension. In asterisk’s terms an agent is human and an extension is device. Here an agent will be able to login into the queue through an extension by dialing a queue login number and you do not need to make any configurations in agents.conf or queues.conf.  For this setup to work properly, you need to have the correct dialplans in corresponding  extension files.

In the case of asteriskNOW, extension_additional.conf contains dialplans to handle  queue login.

[ext-queues]
exten => 5000*,1,Macro(agent-add,5000,)
exten => 5000**,1,Macro(agent-del,5000,5000)

If [macro-agent-add] and [macro-agent-del] contexts are already present in extensions_additional.conf you need to put the dialplans for these contexts in /etc/asterisk/extensions_override_freepbx.conf otherwise you can add the dialplans in /etc/asterisk/extensions_custom.conf.

[macro-agent-add]
include => macro-agent-add-custom
exten => s,1,Wait(1)
exten => s,n,Macro(user-callerid,SKIPTTL)
exten => s,n,Set(CALLBACKNUM=${AMPUSER})
exten => s,n,AddQueueMember(${ARG1},Local/${CALLBACKNUM}@from-internal/n)
exten => s,n,UserEvent(Agentlogin,Agent: ${CALLBACKNUM})
exten => s,n,Wait(1)
exten => s,n,Playback(agent-loginok&with&extension)
exten => s,n,SayDigits(${CALLBACKNUM})
exten => s,n,Hangup
exten => s,n,MacroExit()
exten => s,n(invalid),Playback(pbx-invalid)
exten => s,n,Goto(a3)

; end of [macro-agent-add]
[macro-agent-del]
include => macro-agent-del-custom
exten => s,1,Wait(1)
exten => s,n,Macro(user-callerid,SKIPTTL)
exten => s,n,Set(CALLBACKNUM=${AMPUSER})
exten => s,n,ExecIf($["${CALLBACKNUM}" = ""],Set,CALLBACKNUM=${CALLERID(number)})
exten => s,n,RemoveQueueMember(${ARG1},Local/${CALLBACKNUM}@from-internal/n)
exten => s,n,UserEvent(RefreshQueue)
exten => s,n,Wait(1)
exten => s,n,Playback(agent-loggedoff&with&extension)
exten => s,n,SayDigits(${CALLBACKNUM})
exten => s,n,Hangup
; end of [macro-agent-del]

In this dialplan 5000 is the queue number. You can use any queue number instead of it. To login to queue dial 5000* from your phone (either a softphone like xlite or a hard phone like Linksys) and you will hear a login confirmation and to logout from the queue you need to dial 5000** as per the dial plan. The advantage of this method is that an agent can do a login or logout by just dialing the corresponding number. Once logged in we can check current members in the queue using the command.

From shell
#asterisk -rx "queue show 5000"   (5000 is the queue number)
From asterisk CLI
> queue show 5000
VN:F [1.9.6_1107]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.6_1107]
Rating: 0 (from 0 votes)

Tino Thomas linux , , , , , , ,

How to customize call recording location in asteriskNOW

July 20th, 2010

Customize call recording location in asteriskNow.

By default AsteriskNOW saves call recordings under the directory /var/spool/asterisk/monitor. This way of call recording has got some disadvantages since number of files can grow beyond a limit . You will find it difficult to recognize call recordings related to a particular extension. A solution to this issue is to customize the call recording location. You need to override the dialplan for the context [macro-record-enable] present in /etc/asterisk/extensions_additional.conf. To override these dialplans you need to add new dialplan in a file called /etc/asterisk/extensions_override_freepbx.conf.  Following is the default dialplan for the context [macro-record-enable] present in /etc/asterisk/extensions_additional.conf.


[macro-record-enable]
include => macro-record-enable-custom
exten => s,1,GotoIf($["${BLINDTRANSFER}" = ""]?check)
exten => s,n,ResetCDR(w)
exten => s,n,StopMixMonitor()
exten => s,n(check),AGI(recordingcheck,${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)},${UNIQUEID})
exten => s,n,MacroExit()
exten => s,1+998(record),MixMonitor(${MIXMON_DIR}${CALLFILENAME}.${MIXMON_FORMAT},,${MIXMON_POST})
; end of [macro-record-enable]

You need to add the following dialplan in /etc/asterisk/extensions_override_freepbx.conf, which will override the above dialplan to customize the call recording location.


[macro-record-enable]
include => macro-record-enable-custom
exten => s,1,GotoIf($["${BLINDTRANSFER}" = ""]?check)
exten => s,n,ResetCDR(w)
exten => s,n,StopMixMonitor()
exten => s,n(check),AGI(recordingcheck,${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)},${UNIQUEID})
exten => s,n,MacroExit()
exten => s,n(record),System(/bin/mkdir -p /var/spool/asterisk/monitor/freepbx/${STRFTIME(${EPOCH},,%Y)}/${STRFTIME(${EPOCH},
,%m)}/${STRFTIME(${EPOCH},,%d)}/${ARG1}/${UNIQUEID})
exten => s,n,MixMonitor(/var/spool/asterisk/monitor/freepbx/${STRFTIME(${EPOCH},,%Y)}/${STRFTIME(${EPOCH},,%m)}/${STRFTIME($
{EPOCH},,%d)}/${ARG1}/${UNIQUEID}/${CALLFILENAME}.${MIXMON_FORMAT},,${MIXMON_POST})

The changes made are

exten => s,n(record),System(/bin/mkdir -p /var/spool/asterisk/monitor/freepbx/${STRFTIME(${EPOCH},,%Y)}/${STRFTIME(${EPOCH},
,%m)}/${STRFTIME(${EPOCH},,%d)}/${ARG1}/${UNIQUEID})

Here we are using ‘System’ command to create directories during the call recording. Inside the system command we can execute the unix shell commands. Here we used ‘mkdir’ command to create directories followed by a number of variables in asterisk. Here ‘STRFTIME’ used to get the year, month & date . ${ARG1} used to get the asterisk user extension ,who is participating in that call ;${UNIQUEID} to get the unique id of that call. UNIQUEID is assigned by asterisk and it is the unix time of orgination of that call.

<pre>exten => s,n,MixMonitor(/var/spool/asterisk/monitor/freepbx/${STRFTIME(${EPOCH},,%Y)}/${STRFTIME(${EPOCH},,%m)}/${STRFTIME($
{EPOCH},,%d)}/${ARG1}/${UNIQUEID}/${CALLFILENAME}.${MIXMON_FORMAT},,${MIXMON_POST})</pre>

In succeeding priority we use MixMonitor command to record the conversations in that channel. The format of MixMonitor command is MixMonitor(<file>.<ext>[|<options>[|<command>]]). Here in the ‘filename’ field we will give path of created directory in the preceding line.

Once you made the above changes you need to reload the dialplan through either of the following two ways.

from shell

#asterisk -rx “dialplan reload”

from asterisk CLI

> dialplan reload

VN:F [1.9.6_1107]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.6_1107]
Rating: +1 (from 1 vote)

Tino Thomas linux , , , , , , ,

How to install AsterCRM and integrate it with external CRM

July 19th, 2010

1) Download and unzip the source (assuming your WEB root is /var/www/html)

Get the software from


http://astercc.org/downloads
cd /var/www/html

unzip astercc-X.X.zip

mv astercc-X.X astercc

/var/www/html/astercc/astercrm                 # main directory and PHP scripts  of astercrm
/var/www/html/astercc/asterbilling              #  main directory and PHP scripts of asterbilling
/var/www/html/astercc/sql                          # sql to create database  tables
/var/www/html/astercc/script                      # astercc  daemon and some other script files
/var/www/html/astercc/index.html               #guide page
/var/www/html/astercc/astercc_full_logo.png  #logo

2) It is highly advised that the whole script directory be moved to a more secure location like /opt and out of the WEB root directory


mkdir -p /opt/asterisk/scripts/astercc
mv  /var/www/html/astercc/scripts/*  /opt/asterisk/scripts/astercc
chmod +x /opt/asterisk/scripts/astercc/*

3) Create the MySQL database and tables, asterCRM need mysql 4.1 or above

Note: here we create the database named astercc, it both used for astercrm and asterbilling, you could use whatever db name you want use your configration to replace “yourmysqluser” and “yourmysqlpasswd”


mysqladmin -uyourmysqluser  -pyourmysqlpasswd create astercc
mysql -uyourmysqluser  -pyourmysqlpasswd astercc < /var/www/html/astercc/sql/astercc.sql

4) Update /etc/asterisk/manager.conf to enable Manager connections

Note:allow asterisk on different server .Add something like this to the manager.conf file:


[general]
enabled = yes
port = 5038
bindaddr = 0.0.0.0
;displayconnects = yes

;the following line could be  changed by yourself
[astercc]
secret = astercc
read = system,call,log,verbose,command,agent,user
write =  system,call,log,verbose,command,agent,user
deny=0.0.0.0/0.0.0.0
; if you want to run astercc on another  server
; use your astercc ip to replace 127.0.0.1 or add a  new line
permit=127.0.0.1/255.255.255.0

5) Modify config file

for asterCRM:
modity /var/www/html/astercc/astercrm/astercrm.conf.php to fit your configration
for asterCC:
modity /var/www/html/astercc/asterbilling/asterbilling.conf.php to fit your configration

6) Start Asterisk and daemon

There are two daemon modes you can choose, astercc mode or eventsdaemon(can be used for astercrm only) mode.

A) For astercc mode(can be used for both astercrm and asterbilling.

try start astercc:
modify /opt/asterisk/scripts/astercc/astercc.conf to fit your configuration mainly database setting and AMI setting.

run astercc for test


/opt/asterisk/scripts/astercc/astercc

if you could read like following line:


"Connecting to mysql database on  127.0.0.1:
Database connection successful.
Connecting to asterisk on 127.0.0.1 port 5038:
Asterisk socket connection successful.
Check  asterisk username & secret:
Success
Monitor Start:
...(some log message)..."

congratulations, your astercc works well, use 'ctrl + c' to exit
or else, please check your database/AMI configration in astercc.conf

Start up astercc (default settings):
modify /var/www/html/astercrm/astercrm.conf.php set eventtype to curcdr


/opt/asterisk/scripts/astercc/astercc -d

Start up astercc daemons when system startup:
Note: This option can only fit to redhat-release system. If you want astercc daemons to start automatically when you boot your machine, you need to :


cp /opt/asterisk/scripts/astercc/asterccd  /etc/rc.d/init.d
chmod 755 /etc/rc.d/init.d/asterccd
chkconfig --add asterccd

Advice: Configure your astercc restart once everyday, it’s not necessary, but it ‘s good for your astercc operation. for example: you want to restart astercc at 0′clock everyday, just do the following line as root.


crontab -e
add a new  line:
0 0 * * * /etc/rc.d/init.d/asterccd restart
the first "0" figures minutes and the second "0" figures hours.

B) For eventsdaemon mode(can be used for astercrm only) try start eventsdaemon:
modify eventsdaemon.pl to fit your configuration mainly database setting and AMI setting.

/opt/asterisk/scripts/astercc/eventsdaemon.pl
if you could  read:

"Message: Authentication accepted"

congratulations,  your eventsdaemon works well
use ctrl + c to exit
or else, please check your database/AMI configration in eventsdaemon.pl

Start eventsdaemon (default settings):
modify astercrm.conf set eventtype to event


/opt/asterisk/scripts/astercc/eventsdaemon.pl -d

At some point it may be desirable to delete unwanted events from the database table. The eventsdaemon is also designed for this. please check eventsdaemon.pl for parameter “log_life” .also we provide a “watch dog”, it would help you restart eventsdaemon when it shutdown add this shell to your start-up file, for example:


echo /opt/asterisk/scripts/astercc/eventdog.sh >>  /etc/rc.d/rc.local

so that everytime your server start, eventsdaemon would be loaded

7) Set file & folder access for astercrm

chmod 777 /var/www/html/astercc/astercrm/upload
chmod 777 /var/www/html/astercc/astercrm/astercrm.conf.php

If asterisk and astercrm running in one server, you could make a soft link to astercrm web directory for listening monitor records online.
ln -s /var/spool/asterisk/monitor/ /var/www/html/astercc/astercrm/monitor
note: astercrm support listen monitors online only can be wav format file.

8 ) Web browsing

For astercc:


http://localhost/astercc

or  http://YOUR-WEB-SERVER-ADDRESS/astercc

For astercrm:


http://localhost/astercc/astercrm

or  http://YOUR-WEB-SERVER-ADDRESS/astercc/astercrm

login with admin/admin

Integration of External CRM With AsterCRM

In your astercrm, go to
Manager-> preference

If asterCRM use external CRM software, change the value of enable_external_crm to 1. When using external CRM, the default page to be displayed is specified in external_crm_default_url .Value of external_crm_url specifies, when asterCRM need to pop up, which url would recevie the event, %callerid: %calleeid: %method dialout or dialin. Save the changes made by clicking Save button.

VN:F [1.9.6_1107]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.6_1107]
Rating: 0 (from 0 votes)

Tino Thomas linux , , , , , , ,

Email Feedback Loop (FBL)

February 20th, 2010

What is FBL

Usually when users do not want to receive any more mails from an email account they just click the “report spam button” available in their web mail or mail client. As a result of that a complaint will be raised against the ip from which this email is sent and the isp will start blocking this ip after the complaint rate increases a certain limit. So it is crucial to know the users who do not want to receive mails from us  so that we can remove them from the mailing list and mails will not be sent to these users again. A feedback loop is a mechanism whereby an ISP will let you know when one of its subscribers complains about your e-mail.

How to Sign up For Email Feedback Loop

To use this service, you should send a request for an ISP feedback loop either via email or through a web form. Most of the ips provide a web from to register their feedback loop program. The usual information you need to provide to sign up for a feedback loop are:

* IP addresses that you want to receive feedback loops for

* The list of domains you want to subscribe

* A valid abuse@ and/or postmaster@ email address on the domains you want to subscribe

* Your contact information: name, contact email and phone number

* The email address a feedback loop will be sent at

* Quantity of email messages sent daily (weekly, monthly) to the domain of the feedback look

* Type of email content you send

A confirmation email will be sent to the contact email address you specify. Once your request has been approved, Feedback Loop email will be sent to the email address listed in the “Feedback Loop Email” field.

How FBL Works

1. Sender sends a mail to the user

2. User complaints to his ISP about the message by hitting the report spam button

3. The sender  will be notified when a recipient complains about your email.

4. The sender will receive an email message saying something like “a spam complaint was registered for the IP address xxx.xxx.xxx.xxx”.

Sender’s original email message will be attached to that notification email.

Advantages of Feedback Loops

Feedback loops help you reveal unhappy subscribers, improve your email deliverability and decrease your spam complaint rate. This helps you to maintain a good reputation for the ips. Feedback loops allow you to check  deeply into your sign up process that adds user to their mailing list when one user signs up. Increased complaint rate can be caused by subscribers not realizing what they signed up for, subscribers not getting what they thought they signed up for, or a long delay between sign-up and the first mailing. So these feedback loops help the sending organization to improve the quality of their sign up process.

Different Feedback Loop Programs

Every ISP’s feedback loop is different, making the aggregate data sometimes challenging to manage. Some use a standardized format – the Abuse Reporting Format. Some send feedback in real time, others send in batches. Many send the entire offending message, others only provide the e-mail address – and still others send the body of the message but no address. For Yahoo only senders who sign their outbound emails with DomainKeys and/or DKIM are eligible to participate in their feedback loop program. AOL will only active the service after an ip ownership test.It verify that a particular domain has a right to receive abuse complaints for the ips in the submitted request. There are five possible tests to prove IP ownership. Passing any one of the five tests says “AOL, yourdomain.com has a right to receive abuse complaints on behalf of our IP.” Also different isps are providing options to modify the existing feedback loop. You may add more ips or remove existing ips through web forms. Also in any point if you do not want to use feedback loop service from an isp you may write to the postmaster department of corresponding isp for that.

Conclusion

This one-time action will help you keep a good email sender reputation and improve your email delivery rate into the recipient’s Inbox. So it is always better to have feedback loop.

VN:F [1.9.6_1107]
Rating: 8.8/10 (6 votes cast)
VN:F [1.9.6_1107]
Rating: +2 (from 2 votes)

Tino Thomas Mailservice ,

Cpanel backend files

January 5th, 2010

IMPORTANT CPANEL BACKEND FILES AND LOG FILES

/var/cpanel

accounting.log - Contains a list of accounting functions performed such as account removal and creation

cpanel.config – Tweak settings for whm can be done in this file

mainip – Main ip of the server is specified in this file

maxemail - Maximum emails per hour for a domain can be specified here The format is like the following domainname=number

Run the script /scripts/build_maxemails_config after editing this file This will create a file named after the corresponding domain name inside the directory maxemailsperdomain with the value specified in it.

Maxemailsperhour - Server wide maximum emails per hour can be set in this file. It applies to the whole domains in the server. You only need to insert the corresponding value in the file. A value of zero means unlimited.

Resellers-nameservers – This file gives you the name of the nameservers used by reseller users

resellers – This file lists the privileges of different reseller users

packages/ - This directory contains files for all the packages created under the WHM and the corresponding files will give all the details related to that package
Read more…

VN:F [1.9.6_1107]
Rating: 9.1/10 (13 votes cast)
VN:F [1.9.6_1107]
Rating: +7 (from 9 votes)

Tino Thomas linux , , , , , , ,