Monday, 22 June 2015

Opensips Nat Handling

Call fix_nat_sdp for INVITE,RE-Invite.. That's it, This route will take care of everything..


route[fix_nat_sdp] {

        if(has_body("application/sdp"))
 {
                xlog("fix_nat_sdp called\n");
                setbflag(3);
                rtpproxy_offer();       
                t_on_failure("1");
        }

 t_on_reply("1");

        if(nat_uac_test("1")){
                fix_nated_contact(); 
        }
}

onreply_route[1] {
        xlog("onreply_route called\n");
        if(nat_uac_test("1")){
                fix_nated_contact(); 
        }

        if(has_body("application/sdp")){
                rtpproxy_answer();
        }
}

Thursday, 18 June 2015

Which Ubuntu Version is equal to which Debian Version

Which Debian Version Ubuntu 14.04 LTS using ?

You can find the Debian version on which your Ubuntu version is based in the file: /etc/debian_version
From 10.04 up to 15.04:
15.04  vivid      jessie / sid
14.10  utopic     jessie / sid
14.04  trusty     jessie / sid
13.10  saucy      wheezy / sid
13.04  raring     wheezy / sid
12.10  quantal    wheezy / sid
12.04  precise    wheezy / sid
11.10  oneiric    wheezy / sid
11.04  natty      squeeze / sid
10.10  maverick   squeeze / sid
10.04  lucid      squeeze / sid
sid is the development distribution of Debian (sid - testing - stable)



Wednesday, 10 June 2015

Collection of Opensource Asterisk Applications

(Source : venturevoip )

Hopefully there are a few programs in the list that even the most seasoned Asterisk professionals have not seen before.

Flash Operator Panel

Flash Operator Panel is a switchboard type application for the Asterisk PBX. It runs on a web browser with the flash plugin. It is able to display information about your PBX activity in real time. The layout is configurable (button sizes and colors, icons, etc). You can have more than 100 buttons active per screen. On the Live Demo there are 28 buttons defined. It also supports contexts: you can have one server running and many different client displays (for hosted PBX, different departments, etc). It can integrate with CRM software, by poping up a web page (and passing the CLID) when a specified button is ringing.

PHP AGI

AGI (Asterisk Gateway Interface) is a way of running programs or scripts which are external to Asterisk. PHP AGI is a library for PHP which simplifies writing AGI scripts.

Web Meetme

Web-MeetMe is a suite of PHP pages to allow for scheduling and managing conferences on an Asterisk PBX. 

Oreka

Oreka is a modular and cross-platform system for recording and retrieval of audio streams. The project currently supports VoIP and sound device based capture. Recordings metadata can be stored in any mainstream database. Retrieval of captured sessions is web based.

FreePBX
FreePBX is a full-featured PBX web application. If you've looked into Asterisk, you know that it doesn't come with any "built in" programming. You can't plug a phone into it and make it work without editing configuration files, writing dialplans, and various messing about. 

FreePBX simplifies this by giving you pre-programmed functionality accessible by a user-friendly web interfaces that allows you to have a fully functional PBX pretty much straight away with no programming required.

FreePBX also comes as a distro

Areski CDR Stats

Asterisk-Stat is a visualisation layer for Asterisk CDR statistics which are pulled from a database. It provides graphs as well as allowing you to get more information on individual calls.





sipsak

sipsak is a small command line tool for developers and administrators of Session Initiation Protocol (SIP) applications. It can be used for some simple tests on SIP applications and devices.

Asterisk PhoneBook

A common shared phone book directory based on CMS/LAMP and build for Asterisk PBX, store name and number into MySQL which will be used by each workstation browser, also by telephones with embedded XML-browser feature.

Asterisk Desktop Assistant

Asterisk Desktop Assistant is a desktop call management application for Windows PCs.� Asterisk Desktop Assistant (ADA) is Digium?s first step towards offering a comprehensive Computer Telephony Integration (CTI) suite.� It makes dialing and handling phone calls simpler and faster by adding click-to-call functionality into popular desktop applications.� It also adds call notifications directly to the Windows desktop.

A2Billing

A2Billing combined with Asterisk now gives any Telecom company a very good reason to consider the A2Billing Soft-Switch over the traditional offerings for TDM and VoIP Soft-Switches as well as wholesale and IP PBX billing, particularly when you consider the cost of A2Billing ? FREE!

AstBill

AstBill is not only a free web-based, user friendly billing interface for Asterisk and VOIP. It is also a Asterisk configuration and GUI management tool and a standardized implementation of Asterisk using REALTIME and static configuration as you please.

OSLEC

Oslec is an open source high performance line echo canceller. When used with Asterisk it works well on lines where the built-in Zaptel echo canceller fails. No tweaks like rxgain/txgain or fxotrain are required. Oslec is supplied as GPL licensed C source code and is free as in speech.

Oslec partially complies with the G168 standard and runs in real time on x86 and Blackfin platforms. Patches exist to allow any Zaptel or DAHDI compatible hardware to use Oslec. It has been successfully tested on hardware ranging from single port X100P FXO cards to dual E1 systems.

AppKonference

AppKonference is a high-performance Asterisk voice/video conferencing module. It's basically a drop in replacement for meetme - although does things a little differently and doesn't require a timing source.

OutCall

OutCALL was designed as a commercial appplication allowing Asterisk users integration with Microsoft Outlook with placing and receiving phone calls.

After over 1000 downloads as a free application, Bicom Systems Ltd. has decided to offer OutCALL in open source format in order to further stimulate development of Asterisk and related open source projects.

VMukti

VMukti is leading Asterisk/ Yate enabled p2p Video IP Communications Suite for Web / PSTN. These serverless broadband ready platform enable OS community to save 90% on capital & operating costs over proprietary software for conferencing & Call Center. 

Note from editor: I've personally never managed to get this working - drop me a line if you do get it all set up and going.

Asterisk-CRM

asterCRM is a call center software for asterisk based VoIP system, also it has some CRM functions. It provides useful features such as pop-up, predictive dialer, click to call, extension status .... astercrm could work with all asterisk based system. 

AsterCC

astercc is a realtime billing solution for asterisk, could work with all kinds of asterisk based system and no need do any change to your original system. astercc could be used for hosted callshop solution, pbx billing solution. 

IAXModem

IAXmodem is a software modem written in C that uses an IAX channel (commonly provided by an Asterisk PBX system) instead of a traditional phone line and uses a DSP library instead of DSP hardware chipsets.

Asterisk PBX Integration Zimlet

Asterisk PBX Integration Zimlet is an Extension for Zimbra Collaboration Suite. The Zimlet does Interface with the Asterisk Manager Interface to integrate with Asterisk PBX. The main focus is dial-on-click for Phone numbers inside Contacts and Emails. 

AsterFax - Asterisk Email to Fax Gateway

AsterFax provides an Email to Fax gateway for Asterisk. AsterFax lets you send an email by Fax. Enter the phone no. in the 'To' address, compose your email message and click send. You can also fax a MS-Word document or other attachment. 

Asterisk Monitor

Asterisk Monitor is a HTML interface that acts a operator pannel for asterisk to display user/peer status and calls. This uses a reverse AJAX, PHP and Python to originate, transfer and hangup calls, manage queues and meetme rooms. 

OpenBTS
The OpenBTS Project is an effort to construct an open-source GSM basestation using the USRP and the Asterisk VoIP PBX. Our goal is to enable a new type of hybrid GSM/VoIP cellular network for greenfield deployments in the developing world. 

Asterisk .NET

The Asterisk .NET library consists of a set of C# classes that allow you to easily build applications that interact with an Asterisk PBX Server (1.0/1.2/1.4 version). Both FastAGI and Manager API supported. .NET/Mono compatible. 

AGX's Asterisk Extra AddOns

Maintained version of old asterisk applications ported to 1.4 that for copyright reasons cannot be included into official Digium's releases and that for some reason the author is not keeping up-to-date. The project also require Zaptel instead of DAHDI. 

AstTAPI

AstTapi, an opensource Asterisk Tapi driver for windows. This allows users of TAPI compliant applications such as Outlook and Act to dial contacts directly from the application using an Asterisk PBX Server. 

Asterisk-Java

A java interface for Asterisk - allows you to write software in Java which will work with Asterisk.

IAXClient

A lightweight cross platform IP telephony client using the IAX protocol, designed for use with the Asterisk open source PBX. 

Asterisk Desktop Manager

A desktop application for managing Asterisk including screen pops etc - looks quite nice but haven't tried it.

Asterisk JTAPI

Asterisk-JTAPI is a JTAPI implementation for the Asterisk software PBX system. JTAPI is a provider independent programming interface for Java to build applications for computer telephony or to add support for it. JTAPI covers a wide range of usage scenarios starting from controlling a single telephone to a whole PBX system for example in call-centers.

Asterisk-JTAPI builds on top of two other projects: Asterisk-Java, which provides a Java interface to the Asterisk manager API, and, GJTAPI, which provides a general framework for JTAPI interfaces.

Astmail

Web interface to Asterisk voicemail written in php. Includes some AJAX components such as LDAP-suggest, and user-lookup. Includes screens for forward by email and sms configuration. 

Druid
Druid is an open source unified communications platform, built around technology such as Asterisk, IMAP, XMPP. Druid gives your organization access to the best available IP communications platform that bringing together voicemail, VOIP, mobile phone, faxes and instant messaging.

ViciDial

VICIDIAL is a set of programs that are designed to interact with the Asterisk Open-Source PBX Phone system to act as a complete inbound/outbound call center suite. 

The agent interface is an interactive set of web pages that work through a web browser to give real-time information and functionality with nothing more than an internet browser on the client computer. 

Asterisk Queue/CDR Log Analyzer

The Asterisk Queue (and CDR) Log Analyzer is a set of PHP scripts which allow selecting, listing and graphing of records from the Asterisk Queue and CDR logs via a WEB interface.

For easier access to select specific log records, the Queue and CDR logs need to be in a MySQL database. Asterisk itself records (specified in a conf file) CDR data into a MySQL database table. A Python utility program called loadq.py is provided with this package which can be used to load queue log records (as they are created) into a MySQL database table.

Asterisk WEB/PHP Event Monitor

The Asterisk Event Monitor WEB/PHP Interface was created to view the current state of Asterisk and all Asterisk Events via a WEB interface. It does not poll Asterisk for these events, instead it collects them in a MySql database via an Asterisk Manager API python script. AJAX (Javascript) is used to display the events from the database almost as they occur. All code is released under the GNU GPL license.


Crystal Recording Interface

CRI (Crystal Clear Recording Interface) provides an intelligence web interface to track is recordings and his voice mail

Features :

Access your voicemail recordings.
Setup your voice mail box
View summary of your incoming outgoing calls
Search calls and recordings by day and time.
Call monitor recordings.

Xivo

XiVO is a full PBX solution based on Asterisk with a user-friendly web interface, provisioning tools for many types of phones, CTI daemon and CTI client for Windows, Linux and MacOS. All solutions are released under GPLv3. Currently only released in French, but easy to translate in other languages, XiVO provides administrators with a simple to configure phone system.

You can find a demo on https://demo.xivo.fr with login root and password proformatique so you can try it out for yourself.


Monday, 8 June 2015

How to run Tomcat on port 80 in Ubuntu or Debian

Following works:
First, set AUTHBIND=yes in /etc/default/tomcat7 file
sudo touch /etc/authbind/byport/80
sudo chmod 500 /etc/authbind/byport/80
sudo chown tomcat7 /etc/authbind/byport/80

Wednesday, 3 June 2015

MWI activation in Polycom phone and Asterisk:

MWI activation in Polycom phone and Asterisk:

#vi /etc/asterisk/voicemail.conf
[default]
57644 => 1234,John Doe, John.Doe@xyz.com

#vi /etc/aterisk/sip.conf
[
57644 ]
type=friend
host=dynamic
username=
57644 
callerid="John Doe" <57644 >
secret=mypassword
mailbox=
57644 

pbx CLI> sip show peer 57644
* Name : 57644
- - - -
- - - -
Mailbox : 57644
Call limit : 0
Max forwards : 0
Dynamic : Yes
Callerid : "John Doe" <57644>
MaxCallBR : 384 kbps
Expire : 205
- - - -
- - - -
Addr->IP : 192.168.2.10:5060
Defaddr->IP : (null)
Prim.Transp. : UDP
Allowed.Trsp : UDP
Reg. exten :
Def. Username: 57644
SIP Options : (none)
Codecs : 0x4 (ulaw)
Codec Order : (ulaw:20)
Auto-Framing : No
100 on REG : No
Status : Unmonitored
Useragent : PolycomSoundPointIP-SPIP_331-UA/3.3.2.0413
Reg. Contact : sip:57644@192.168.2.10


Asterisk automatically sends NOTIFY message to IP phone provided that the phone is registered correctly with Asterisk and Asterisk knows which voicemail box is associated with that extension. You can check that by issuing the asterisk CLI command #sip show peer
Reg. Contact : sip:57644@192.168.2.10 tells you that phone is successfully registered. 
Mailbox : 57644
 tells you that Asterisk knows that voicemail box 57644 is associated with that phone. That association is defined in sip.conf.

Tuesday, 2 June 2015

Sending MP3 Attachments form Asterisk Voicemail.

source : http://bernaerts.dyndns.org/
This guide will explain how to configure Asterisk PBX to send voicemail as email with messages as mp3 attachement.

If, like me, you are using an Asterisk server, you may be using the voicemail by email functionnality. It allows your Asterisk PABX to send your by email all the messages received in your voicemail.
Just imagine :
  • someone is calling you on your landline
  • he is leaving a message on your answering machine
  • after few seconds, you are receiving a mail on your android or i-phone with the message as an attachment
You can call back immediatly or even forward the email for someone else to deal with that call !

One of the main drawback of that functionnality is that Asterisk can generate attachments using only the standard telephony codecs (wav49, gsm, wav). The wav format is widely recognised, but it is quite uncompressed. The wav49 or gsm formats are better in terms of compression, but sadly they are not recognised by all the devices able to deal with your emails.

So why not to use mp3 format for the voicemail attachments ?
This is what this guide is all about. It will explain how to catch the emails sent by Asterisk and convert the audio attachment from a wav file to a mp3 file.
This guide is based on an Asterisk 1.6 version, running under Debian Squeeze.
As it uses only some very basic & standard linux tools, it should be compatible with any Asterisk installation.
It is based on the standard email structure generated by Asterisk.
If you have modify the Asterisk email format, you will need to adjust the script.

1. Principle

The main principles are :
  • Asterisk voicemail is configured to generate some wav attachements (uncompressed, best quality available)
  • Instead of sending the mail to sendmail, Asterisk is configured to send the mail to one specific script
  • This script will do all the job, and finally give back the mail to sendmail
The script will do some ordered tasks :
  1. catch the stream,
  2. analyse the email content,
  3. seperate each mime part,
  4. pullout the audio attachment,
  5. compress it to mp3,
  6. regenerate the mail content,
  7. send it to sendmail as expected
With this approach, you just need some specific configuration on Asterisk side.
From Asterisk side, the emails are just sent thru another emailer, that's it !
Unlike other methods, you don't need any patch for Asterisk.
You are still using a regular Asterisk, available from your distribution.
So, you can apply any standard update.
Any update to a new Asterisk version should remain fully compatible.

2. Install the packages

First thing to do is to install the packages needed by our script (unix2dos, dos2unix & lame).
aptitude install dos2unix lame

3. Setup the main Script

Once these packages are installed, we can generate the script that will do all the job.

As Asterisk generates the mail content, including the wav attachment encoded in base64, the script main job will be to :
  1. get the attachment from the email content
  2. convert it to mp3
  3. regenerate the mail content with new attachment
  4. send the mail thru sendmail
This job will be done with some very basic linux tools like sed, awk, grep, base64, unix2dos, ...

One important thing is to respect the body structure of the mail content, including the LF and CRLF used to separate lines, depending on the different mime parts. In fact, in the mail body genarated by Asterisk, all the lines are separated with LF, with the exception of the base64 coded audio attachment where they are separated with CRLF.
For the mp3 conversion, 2 compression options are available :
  • CBR - Constant Bit Rate compression will create mp3 streams compatible with any device, but the size/quality ratio is not optimised.
  • VBR - Variable Bit Rate is much more efficient in term of file size, but playback has been tested very poor on some smartphones.
The script is providing both the compression parameters, you just need to adjust it to your need.
The detailed phases of the script are as follow :
  1. Creation of a temporary directory, randomly generated, where we will generate all the temporary files
  2. Dumping of the mail content sent by Asterisk in a file
  3. Detection of the boundary pattern which separate the differents mime parts in the mail
  4. With this pattern, cutting of the mail content into mime parts
  5. Decoding of the WAV attachment which is base64 coded (you have to ignore parasite caracters in some configurations)
  6. Compression into mp3 format
  7. Coding of the mp3 audio file back to base64
  8. Re-assembly of the full mail content, using the new mp3 attachment
  9. Sending of the mail thru sendmail
  10. Deletion of the temporary directory
This sendmailmp3 script will be placed side to the sendmail command, under /usr/sbin.
/usr/sbin/sendmailmp3

#! /bin/sh
# Asterisk voicemail attachment conversion script
# Revision history :
# 22/11/2010 - V1.0 - Creation by N. Bernaerts
# 07/02/2012 - V1.1 - Add handling of mails without attachment (thanks to Paul Thompson)
# 01/05/2012 - V1.2 - Use mktemp, pushd & popd
# 08/05/2012 - V1.3 - Change mp3 compression to CBR to solve some smartphone compatibility (thanks to Luca Mancino)
# 01/08/2012 - V1.4 - Add PATH definition to avoid any problem (thanks to Christopher Wolff)

# set PATH
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# save the current directory
pushd .

# create a temporary directory and cd to it
TMPDIR=$(mktemp -d)
cd $TMPDIR

# dump the stream to a temporary file
cat >> stream.org

# get the boundary
BOUNDARY=`grep "boundary=" stream.org | cut -d'"' -f 2`

# cut the file into parts
# stream.part - header before the boundary
# stream.part1 - header after the bounday
# stream.part2 - body of the message
# stream.part3 - attachment in base64 (WAV file)
# stream.part4 - footer of the message
awk '/'$BOUNDARY'/{i++}{print > "stream.part"i}' stream.org

# if mail is having no audio attachment (plain text)
PLAINTEXT=`cat stream.part1 | grep 'plain'`
if [ "$PLAINTEXT" != "" ]
then

  # prepare to send the original stream
  cat stream.org > stream.new

# else, if mail is having audio attachment
else

  # cut the attachment into parts
  # stream.part3.head - header of attachment
  # stream.part3.wav.base64 - wav file of attachment (encoded base64)
  sed '7,$d' stream.part3 > stream.part3.wav.head
  sed '1,6d' stream.part3 > stream.part3.wav.base64

  # convert the base64 file to a wav file
  dos2unix -o stream.part3.wav.base64
  base64 -di stream.part3.wav.base64 > stream.part3.wav

  # convert wav file to mp3 file
  # -b 24 is using CBR, giving better compatibility on smartphones (you can use -b 32 to increase quality)
  # -V 2 is using VBR, a good compromise between quality and size for voice audio files
  lame -m m -b 24 stream.part3.wav stream.part3.mp3

  # convert back mp3 to base64 file
  base64 stream.part3.mp3 > stream.part3.mp3.base64

  # generate the new mp3 attachment header
  # change Type: audio/x-wav to Type: audio/mpeg
  # change name="msg----.wav" to name="msg----.mp3"
  sed 's/x-wav/mpeg/g' stream.part3.wav.head | sed 's/.wav/.mp3/g' > stream.part3.mp3.head

  # generate first part of mail body, converting it to LF only
  mv stream.part stream.new
  cat stream.part1 >> stream.new
  cat stream.part2 >> stream.new
  cat stream.part3.mp3.head >> stream.new
  dos2unix -o stream.new

  # append base64 mp3 to mail body, keeping CRLF
  unix2dos -o stream.part3.mp3.base64
  cat stream.part3.mp3.base64 >> stream.new

  # append end of mail body, converting it to LF only
  echo "" >> stream.tmp
  echo "" >> stream.tmp
  cat stream.part4 >> stream.tmp
  dos2unix -o stream.tmp
  cat stream.tmp >> stream.new

fi

# send the mail thru sendmail
cat stream.new | sendmail -t

# go back to original directory
popd

# remove all temporary files and temporary directory
rm -Rf $TMPDIR
 
Be sure to make it executable.
If you are using some other distributions than debian or ubuntu or some self  compiled packages, you may have to specify the full path for the executable files (/usr/local/bin/lame for example).

4. Voicemail configuration

On the Asterisk server side, we just need to configure the voicemail extension to use or script to send the mails.
This is done thru the voicemail.conf file, where :
  • In the [general] section, you need to setup some email specific parameters
  • In the [default] section (I suppose you use the default context for your voicemail), you need to setup the email address to use for each voicemail box.
So, finally your voicemail.conf configuration file should include these parameters :

/etc/asterisk/voicemail.conf
[general]
; Formats for writing voicemail. WAV is the best quality.
format=wav
; Who the e-mail notification should appear to come from
serveremail=yourpabxname@your.domain.com
; the email should contain the voicemail as an attachment
attach=yes
; You override the default program to send e-mail to use the script
mailcmd=/usr/sbin/sendmailmp3

[default]
; here you declare your voicemail, the email address which will receive the email & the automatic deletion of the message after mail is sent
yourvoicemailid => , yourname , your.email@address.com, , delete=yes

Once the file is saved, you just need to restart Asterisk for the configuration to be operational.

/etc/init.d/asterisk restart
That's it !
From now on, your Asterisk server is sendind all the voicemails by email using mp3 attachments.
Hope it helps.

Monday, 1 June 2015

Asterisk with CallerID setup

[100]
type=friend
host=dynamic
context=test
secret=1234
allow=all
callerid="Docomo" <8019613712>


E-mail Newsletter

Sign up now to receive breaking news and to hear what's new with us.

Recent Articles

© 2014 VOIP4Learn. WP themonic converted by Bloggertheme9. Powered by Blogger.
TOP