Jul
16
2010
0

Resample MP3’s for Polycom Ringtones with Audacity

A customer of VoiceIP Solutions sent me this useful tutorial for re-sampling Polycom Ringtones.   If you have an MP3 you like, it can be re-sampled for use with a Polycom IP SIP phone!  The procedure is pretty straight forward, Install Audacity with yum or your favorite package manager, re-sample the track, then edit the proper Polycom Soundpoint boot files.

Goals of this Post:

- Install Audacity Digital Audio Editor
- Convert a MP3 to Polycom compatible track
- Enable custom special Ringtone on Polycom Soundpoint IP SIP phone

(more…)

Dec
21
2009
0

How to setup auto-provisioning for Polycom SoundPoint IP phones using the Asterisk Appliance

The Digium Asterisk Appliance has built-in features for handling Polycom SIP handsets.  It’s very easy to do and will save you the trouble of individually configuring the settings of each phone.  I have a Digium AA50 configured with a standard dial plan and a Polycom Soundpoint IP 501.

Goals of this Post:

- Configure AA50 Polycom Provisioning
- Configure Polycom SoundPoint IP 501 phone

(more…)

Jun
28
2009
0

Polycom 501 XML configuration file Example

This file is named by the MAC address of your Polycom SoundPoint IP SIP phone followed by, ‘-phone.cfg’.  In your FTP folder you would have a file for each phone - I have a single phone.  It’s MAC is ‘0004F202734B’; so my phones configuration file would be named, ‘0004f202734b-phone.cfg’.  I believe there are other conventions for naming this file as well.

The example below was used to connect my phone with a VoiceIP Solutions Asterisk PBX.  This example shows just a fraction of the many possible features in this line.  For my purposes, I defined the Asterisk server IP address, and it’s SIP credentials.  I also added the NTP server.  The ‘mwi’ tag refers to ‘message waiting information’, here I set the mailbox(s) I’m subscribing to and the extension to check voicemail.   My Asterisk voicemail menu is extension ‘299′.

0004f202734b-phone.cfg:

<?xml version=”1.0″ encoding=”UTF-8″ standalone=”yes”?>
<!– Example Per-phone Configuration File –>
<!– $RCSfile: phone1.cfg,v $  $Revision: 1.104.2.2 $ –>
<phone1>
<reg
reg.1.displayName=”5555″
reg.1.address=”5555″
reg.1.auth.userId=”5555″
reg.1.auth.password=”2005″
reg.1.server.1.address=”192.168.1.254″
tcpIpApp.sntp.address=”pool.ntp.org”
tcpIpApp.sntp.gmtOffset=”-33600″
>
<mwi
msg.mwi.1.subscribe=”5555″
msg.mwi.1.callBackMode=”contact”
msg.mwi.1.callBack=”299″
>
</phone1>

Apr
22
2009
0

Asterisk: Creating an Extension to Logout Agents from CallerID

I told a customer for the company I for that I would figure out how to logout agents by CID(Caller ID). So I figured, why not kill two birds with one stone. Today we will create a single Queue, Agent, and dial plan to accomplish this goal. I’m using Asterisk 1.4, Fedora 10 and a Polycom IP SIP phone for my demonstration purposes.

When I started this project four hours ago, I thought I would google my way to another successful blog post(and happy customer), but no…  logging out agents in Asterisk is very unintuitive.  The agentcallbacklogin utility has the exact same prompts for logging in as out.  AgentCallbackLogin (when initiated, from the dial plan)  asks for three things, agent, agent password, and call back number.  To eliminate all these prompts I’m using the ‘$CallerID(num)’ variable to automatically answer the agent and call back number.  So the user 8888 dials ‘1000′ and and AgentCallbackLogin assumes he is AGENT/8888 with a password of ‘8888′.

from /etc/asterisk/extensions.conf

exten => 1000,1,AgentcallbackLogin(${CALLERID(num)}||${CALLERID(num)}@savelono-queue-out)
exten => 1000,n,hangup

(more…)

Apr
22
2009
1

extensions.conf - agent logoff example

[general]

static=yes
writeprotect=no

[bogon-calls]

exten => _x.,1,Congestion

[macro-stdexten]
;
;for dialing internal extensions

exten => s,1,Set(dynext=${DB(dynext/${ARG1})})
exten => s,n,NoOp(${dynext})
exten => s,n,NoOp(${LEN(${dynext})})
exten => s,n,GotoIf($["${LEN(${dynext})}" = "7"]?s,100)
exten => s,n,GotoIf($["${LEN(${dynext})}" = "10"]?s,100)
exten => s,n,GotoIf($["${LEN(${dynext})}" = "11"]?s,100)
exten => s,n,GotoIf($["${LEN(${dynext})}" = "6"]?s,200) ; Calls 6-digit Extension
exten => s,n,GotoIf($["${LEN(${dynext})}" = "0"]?s,300) ; Calls 6-digit Extension
exten => s,n(dial),Dial(SIP/${dynext},20,twW) ; Ring the interface, 20 seconds maximum
exten => s,n,Goto(s-${DIALSTATUS},1) ; Jump based on status
exten => s,100,Dial(ZAP/g1/${dynext},20,twW) ; Ring the interface, 20 seconds maximum
exten => s,101,Goto(s-${DIALSTATUS},1) ; Jump based on status
exten => s,200,Goto(from-sip,${dynext},1); Calls 6-digit Extension
exten => s,300,Set(dynext=${ARG1})
exten => s,301,Goto(dial)

exten => s-BUSY,1,Voicemail(b${ARG1}) ; If busy, send to voicemail w/ busy announce
exten => s-BUSY,2,Hangup
exten => s-NOANSWER,1,Voicemail(u${ARG1}) ; If unavailable, send to voicemail
exten => s-NOANSWER,2,Hangup
exten => _s-.,1,Goto(s-NOANSWER,1) ; Treat anything else as no answer

[from-sip]

include => test
include => from-internal

[test]

exten => 1234,1,agi(matts-test.agi)
exten => 1234,2,wait(2)
;exten => 1234,n,voicemail(8888)
exten => 1234,n,hangup

[from-internal]

;Standard Internal Extensions

exten => _888X,1,Macro(stdexten,${EXTEN},sip/${EXTEN})
exten => _888X,2,Hangup

;Logon
exten => 1000,1,AgentcallbackLogin(${CALLERID(num)}||${CALLERID(num)}@savelono-queue-out)
exten => 1000,n,hangup

;Logoff - best alternative I’ve found so far
;could be better with additional logic

exten => 1001,1,System(/usr/sbin/asterisk -rx “agent logoff Agent/${CALLERID(NUM)}”)
exten => 1001,n,RemoveQueueMember(savelono-support|Agent/${CALLERID(NUM)})
exten => 1001,n,Playback(agent-loggedoff)
exten => 1001,n,Playback(auth-thankyou)
exten => 1001,n,Hangup

;Logoff this way works but is not very intuitive because you
;have to hit the # key when prompted for a dial back extension
;it really doesn’t make sense to endusers
;
exten => 1002,1,AgentcallbackLogin(${CALLERID(num)}||)
exten => 1002,n,hangup

[savelono-queue-out]

include => from-internal

Apr
22
2009
1

sip.conf - agent logoff example

[general]

context=default                 ; Default context for incoming calls
;allowguest=no                  ; Allow or reject guest calls (default is yes)
allowoverlap=no                 ; Disable overlap dialing support. (Default is yes)
;allowtransfer=no               ; Disable all transfers (unless enabled in peers or users)

bindport=5060                   ; UDP Port to bind to (SIP standard port is 5060)
; bindport is the local UDP port that Asterisk will listen on

bindaddr=0.0.0.0                ; IP address to bind to (0.0.0.0 binds to all)
srvlookup=yes                   ; Enable DNS SRV lookups on outbound calls

; Note: Asterisk only uses the first host
; in SRV records
; Disabling DNS SRV lookups disables the

[8888]
type=friend                    ; Friends place calls and receive calls
context=from-sip               ; Context for incoming calls from this user
secret=2005
host=dynamic                   ; This peer register with us
dtmfmode=rfc2833               ; Choices are inband, rfc2833, or info
username=8888
mailbox=8888
callerid=<8888>

Apr
02
2009
0

How to configure a Polycom SoundPoint IP phone for Asterisk on Fedora 10

In my opinion the best IP business phones on the market are made by Polycom. Anyone that knows anything about the VoIP Industry knows that!  High quality Polycom desk phones combined with Asterisk are a great combination of quality/price. So to that end we’re doing this lab.

Polycom employs several methods of provisioning the SIP phones.  For general configuration Sound Point IP have an excellent built web GUI,  but for multiple phones Polycom has an XML based system as well.  Every Sound Point IP can be provisioned based on MAC address.  Polycom’s provisioning method makes use of TFTP, FTP, or HTTP to deliver firmware updates and individual phone settings.

The goals of this post:

- Configure FTP server for Polycom firmware and configuration

- Configure Asterisk SIP extension

- deploy firmware and XML configuration files to Polycom SoundPoint IP 501 SIP phone

(more…)

Mar
19
2009
4

VoiceIP Solutions offers Asterisk PHP GUI for large scale deployments



VoiceIP Solutions
is a Asterisk ‘consulting & deployment’ company in Seattle Washington.  They deploy Asterisk solutions for businesses of all sizes.  From small offices to universities and call centers.  They have sites deployed all over the United States, but mostly on the West Coast.  I’ve been following them for some time; I guess they started deploying Asterisk before 1.2 was released.  I talked to one of their sales rep’s(I think his name was Liam) about the business and wondered if they had done any development work?  He told me that they had done some PHP work for managing larger installs and proceeded to direct me to one of there engineer/developers.

(more…)

Mar
03
2009
0

Mediatrix SIP/PRI Gateway Syslog Server Setup

Recently I was requested to set up syslog service between a Mediatrix PRI to SIP gateway.  The Mediatrix web GUI allows you to send logs to a syslog server; in this case an Asterisk PBX.  Asterisk logs just fine to local facility0 by the way.

I enabled the service and set syslog to accept remote connections.  Yet, I got nothing.  I called a support rep for a vendor that sells these things and he told me that by default Mediatrix logs to local facility7.  So I edited the syslog.conf with the IP Address of the Mediatrix and it worked!  syslog and rsyslog config files should work the same.  I hope this helps.

/etc/rsyslog.conf

# Log cron stuff
cron.*                                                  /var/log/cron
# Everybody gets emergency messages
*.emerg                                                 *
# Save news errors of level crit and higher in a special file.
uucp,news.crit                                          /var/log/spooler
# Save boot messages also to boot.log
#local7.*                                                /var/log/boot.log
#mediatrix IP ADDRESS
local7.*                                            /var/log/mediatrix.log
#
#
#
#
local0.*                        /var/log/asterisk.log

Remember a couple things - rsyslog is a newer version of syslog.  So you might have a ‘rsyslog.conf’ or a ’syslog.conf’.  Another thing often overlooked is enabling TCP/UDP port 514 and their respective modules.  By default remote logging is disabled in Fedora Distros, and likely others for good reason.

/etc/rsyslog.conf

#### MODULES ####



$ModLoad imuxsock.so    # provides support for local system logging (e.g. via logger command)
$ModLoad imklog.so      # provides kernel logging support (previously done by rklogd)
$ModLoad immark.so      # provides –MARK– message capability



# Provides UDP syslog reception
$ModLoad imudp.so
$UDPServerRun 514



# Provides TCP syslog reception
$ModLoad imtcp.so
InputTCPServerRun 514

In conclusion…  Syslog servers are absolutely nesasarry to get Mediatrix SIP/PRI gateways operational with the carrier.  They are a solid appliance, but difficult to configure because of all the options.  Good luck.

Jan
23
2009
2

Asterisk Troubleshooting and Using nmap to determine port status of SIP and IAX2

nmap is a commonly used tool distributed with Linux (and available for many OSes) for mapping networks and port scanning.  Since almost every networked application runs on TCP/IP it is crucial to have the ability to troubleshoot every layer of the stack(OSI model).  A misconfigured firewall can easily cause hours of frustration.

We will use Asterisk as an example but the following tutorial could easily be applied to any network application.  If you run Asterisk PBX systems across many networks you have probably encountered firewalls.  Errant firewalls can cause huge headaches.  In some cases you may question if access to SIP & IAX2 ports on the firewall are being blocked.

Conventional wisdom:

[matt@mattcom1 ~]$ telnet localhost 22
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
SSH-2.0-OpenSSH_5.1

Using Telnet to verify that a port is listening for incoming connections is great for a host of common TCP applications like smtp(25), http(80) or FTP(21).  But for large scale port mapping and network scanning you may need a beefier tool.  In comes nmap.

Lets start with some nmap basics then run through the IAX2/SIP scenario. Below is nmap with the ‘-O’ switch and my local subnet at home.  The ‘-O’ switch will set nmap to determine remote host Operating System.  192.168.1.0 means network (range) and ‘/24′ tells us that it is a 24 bit subnet mask or ‘255.255.255.0′.

[root@mattcom1 ~]# nmap -O 192.168.1.0/24


Starting Nmap 4.68 ( http://nmap.org ) at 2009-01-23 16:31 PST
Interesting ports on 192.168.1.1:
Not shown: 1714 closed ports
PORT   STATE SERVICE
80/tcp open  http
MAC Address: 00:0F:66:CA:B7:B7 (Cisco-Linksys)
No exact OS matches for host (If you know what OS is running on it, see http://nmap.org/submit/ ).
TCP/IP fingerprint:
OS:SCAN(V=4.68%D=1/23%OT=80%CT=1%CU=39191%PV=Y%DS=1%G=Y%M=000F66%TM=497A617
OS:A%P=i386-redhat-linux-gnu)SEQ(SP=0%GCD=64%ISR=50%TI=I%II=I%SS=S%TS=U)SEQ
OS:(SP=A%GCD=A%ISR=50%TI=I%II=I%SS=S%TS=U)OPS(O1=M5B4%O2=M5B4%O3=M5B4%O4=M5
OS:B4%O5=M5B4%O6=M5B4)WIN(W1=16D0%W2=16D0%W3=16D0%W4=16D0%W5=16D0%W6=16D0)E
OS:CN(R=Y%DF=N%T=96%W=3%O=%CC=N%Q=U)T1(R=Y%DF=N%T=96%S=O%A=S+%F=AS%RD=0%Q=)
OS:T2(R=Y%DF=N%T=96%W=80%S=Z%A=S%F=AR%O=%RD=0%Q=)T3(R=Y%DF=N%T=96%W=100%S=Z
OS:%A=S+%F=AR%O=%RD=0%Q=)T4(R=Y%DF=N%T=96%W=400%S=A%A=S%F=AR%O=%RD=0%Q=)T5(
OS:R=Y%DF=N%T=96%W=7A69%S=Z%A=S+%F=AR%O=%RD=0%Q=)T6(R=Y%DF=N%T=96%W=8000%S=
OS:A%A=S%F=AR%O=%RD=0%Q=)T7(R=Y%DF=N%T=96%W=FFFF%S=Z%A=S+%F=AR%O=%RD=0%Q=)U
OS:1(R=Y%DF=N%T=96%TOS=0%IPL=38%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUL=G%RUD=
OS:G)IE(R=Y%DFI=N%T=96%TOSI=Z%CD=S%SI=S%DLI=S)


Network Distance: 1 hop


Interesting ports on 192.168.1.2:
Not shown: 1714 closed ports
PORT   STATE SERVICE
80/tcp open  http
MAC Address: 00:90:4C:91:00:01 (Epigram)
Device type: general purpose
Running: Linux 2.4.X
OS details: Linux 2.4.18 - 2.4.32 (likely embedded)
Uptime: 0.115 days (since Fri Jan 23 13:45:46 2009)
Network Distance: 1 hop


All 1715 scanned ports on 192.168.1.105 are filtered
MAC Address: 00:1E:8C:B4:17:D8 (Asustek Computer)
Too many fingerprints match this host to give specific OS details
Network Distance: 1 hop


Interesting ports on 192.168.1.108:
Not shown: 1711 closed ports
PORT     STATE SERVICE
135/tcp  open  msrpc
139/tcp  open  netbios-ssn
445/tcp  open  microsoft-ds
3389/tcp open  ms-term-serv
MAC Address: 00:1C:C4:2E:7F:33 (Hewlett Packard)
Device type: general purpose
Running: Microsoft Windows Vista
OS details: Microsoft Windows Vista
Uptime: 0.055 days (since Fri Jan 23 15:12:49 2009)
Network Distance: 1 hop


Interesting ports on 192.168.1.254:
Not shown: 1709 closed ports
PORT     STATE SERVICE
22/tcp   open  ssh
111/tcp  open  rpcbind
139/tcp  open  netbios-ssn
445/tcp  open  microsoft-ds
2000/tcp open  callbook
6000/tcp open  X11
Device type: general purpose
Running: Linux 2.6.X
OS details: Linux 2.6.17 - 2.6.24
Uptime: 0.207 days (since Fri Jan 23 11:34:02 2009)
Network Distance: 0 hops


OS detection performed. Please report any incorrect results at http://nmap.org/submit/ .
Nmap done: 256 IP addresses (5 hosts up) scanned in 32.049 seconds


Okay so if you look at my local Asterisk server(192.168.1.254) you will notice that many ports are open but none of them are SIP(5060)or IAX2(4569).  Why is that?  Below the ‘-sT’ switch means SYN scan of TCP ports.

[root@mattcom1 ~]# nmap -sT 192.168.1.254


Starting Nmap 4.68 ( http://nmap.org ) at 2009-01-23 17:37 PST
Interesting ports on 192.168.1.254:
Not shown: 1709 closed ports
PORT     STATE SERVICE
22/tcp   open  ssh
111/tcp  open  rpcbind
139/tcp  open  netbios-ssn
445/tcp  open  microsoft-ds
2000/tcp open  callbook
6000/tcp open  X11

Even though Asterisk is up with a Polycom Soundpoint IP attached no SIP port appears open.  The mystery is solved if we take a close look at how a SIP calls are initiated.  SIP calls are initiated on UDP port 5060.  After the initial handshake the client opens up a series of RTP streams for audio, video, or whatever media is being relayed through SIP.  If we change the flags on the nmap tool we can see if the port is open.

[root@mattcom1 ~]# nmap -sU -p 5060 192.168.1.254


Starting Nmap 4.68 ( http://nmap.org ) at 2009-01-23 18:51 PST
Interesting ports on 192.168.1.254:
PORT     STATE         SERVICE
5060/udp open|filtered sip

We SYN scanned port UDP 5060 and the ‘STATE’ is ‘open|filtered’.  When asterisk is shut down… or the port is blocked, as we can see below…

[root@mattcom1 ~]# nmap -sU -p 5060 192.168.1.254


Starting Nmap 4.68 ( http://nmap.org ) at 2009-01-23 19:12 PST
Interesting ports on 192.168.1.254:
PORT     STATE  SERVICE
5060/udp closed sip


Nmap done: 1 IP address (1 host up) scanned in 0.114 seconds

The same is true for IAX2 as SIP.  When Asterisk is off the ‘STATE’ shows ‘closed’. One last note, the ‘open|filtered’ state could legitimately be filtered, but by checking when Asterisk(or whatever UDP service) is on and off you can tell for sure.  I got some great information at nmap.org, I encourage anyone interested to check it out.