Quick packages install on CentOs 5 and Asterisk 1.4.X
Here is a quick trick on centos/redhat or any yum powered platform
to install all packages that you may need to install asterisk.
It will even install mysql for you as well as odbc connector.
yum -y install gcc gcc-c++ kernel-devel bison openssl-devel \
libtermcap-devel ncurses-devel doxygen curl-devel newt-devel \
mlocate lynx tar wget nmap bzip2 mod_ssl crontabs vixie-cron \
speex speex-devel unixODBC unixODBC-devel libtool-ltdl \
libtool-ltdl-devel mysql-connector-odbc mysql mysql-devel \
mysql-server php-mysql php-mbstring php-mcrypt flex screen
asterisk/zaptel/dahdi/you do not appear to have the sources
When installing asterisk and the zaptel or dahdi module, you may reach the error:
You do not appear to have the sources for <your-kernel-version>
Here, I will explain exactly what asterisk is looking for and how you can fix it.
First, you may really need to install the kernel sources. The headers are needed to compile zaptel/dahdi.
If you use yum, you can install from repository.
yum -y install kernel-devel
If you run SMP kernel, use instead
yum -y install kernel-smp-devel
Here is what zaptel/dahdi will do to determine if you have the kernel source or not :
- find your kernel version by running uname -r and stock it into $(KVERS)
- set variable $(KSRC) to one of the following /lib/modules/$(KVERS)/build or /usr/src/linux or /usr/src/linux-2.4. The Makefile will then check if one of those directories exist.
- The $(KSRC) directory should contain the .config file.
If you installed the kernel sources, you should have the .config file somewhere in /usr/src/kernels/(somedir)
You just then have to create a symbolic link from /usr/src/linux or /lib/modules/$(KVERS)/build to that directory.
Reconfigure, recompile zaptel/dahdi and asterisk.
Hope it helps
Asterisk : Open big log file
When you enable asterisk logs, specifially full logs with DEBUG,
your log file could increase quickly. Open it with vi can use a lot of memory of your server
and prevent you to receive a lot of calls.
You can use split command line to split your file to smaller one
split full
Asterisk automatic dialing
Sometimes, you may need asterisk to call somebody and play any kind of application or run a dialplan extension.
Asterisk call files can be use here. You need to create a call file (which is a clear text file) and move it in /var/spool/asterisk/outgoing/ directory. A thread on the asterisk server will check for new files there and process them.
The file contains keys and values seperated by a ‘:’ character on each line. Here are the accepted parameters:
- Specify where and how to call
- Channel: <channel>: Channel to use for the outbound call
- CallerID: Name <number> Caller ID, please note that it may not work if you do not respect the format: CallerID: Some Name <1234>
- MaxRetries: <number> Number of retries before failing (not including the initial attempt, e.g. 0 = total of 1 attempt to make the call)
- RetryTime: <number> Seconds between retries, don’t hammer an unavailable phone
- WaitTime: <number> Seconds to wait for an answer
- Account: Set the account code to use.
- If the call answers, connect it here
- Context: <context-name> Context in extensions.conf
- Extension: <ext> Extension definition in extensions.conf
- Priority: <priority> Priority of extension to start with
- Set: Set a variable for use in the extension logic (example: file1=/tmp/to ); in Asterisk 1.0.x use ‘SetVar’ instead of ‘Set’
- Application: Asterisk Application to run (use instead of specifiying context, extension and priority)
- Data: The options to be passed to application
- New (?) in Asterisk 1.4
- Set: Can now also write to dialplan functions like CDR()
- AlwaysDelete: Yes/No - If the file’s modification time is in the future, the call file will not be deleted
- Archive: Yes/No - Move to subdir “outgoing_done” with “Status: value”, where value can be Completed, Expired or Failed.
Example :
If you want to call the number 5140000000 through channel Zap/g1 and play welcome prompt when answered, your call file will look like :
Channel: Zap/g1/5140000000
CallerID: Ruddy Micnes <5143161470>
WaitTime: 30
Application: Playback
Data: welcome
Tip : Restrict call by matching caller id
This quick tip will show you how, in asterisk dialplan, you can restrict calls to a specific match of caller id.
Usually, in a dialplan, extensions will match the called number. Like in the following example :
[default]
exten => _514XXXXXXX,1,Noop( CALLS TO NUMBER ${EXTEN} FROM ${CALLERID(all)} )
exten => _514XXXXXXX,n,Dial(Zap/g1/${EXTEN})
This means that anyone that reach an extension starting with 514 and followed by 10 digits will be send to Zap/g1
If you want this extension to be restrict to a specific caller id or match also a caller id pattern (eg: starting with 418 and followed by 10 digits, your dialplan should be like
[default]
exten => _514XXXXXXX/_418XXXXXXX,1,Noop( CALLS TO NUMBER ${EXTEN} FROM ${CALLERID(all)} )
exten => _514XXXXXXX/_418XXXXXXX,n,Dial(Zap/g1/${EXTEN})
Asterisk CDR log all calls
You may have notice that some calls that you are sure that you placed are missing in the CDR file or table.
Those calls may be those that wasn’t answered.
For example, if you place, from one channel, multiple simulatanous or successive calls to differents destinations, you will see only one record : the origination channel tring to reach the destination that answered.
To change this and log all channels even to answered, you need to edit cdr.conf file and add unanswered option .
vi /etc/asterisk/cdr.conf
[general]
unanswered=yes
Unload asterisk server - Batch save cdr
Hi All,
This chronicle will be use to give you tips where you can unload your asterisk server and make him do what he is suppose to do : Take calls.
One departement were you can save processing is CDR logging and database writing.
By default, asterisk will write or post your call detail record (CDR) at the end of every calls. This help keeping track of all calls including bill seconds. But if you have too many calls, the load of your server writing CDR or inserting in the database can become enormous.
You can add some options in /etc/asterisk/cdr.conf. For example, asterisk can just collect the cdr and after 10 calls ou 5 minutes, write the call details in a file or insert them in the database.
Here are options that will help you doing so:
vi /etc/asterisk/cdr.conf
[general]
batch=yes
size=100
time=300
scheduleronly=no
safeshutdown=yes
!!! WARNING (PLEASE READ) !!!
You need to know exactly what every parameter means here and need to tune in those parameters to fit your environment or type of business.
- batch = yes. This means that asterisk will keep CDRs for x seconds (see parameter size and time) and post them all at once. This also means that if your asterisk server crash, or if you manually kills it (kill -9 asterisk) you will loose every CDR in memory. So, if CDRs are very critical for your business and your asterisk server trends to crash sometime, you may consider not enabling this feature. But, if you want to easy loads on asterisk and databases, you can do it. However, you can reduce how many CDR you may lost in case of crash but using ’size’ and ‘time’ parameters.
- size = 100. This means that, at any time, if the number of CDR kept in memory reach 100, they will be post or send in the database.
- time = 300. This means that, every single 300 seconds (5 minutes), the CDR will be post whatever the size is.
- scheduleronly=no. Asterisk has one thread (a kind of separate internal process) whose only job will be to post CDR when comes the time to do so or when the size is reach. If set to ‘no’, everytime the size will be reach, asterisk will start a new thread to post your CDR. If set to ‘yes’, only one still active thread will do the job again and again. Why is this important ? If you set it to ‘yes’ and the same thread is responsible of doing the same job, if you have any kind of delay while posting CDR, the following CDR will be block until the previous are done. That’s why I recommand one separate thread every time specially if your size is big.
-safeshutdown=yes. When you run ‘asterisk> stop now’ in asterisk cli, if this option is set to ‘yes’, asterisk will issue the last CDR post before shutting down, if not, your still-in-memory-CDR may be lost. So, keep this to yes unless CDRs are not very relevant in your business.
Asterisk 1.4.22 and 1.6.0 released
Great news today for the release of those two version that fix many bugs out there.
Please visit http://www.asterisk.org/node/48539
Register to canadian do not call list
A major developement in canadian telemareting environment is about to come on September 30.
For people you want to register to such a list, here is the “How to”
Key facts for consumers
Date Modified: 2008-08-29
The National Do Not Call List (DNCL) will launch on September 30, 2008. It is designed to reduce the number of unwanted telemarketing calls and faxes Canadians receive.
1. How to register?
- As of September 30, 2008, you can register your home phone, cellular or fax number(s) on the National DNCL.
- Signing up is simple, quick and free. You can sign up online at www.LNNTE-DNCL.gc.ca or by calling the toll-free numbers 1-866-580-DNCL (1-866-580-3625) or 1-888-DNCL-TTY (1-888-362-5889).
- Once you have signed up, many telemarketers can no longer call you starting 31 days after your registration.
- You must renew your registration every three years if you want your number(s) to stay on the National DNCL.
2. Who can still call you?
- Registering on the National DNCL will reduce but not eliminate all telemarketing calls and faxes.
- There are certain kinds of telemarketing calls and faxes that are exempt from the National DNCL, including those made by or on behalf of:
- registered charities seeking donations
- newspapers looking for subscriptions
- political parties and their candidates, and
- companies with whom you have an existing commercial relationship; for example, if you have done business with a company in the previous 18 months––such as a carpet-cleaning company––that company can call you.
- Telemarketers making exempt calls must maintain their own do not call lists. If you do not want to be called by these telemarketers, you can ask to be put on their do not call lists. They are obliged to do so within 31 days.
- For more information, see Part II of the Unsolicited Telecommunications Rules and the Telecommunications Act.
3. Market research, polls and surveys
- You will continue to receive calls from organizations conducting market research, polls or surveys even though you are registered on the National DNCL. These are not considered telemarketing calls because they are not selling a product or service, or requesting donations.
4. Rules telemarketers must follow when they call
- Among other things, telemarketers must:
- identify who they are and, upon request, provide you with a fax or telephone number where you can speak to someone about the telemarketing call
- display the telephone number that they are calling from or that you can call to reach them, and
- only call or send faxes between 9:00 a.m. and 9:30 p.m. on weekdays and between 10:00 a.m. and 6:00 p.m. on weekends.
- Telemarketers must not use Automatic Dialing and Announcing Device (devices that dial telephone numbers automatically and deliver a pre-recorded message). However, these devices can be used by police and fire departments, schools and hospitals, as well as for appointment reminders and thank you calls.
- For more information, see Part III and Part IV of the Unsolicited Telecommunications Rules.
5. Complaints
- Complaints about telemarketers can be made through the National DNCL website (www.LNNTE-DNCL.gc.ca) or by calling the toll-free numbers 1-866-580-DNCL (1-866-580-3625) or 1-888-DNCL-TTY (1-888-362-5889).
- Types of complaints can include receiving a call even though you have registered on the National DNCL, receiving a call outside of permitted calling hours, a telemarketer who does not put your name and number on their do not call list, or any other violation of the rules.
- When making a complaint, remember that you must provide information such as the date of the call and the name or telephone number of the telemarketer.
- The CRTC will investigate complaints and can penalize telemarketers found to be in violation of any of the CRTC’s Unsolicited Telecommunications Rules.
- As of September 30, 2008, the CRTC can levy penalties of up to $1,500 for an individual and up to $15,000 for a corporation, for each violation.
Source : http://www.crtc.gc.ca/eng/INFO_SHT/t1031.htm
ANI, CallerID, Spoofing
I founded a great article about some usefull definition that could help undertanding what spoofing is about
So, just what is ANI?
ANI stands for Automatic Number Identification. ANI is a service feature that transmits a directory number or Billing Telephone Number(BTN) to be obtained automatically. In other words your number is sent directly to wherever you are calling to automatically. Unlike Caller ID you can not block this feature from happening.
What is flex ANI?
Flexible ANI provides “II”(identification indicator) digits that identify the class of service of the phone you are calling from.
What is CPN?
Calling Party Number, the number used for your caller ID.
What are ANI “II” digits?
Identification Indicator digits describe the class of service of the telephone.
Some examples are:
00 "POTS"(plain old telephone service) or home phone 07 Restricted line 27 ACTS payphone 29 Prison phones 62 Cellular phones 70 Cocot Payphone
What is an ANAC?
ANAC stands for Automatic Number Anouncement Circuit. This is a phone number you can call that will ring into a circuit that anounces the ANI or CPN number you are calling from. An example of an ANAC is 800-555-1140 and 800-555-1180. When you call this number you will get an ARU(Audio Response Unit) this is the circuit that anounces your ANI/CPN. When you call 800-555-1140 or 800-555-1180 the ARU will give you this information: “The ARU ID is [id], Your line number is [trunk number], the DNIS is [DNIS number] the ANI is [II digits followed by CPN, even though the recording claims to be reading ANI]”
(These ANACs don’t work anymore, try 800-444-4444)
ARU ID: Audio Response Unit ID number, this identifies which ARU in a group of ARUs you reached.
Line number: The trunk you came in on.
DNIS: Dialed Number Identification Service — Tells you which number YOU called.(i.e. 800-555-1140 is 03123, 800-555-1180 is 03125)
ANI: II digits followed by ANI.
What is a BTN(Billing telephone number)?
BTN is a phone number for which charges are to be billed to. It is not necessarily the phone number of the line you are calling from.
What is Psuedo ANI?
Psuedo ANI or PANI is a unique non-dialable number used to route cellular calls. PANI is used by 911 operators to find the cell site and sector from which the cellphone is calling.
What is an ANI fail?
An ANI fail is when no ANI is sent. Usually the areacode of the tandem office completing the call will be sent.(i.e. if the tandem office is in 213 the ANI will be sent as 213-000-0000.)
How do ANI fails occur?
ANI fails can occur when the tandem office completing a call didn’t receive ANI from the central office originating the call. ANI fails can also be caused when ANI is intentionally not sent, this can happen by using a method called op diverting. Another way you can cause ANI fails is through the use of the AT&T long distance network. Simply dial 10-10-288-0 or dial 0 and ask your operator for AT&T. When AT&T comes on the line simply touch tone in a toll free number and the call will be completed with no ANI. Note however that this method is dependent on the AT&T center you reach, some AT&T centers still forward ANI, others send an AT&T BTN as ANI, but most AT&T centers currently don’t forward ANI.
What is op diverting?
Op diverting is a term that describes the process of intentionally causing an ANI fail by having your local operator dial the number you wish to reach. Most operator centers are not equipped to forward ANI and so they complete the call with no ANI.
What’s the difference between ANI and Caller ID?
ANI is the BTN associated with the telephone and is the direct number from where you are calling from. Caller ID is usually the BTN but occasionally can be incorrect, i.e. the main number of a business instead of the actual number being called from. Another difference in ANI is that it shows the class of service of the phone number while Caller ID just shows the name and number.
Now that you have an idea of what ANI is and how it differs from Caller ID I will explain some methods for spoofing both of them.
Source :
http://www.docdroppers.org/wiki/index.php?title=ANI_and_Caller_ID_Spoofing

