Feb 10

How to enable per extension CallerID in PBXinaFlash (PIAF) with Cbeyond and Speakeasy (Updated for Asterisk 1.8)

By agatewood VoIP Comments Off on How to enable per extension CallerID in PBXinaFlash (PIAF) with Cbeyond and Speakeasy (Updated for Asterisk 1.8)

Note: This is an update of an article written in April 2010 (http://blog.n3tg33kz.com/2010/04/how-to-enable-per-extension-caller-id-in-pbxinaflash-piaf-with-cbeyond-and-speakeasy/) and has been updated to work with Asterisk 1.8 based PBXinaFlash (www.pbxinaflash.com). It probably works with most PBXes that use FreePBX (www.freepbx.org). The procedures in this update were tested using PBX in a Flash 1.7.5.X.

This setup will enable per extension CallerID to be sent through your SIP trunk provider. It also enables CID to be passed through the system when a call is forwarded. This allows the receiver of the forwarded call to see the calling parties CID rather than the CID of the trunk or PBX. This setup also circumvents a common problem when a phone is forwarded, wherein all attempted calls to the forwarded extension fail with a ’604 Does Not Exist Anywhere’ error being returned from the provider.

This has been tested with Cbeyond SIPconnect and Speakeasy SIP Trunking and is likely to work with any provider that uses a BroadWorks platform to deliver SIP trunks. The CID functionality is accomplished by adding a diversion header into the call setup.

First, connect to your PBXinaFlash PBX and edit /etc/asterisk/extensions_override_freepbx.conf using your favorite text editor. (You will most likely want to connect to your PBXinaFlash system via SSH using a client like PuTTY.) The file will probably be empty except for a comment in the first line. Add the following lines to the file (note the changes to the 3rd to the last line below):

[macro-outbound-callerid]
include => macro-outbound-callerid-custom
exten => s,1,ExecIf($[“${CALLINGPRES_SV}” != “”],SetCallerPres,${CALLINGPRES_SV})
exten => s,n,ExecIf($[“${REALCALLERIDNUM:1:2}” = “”],Set,REALCALLERIDNUM=${CALLERID(number)})
exten => s,n(start),GotoIf($[ $[“${REALCALLERIDNUM}” = “”] | $[“${KEEPCID}” != “TRUE”] | $[“${OUTKEEPCID_${ARG1}}” = “on”] ]?normcid)
exten => s,n,Set(USEROUTCID=${REALCALLERIDNUM})
exten => s,n,GotoIf($[“foo${DB(AMPUSER/${REALCALLERIDNUM}/device)}” = “foo”]?bypass)
exten => s,n(normcid),Set(USEROUTCID=${DB(AMPUSER/${AMPUSER}/outboundcid)})
exten => s,n(bypass),Set(EMERGENCYCID=${DB(DEVICE/${REALCALLERIDNUM}/emergency_cid)})
exten => s,n,Set(TRUNKOUTCID=${OUTCID_${ARG1}})
exten => s,n,GotoIf($[“${EMERGENCYROUTE:1:2}” = “” | “${EMERGENCYCID:1:2}” = “”]?trunkcid)
exten => s,n,Set(CALLERID(all)=${EMERGENCYCID})
exten => s,n(exit),MacroExit()
exten => s,n(trunkcid),ExecIf($[“${TRUNKOUTCID:1:2}” != “”],Set,CALLERID(all)=${TRUNKOUTCID})
exten => s,n(usercid),ExecIf($[“${USEROUTCID:1:2}” != “”],Set,CALLERID(all)=${USEROUTCID})
exten => s,n(usercid),SIPAddHeader(Diversion:<sip:NPANXXXXXX@provider.domain.or.proxy>;reason=unconditional)
exten => s,n,ExecIf($[${LEN(${TRUNKCIDOVERRIDE})} != 0 | ${LEN(${FORCEDOUTCID_${ARG1}})} != 0]?Set(CALLERID(all)=${IF($[${LEN(${FORCEDOUTCID_${ARG1}})}=0]?${TRUNKCIDOVERRIDE}:${FORCEDOUTCID_${ARG1}})}))
exten => s,n(hidecid),ExecIf($[“${CALLERID(name)}”=”hidden”],SetCallerPres,prohib_passed_screen)
; end of [macro-outbound-callerid]

Next, in the 3rd to the last line, you will need to customize the string that reads ‘<sip:NPANXXXXXX@provider.domain.or.proxy>‘. Replace ‘NPANXXXXXX’ with your main phone number. On Cbeyond, this is also your username. If you are on Cbeyond, replace ‘provider.domain.or.proxy’ with the FQDN of the Cbeyond proxy (will be similar to ‘sipconnect.atl0.cbeyond.net’). If you use Speakeasy, replace ‘provider.domain.or.proxy’ with ‘speakeasy.net’. The resulting line will look similar to the following:

exten => s,n(usercid),SIPAddHeader(Diversion: <sip:4045551212@speakeasy.net>;reason=unconditional)

Assuming you already had a working trunk, no other changes should be necessary, however it is worth checking a couple settings before reloading. With regard to the trunk settings, it is important to ensure that you don’t have a ‘fromuser’ line in peer details section. If you do, simply remove it. Depending on your version of PIAF, you may have a setting for ‘Never override CallerID’. Be sure that this is not checked. Also, it is a good idea to leave the ‘Outbound Caller ID’ blank. On later versions of PIAF, there is a ‘CID Options:’ setting. Set this to ‘Allow any CallerID’

NOTE: Each extension MUST INDIVIDUALLY have an outbound CID specified. Otherwise, the call will get rejected and you will get a “all circuits busy” message when attempting to make a call.

Reload PIAF and give it a try!

Tagged with:
Jan 11

Cbeyond and PBXinaFlash DTMF – How to correct with PBXinaFlash 1.7 and Asterisk 1.6

By agatewood VoIP Comments Off on Cbeyond and PBXinaFlash DTMF – How to correct with PBXinaFlash 1.7 and Asterisk 1.6

During a recent upgrade from PBXinaFlash running Asterisk version 1.4.21.x, to PBXinaFlash version 1.7.554 bronze (Asterisk version 1.6.15), we encountered a problem with inbound DTMF from Cbeyond SIPconnect. The solution to the problem is detailed below.

The SIPconnect trunk settings were identical to the 1.4 version, however the DTMF tones were not coming through from the SIP trunk. After a lot of debugging and many iterations of DTMF settings on the trunk (including dtmfmode=auto, dtmfmode=inband, relaxdtmf=yes, relaxdtmf=no, and insecure setting variations) with no luck, someone at Cbeyond suggested that we remove the DTMF settings from the trunk and set them globally. This was accomplished by removing dtmfmode=auto and relaxdtmf=yes from the trunk settings. We then used the Asterisk SIP Settings module (from the extended repository) to add dtmfmode=inband and relaxdtmf=yes in the ‘Other SIP Settings’ section of the module. We applied the changes and everything worked perfectly!

Tagged with:
Dec 08

Adding SIP URI handling to Firefox

By agatewood Linux, VoIP Comments Off on Adding SIP URI handling to Firefox

To add SIP URI protocol handling to Firefox 3.5 and later, do the following:

1) Launch Firefox
2) Type about:config in the address bar and press ‘Enter’
3) Accept the warning
4) Right click somewhere on the page and select New –> Boolean from the menu
5) Set the name to “network.protocol-handler.expose.sip” without the quotes
6) Set the value to “false”
7) Close the about:config window (or tab)

Navigate to a page that has a SIP URI that you would like to call and click the link. When prompted, select your favorite SIP client as the application to launch. Your client should launch and connect to the URI. That’s it!

Note: SIP URIs that are embedded in webpages are in the form “sip:extension@domain.com”

Tagged with:
Jul 16

Turn off highlighting on vi (vim)

By agatewood Linux Comments Off on Turn off highlighting on vi (vim)

Recently, my vi editor (vim) began highlighting spaces and what it thought were keywords in files. This highlighting made the documents difficult to read and wasn’t needed. I’m fairly sure that I erroneously entered some command and caused this behavior. After a little googling, I found a couple of commands to turn this behavior off, specifically, ‘:set hls!’ and ‘:syntax off’. Those commands worked great until I exited vi and then opened another file. After a little searching, I found the following in /etc/vimrc:

” Switch syntax highlighting on, when the terminal has colors
” Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has(“gui_running”)
syntax on
set hlsearch
endif

Change this section to read (change on to off and remove hlsearch):

” Switch syntax highlighting on, when the terminal has colors
” Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has(“gui_running”)
syntax off
endif

Now the highlighting has disappeared. Hope this helps some others who only use vi out of necessity.

Tagged with:
Jun 23

Force unmount (umount) of a hung NFS share

By agatewood Linux Comments Off on Force unmount (umount) of a hung NFS share

When an NFS share gets hung and a standard ‘umount /mnt/share’ yields something like:

umount.nfs: 10.1.1.15:/nfs/share: not found / mounted or server not reachable

Try to force it with a ‘lazy’ unmount (umount):

umount -l /mnt/share

Tagged with:
Jun 11

Allow passive FTP on ProFTPD

By agatewood Linux Comments Off on Allow passive FTP on ProFTPD

Most FTP clients attempt to use passive FTP by default. Passive FTP is not enabled on ProFTPD. Fortunately, enabling it is very simple. Edit /etc/proftpd.conf and add ‘PassivePorts <low port> <high port>’ to the first section (global), then restart ProFTPD. You should use a really high port range to avoid conflicts. For example, you might want to add:

‘PassivePorts 63121 63129’

The number of ports needed is determined by the number of simultaneous FTP clients you expect to have.

If you are running a firewall, you may need to allow these ports in to your server. This will depend on the firewall – some will view this traffic as related, some will not.

Tagged with:
Jun 10

Re-create PIX/ASA certificate after getting sec_error_reused_issuer_and_serial error in browser

By agatewood Firewall Comments Off on Re-create PIX/ASA certificate after getting sec_error_reused_issuer_and_serial error in browser

If you receive the following error, ‘Error: sec_error_reused_issuer_and_serial’, in Firefox when attempting to connect to a Cisco PIX or ASA firewall, connect to the firewall via the console or SSH and issue the following commands in configuration mode:

ca zeroize rsa
ca generate rsa key

where is 512, 1024, or whatever bit-size you feel that the key should be (I would suggest 1024).

The key will be re-generated and you should be able to connect to the firewall and launch PDM or ASDM via the browser.

Tagged with:
Apr 13

This setup will enable per extension CallerID to be sent through your SIP trunk provider. It also enables CID to be passed through the system when a call is forwarded. This allows the receiver of the forwarded call to see the calling parties CID rather than the CID of the trunk or PBX. This setup also circumvents a common problem when a phone is forwarded, wherein all attempted calls to the forwarded extension fail with a ‘604 Does Not Exist Anywhere’ error being returned from the provider.

This has been tested with Cbeyond SIPconnect and Speakeasy SIP Trunking and is likely to work with any provider that uses a BroadWorks platform to deliver SIP trunks. The CID functionality is accomplished by adding a diversion header into the call setup.

First, connect to your PBXinaFlash PBX and edit /etc/asterisk/extensions_override_freepbx.conf using your favorite text editor. (You will most likely want to connect to your PBXinaFlash system via SSH using a client like PuTTY.) The file will probably be empty except for a comment in the first line. Add the following lines to the file (note the changes to the 3rd to the last line below):

[macro-outbound-callerid]
include => macro-outbound-callerid-custom
exten => s,1,ExecIf($[“${CALLINGPRES_SV}” != “”],SetCallerPres,${CALLINGPRES_SV})
exten => s,n,ExecIf($[“${REALCALLERIDNUM:1:2}” = “”],Set,REALCALLERIDNUM=${CALLERID(number)})
exten => s,n(start),GotoIf($[ $[“${REALCALLERIDNUM}” = “”] | $[“${KEEPCID}” != “TRUE”] | $[“${OUTKEEPCID_${ARG1}}” = “on”] ]?normcid)
exten => s,n,Set(USEROUTCID=${REALCALLERIDNUM})
exten => s,n,GotoIf($[“foo${DB(AMPUSER/${REALCALLERIDNUM}/device)}” = “foo”]?bypass)
exten => s,n(normcid),Set(USEROUTCID=${DB(AMPUSER/${REALCALLERIDNUM}/outboundcid)})
exten => s,n(bypass),Set(EMERGENCYCID=${DB(DEVICE/${REALCALLERIDNUM}/emergency_cid)})
exten => s,n,Set(TRUNKOUTCID=${OUTCID_${ARG1}})
exten => s,n,GotoIf($[ $[“${EMERGENCYROUTE:1:2}” = “”] | $[“${EMERGENCYCID:1:2}” = “”] ]?trunkcid)
exten => s,n,Set(CALLERID(all)=${EMERGENCYCID})
exten => s,n(exit),MacroExit()
exten => s,n(trunkcid),ExecIf($[“${TRUNKOUTCID:1:2}” != “”],Set,CALLERID(all)=${TRUNKOUTCID})
exten => s,n(usercid),ExecIf($[“${USEROUTCID:1:2}” != “”],Set,CALLERID(all)=${USEROUTCID})
exten => s,n(usercid),SIPAddHeader(Diversion: <sip:NPANXXXXXX@provider.domain.or.proxy>;reason=unconditional)
exten => s,n(hidecid),ExecIf($[“${CALLERID(name)}”=”hidden”],SetCallerPres,prohib_passed_screen)
; end of [macro-outbound-callerid]

Next, in the 3rd to the last line, you will need to customize the string that reads ‘<sip:NPANXXXXXX@provider.domain.or.proxy>‘. Replace ‘NPANXXXXXX’ with your main phone number. On Cbeyond, this is also your username. If you are on Cbeyond, replace ‘provider.domain.or.proxy’ with the FQDN of the Cbeyond proxy (will be similar to ‘sipconnect.atl0.cbeyond.net’). If you use Speakeasy, replace ‘provider.domain.or.proxy’ with ‘speakeasy.net’. The resulting line will look similar to the following:

exten => s,n(usercid),SIPAddHeader(Diversion: <sip:4045551212@speakeasy.net>;reason=unconditional)

Assuming you already had a working trunk, no other changes should be necessary, however it is worth checking a couple settings before reloading. With regard to the trunk settings, it is important to ensure that you don’t have a ‘fromuser’ line in peer details section. If you do, simply remove it. Depending on your version of PIAF, you may have a setting for ‘Never override CallerID’. Be sure that this is not checked. Also, it is a good idea to leave the ‘Outbound Caller ID’ blank. On later versions of PIAF, there is a ‘CID Options:’ setting. Set this to ‘Allow any CallerID’

NOTE: Each extension MUST INDIVIDUALLY have an outbound CID specified. Otherwise, the call will get rejected and you will get a “all circuits busy” message when attempting to make a call.

Reload PIAF and give it a try!

Sep 19

How to enable SIP video in PBX in a Flash

By agatewood VoIP Comments Off on How to enable SIP video in PBX in a Flash

Add the following to /etc/asterisk/sip_general_custom.conf

videosupport=yes
allow=h261
allow=h263
allow=h263p

For each extension that will use video, diallow all codecs, then allow needed audio codecs (usually ulaw, alaw, gsm, speex) and allow needed video codecs (usually h261, h263, h263p). Through the GUI, this can be accomplished by separating each codec with and ampersand character ‘ & ‘.

Asterisk 1.4 cannot negotiate the video codec as its support for video is really pass-thru. Becuase of this, video UAs need to have codecs matched manually to establish a video call.

Tagged with:
Aug 19

How to remove errors on status screen about default passwords in PIAF

By agatewood VoIP Comments Off on How to remove errors on status screen about default passwords in PIAF

Excerpted from http://pbxinaflash.com/forum/archive/index.php?t-665.html

/var/www/html/admin/header.php: starting around line 137

// default password check
$nt = notifications::create($db);
//if ($amp_conf[‘AMPMGRPASS’] == $amp_conf_defaults[‘AMPMGRPASS’][1]) {
// $nt->add_warning(’core’, ‘AMPMGRPASS’, _(”Default Asterisk Manager Password Used”), _(”You are using the default Asterisk Manager$
//} else {
$nt->delete(’core’, ‘AMPMGRPASS’);
//}

/var/www/html/admin/common/db_connect.php: starting around line 77
// Now send or delete warning wrt to default passwords:
//
$nt = notifications::create($db);

//if ($amp_conf[‘AMPDBPASS’] == $amp_conf_defaults[‘AMPDBPASS’][1]) {
// $nt->add_warning(’core’, ‘AMPDBPASS’, _(”Default SQL Password Used”), _(”You are using the default SQL password that is widely kn$
//} else {
$nt->delete(’core’, ‘AMPDBPASS’);
//}

Refresh your browser on the FreePBX System Status page after making all the changes to each file to make sure you commented out the correct lines!!

Tagged with:
preload preload preload