Can't Open Wireshark After OS X 10.10 Yosemite Upgrade

Reading online produced the conclusion that X11 Quartz (a dependency of Wireshark) had been moved from /usr/X11 to /opt/X11 as a part of the upgrade to OS X 10.10 (Yosemite). To restore the ability to open Wireshark, create symlink from the old location, /usr/X11 to the new location, /opt/X11.
sudo ln -s /opt/X11 /usr/X11
Now try launching Wireshark. The first time I launched it took ~60 seconds to load. All subsequent launches took considerably less time.

OS X 10.10 Yosemite MySQL Wont Start At Startup

After upgrading to Yosemite, I noticed MySQL would no longer start on startup even though "Automatically Start MysQL Server on Startup" was enabled in the MySQL system preferences.

I'm not certain what caused this to break, but I suspect the LaunchDaemon file that MySQL 5.6 uses is no longer being recognized. Maybe the location it is placing the .plist file has been changed in OS X 10.10.

To resolve I created /Library/LaunchDaemons/com.mysql.mysql.plist with the following contents:




  
    KeepAlive
    
    Label
    com.mysql.mysqld
    ProgramArguments
    
    /usr/local/mysql/bin/mysqld_safe
    --user=mysql
    
  



Then load the newly created plist file
sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysql.plist

partrotate_unixtimestamp.pl

partrotate_unixtimestamp.pl

$maxparts = 6; #6 days How long keep the data in the DB
$newparts = 2; #new partitions for 2 days. Anyway, start this script daily!
@stepsvalues = (86400, 3600, 1800, 900);
$partstep = 0; # 0 - Day, 1 - Hour, 2 - 30 Minutes, 3 - 15 Minutes

Mysql partitioning allows a large table to be segmented, storing each segment in a different file. This allows multiple disks to be used for a single table to increase efficiency. This also allows for increased query times when a WHERE statement including the partitioning index includes, allowing mysql to only have to search the records in the relevant partitions and not all the data in the table.

The Mysql database table storing the captures is partitioned using range partitioning by the unix timestamp of the date column. By default, $partstep is defined as 1 day, and so each partition contains one days worth of captures. Every night when the cron job is run, the oldest partition is deleted, and a new partition is created. The "VALUES LESS THAN MAX VALUE" partition always exists as a catchall in case an INSERT is performed with a date before the last specifically defined partition so an error will not be returned.

The partitions are named using the format pYearMonthDayHour with minutes being included in the name if the $partstep is more frequent than every hour ( > 1). p2013081620

PARTITION BY RANGE ( UNIX_TIMESTAMP(`date`))
(PARTITION p2013081620 VALUES LESS THAN (1376784000) ENGINE = MyISAM,
 PARTITION p2013081720 VALUES LESS THAN (1376870400) ENGINE = MyISAM,
 PARTITION p2013081820 VALUES LESS THAN (1376956800) ENGINE = MyISAM,
 PARTITION p2013081920 VALUES LESS THAN (1377043200) ENGINE = MyISAM,
 PARTITION p2013082020 VALUES LESS THAN (1377129600) ENGINE = MyISAM,
 PARTITION p2013082120 VALUES LESS THAN (1377216000) ENGINE = MyISAM,
 PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = MyISAM)


$maxparts - defines how many partitions will be created in the database. This is a bit confusing because $newparts defines the number of the partitions in the future. So really there are ($maxparts - $newparts) partitions of historical data, plus the partial current day, and ($newparts - 1) partitions covering future days.

$newparts - defines how many of the defined partitions will be in the future. For example when $newparts = 2,

ILOM

http://docs.oracle.com/cd/E19836-01/E20746/z40002821391018.html


The ILOM reset command generates a graceful or forced hardware reset of the server. By default, the reset command gracefully resets the server.
  • Type one of the following commands to reset the server.
    • Perform a graceful reset from ILOM:
      -> reset /SYS
    • If a graceful reset is not possible, perform a forced hardware reset from ILOM:
      -> reset -force /SYS

Cacti

http://docs.cacti.net/manual:088:1_installation.1_install_unix

Name: you may choose your own
Consolidation function: AVERAGE needed
X-Files Factor: always 0.5
Steps: 1 (that is the number of data points to use for consolidation, 1 says: no consolidation at all)
Rows: 115200 = 400 days with 24 hours and 12 data points per hour (= 5 min interval)
Timespan: used for displaying 33,053,184 seconds = about 382 days (taken from other cacti rra)

Name: just suggestive name 
Steps (archiving ratio): how many data points (poll values) are needed to put as one value of the RRA.
For RRA "Monthly" 24 poll values (24 polls * 5 minute between poll = 120 min= 2 hour) will be consolidates as 1 value.
By default one step represents 300 seconds (5 minutes), which is how often data is entered into the rrd file. 
Rows (Hours to store values): how many generations data is kept in the RRA.   

Storage (calculated) default RRAs , 1 RRD = 94 KB (94824 Bytes)
Timespan (used for graphs only): how many seconds to display in graph for this RRA.
X-Files Factor: The amount of UNKNOWN data that can still be regarded as known (= 0.5 always)



TCP-MIB::tcpRtoAlgorithm.0 = INTEGER: other(1)
TCP-MIB::tcpRtoMin.0 = INTEGER: 200 milliseconds
TCP-MIB::tcpRtoMax.0 = INTEGER: 120000 milliseconds
TCP-MIB::tcpMaxConn.0 = INTEGER: -1
TCP-MIB::tcpActiveOpens.0 = Counter32: 5
TCP-MIB::tcpPassiveOpens.0 = Counter32: 157
TCP-MIB::tcpAttemptFails.0 = Counter32: 11
TCP-MIB::tcpEstabResets.0 = Counter32: 4
TCP-MIB::tcpCurrEstab.0 = Gauge32: 0
TCP-MIB::tcpInSegs.0 = Counter32: 9670
TCP-MIB::tcpOutSegs.0 = Counter32: 9881
TCP-MIB::tcpRetransSegs.0 = Counter32: 96

OSX TFTP Server

http://blog.dustinrue.com/archives/655
https://discussions.apple.com/thread/3661529?start=15&tstart=0
http://meinit.nl/how-to-enable-tftp-server-on-mac-os-x

FTP Server Behind Time Capsule

Set server up as "default" host in time capsule using the airport utility. On client use the the "u" flag -u Restrains ftp from attempting ``auto-authentication'' upon initial connection. If auto-authentication is enabled, ftp attempts to authenticate to the FTP server by sending the AUTH command, using whichever authenti- cation types are locally supported. Once an authenti- cation type is accepted, an authentication protocol will proceed by issuing ADAT commands. This option also disables auto-login. # ftp -u ftp.server.com Connected to ftp.server.com. 220 192.168.3.3 FTP server (tnftpd 20100324+GSSAPI) ready. Remote system type is UNIX. Using binary mode to transfer files. ftp> user (username) ftpusername 331 User ftpusername accepted, provide password. Password: 230 User ftpusername logged in. ftp> passive Passive mode off. ftp> mput file.txt mput file.txt? y

Linux Central Authentication

aws iam isn't open to managing resource outside of aws 

https://github.com/denismo/aws-iam-ldap-bridge/blob/master/INSTALL.md was the closest i found and seemed like a giant hac

https://code.google.com/p/openssh-lpk/ - patching openssh to store keys
The OpenSSH LDAP Public Key patch provides an easy way of centralizing strong user authentication by using an LDAP server for retrieving public keys instead of ~/.ssh/authorized_keys.

google authenticator has a cool pam module.. but i need soln that less trendy, more practical
https://code.google.com/p/google-authenticator/wiki/PamModuleInstructions

using ldap to centralize account information and using a configuration management tool like chef or puppet to distribute authorized_keys file doesn't seem to allow for the granularity required. Need to be able to limit which users can access which hosts without complicated exception rules in configuration management tool
http://serverfault.com/questions/471753/what-are-best-practices-for-managing-ssh-keys-in-a-team

Arrived at freeipa.

Upgrading OSX PHP to 5.4.15 with snmp and radius support

By default the new macbook pros ship with an older version of php. Looking back it's hard to remember why I needed to upgrade, but I believe the introduction of namespaces in php came after the version that was shipped with my mac, and consequently I couldn't develop using zend framework 2. I aslo needed to compile with snmp support.

Most of what is needed to accomplish compiling php 5.4.15 (latest stable), I found here:
http://mac.tutsplus.com/tutorials/server/upgrading-the-native-php-installation-on-os-x-mountain-lion/

Quick Summary:
Mac by default doesn't have a good place collect src. Follow *nix traditions...
mkdir /usr/local/src

Prereqs Installed via Brew:
brew install libjpeg
brew install pcre
brew install libxml2
brew install mcrypt

Prereq ICU:
cd /usr/local/src
curl -O http://download.icu-project.org/files/icu4c/4.8.1.1/icu4c-4_8_1_1-src.tgz
tar -xzvf icu4c-4_8_1-src.tgz
cd icu/source
./runConfigureICU MacOSX
make
sudo make install

Prereq imap-2007:
cd /usr/local/src
curl -O http://cursor.uam.mx/mirrors/imap/imap-2007f.tar.gz
tar -zxvf imap-2007f.tar.gz
cd ~/Downloads/imap-2007f
make osx EXTRACFLAGS="arch i386 -arch X86_64 -g -Os -pipe -no-cpp-precomp"
sudo cp c-client/*.h /usr/local/include/
sudo cp c-client/*.c /usr/local/lib/
sudo cp c-client/c-client.a /usr/local/lib/libc-client.a

cd /usr/local/src
curl -O http://us1.php.net/get/php-5.4.15.tar.gz/from/us3.php.net/mirror
tar -zxvf php-5.4.15.tar.gz
./configure  \
--prefix=/usr  \
--mandir=/usr/share/man  \
--infodir=/usr/share/info  \
--sysconfdir=/private/etc  \
--with-apxs2=/usr/sbin/apxs  \
--enable-cli  \
--with-config-file-path=/etc  \
--with-libxml-dir=/usr  \
--with-openssl=/usr  \
--with-kerberos=/usr  \
--with-zlib=/usr  \
--enable-bcmath  \
--with-bz2=/usr  \
--enable-calendar  \
--with-curl=/usr  \
--enable-dba  \
--enable-exif  \
--enable-ftp  \
--with-gd  \
--enable-gd-native-ttf  \
--with-icu-dir=/usr/local \
--with-iodbc=/usr  \
--with-ldap=/usr  \
--with-ldap-sasl=/usr  \
--with-libedit=/usr  \
--enable-mbstring  \
--enable-mbregex  \
--with-mysql=mysqlnd  \
--with-mysqli=mysqlnd  \
--with-pdo-mysql=mysqlnd  \
--with-mysql-sock=/var/mysql/mysql.sock  \
--with-readline=/usr  \
--enable-shmop  \
--with-snmp=/usr  \
--enable-soap  \
--enable-sockets  \
--enable-sysvmsg  \
--enable-sysvsem  \
--enable-sysvshm  \
--with-tidy  \
--enable-wddx  \
--with-xmlrpc  \
--with-iconv-dir=/usr  \
--with-xsl=/usr  \
--enable-zip  \
--with-imap=/usr/local/imap-2007 \
--with-kerberos \
--with-imap-ssl \
--enable-intl \
--with-pcre-regex  \
--with-pgsql=/usr  \
--with-pdo-pgsql=/usr \
--with-freetype-dir=/usr/X11 \
--with-jpeg-dir=/usr  \
--with-png-dir=/usr/X11
make test
sudo make install

modify /etc/apache2/httpd.conf to contain
LoadModule php5_module        libexec/apache2/libphp5.so

sudo apachectl restart

To add radius support, I attempted to install the radius extension using pear which resulted in a compile error. I had to modify one line of in radius.c to correct the extension so it would compile against php-5.4.15.
cd /usr/local/src
curl -O http://pecl.php.net/get/radius
tar -zxvf radius-1.2.5.tar.gz
cd radius-1.2.5
$ phpize
change line containing "function_entry" to "zend_function_entry" to fix compile error that occurred during pear install
$ ./configure
$ make
# make install

PHP Composer Zend Framework 2 Doctrine 2 Eclipse Egit


Create a new Git Repository
Right click in PHP Explorer in Eclipse
New->Other-Git Repository
Create the new repository

Import Project From Git
Right clic in PHP Explorer in Eclipse
Import->Projects from Git->Local
Select the Git repository you just created
choose to open new projects wizard.


Build Application
cd C:\...\git\utils
Get composer
php -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'));"
php composer.phar install

Shell Script to Delete Empty Files in Directory

Script to delete all empty files in a directory. This was specially designed for directories that have hundreds of thousands of files in them (ls has a limitation for directories with a large number of files in them, so find must be used)



#!/bin/bash
# Example: ./delete_empty_files.sh /home/random_files/

usage()
{
        echo "Usage: $0 Directory_Name"
        exit 1;
}

test -d "$1" || usage

function test_and_delete()
{
  while read line1; do
     size=`stat -c %s $line1`
     if [ $size -lt 1 ]; then
     #echo "$line1 is $size ( This one is empty ) "
     rm -f $line1
  else
     #echo "$line1 is $size "
  fi
  done
}
cd $1
find -name "*" | test_and_delete



Provisioning WS-C3550-24PWR-SMI For Use With Polycoms

Provisioning WS-C3550-24PWR-SMI From Default Settings

Connect via console cable and configure hostname, telnet access and passwords using wizard at boot first time

Create voice and data vlan
3550(config)#vlan 2
3550(config-vlan)#name data
3550(config-vlan)# 790
3550(config-vlan)#name voice
Configure IP address on voice vlan
3550(config)#interface Vlan 790
3550(config-if)#ip address 192.168.16.2 255.255.255.0
Configure the default gateway
3550(config)# ip default-gateway 192.168.16.1
Configure gigbit ports as trunk ports to router or downstream switches
3550(config)#interface range gigabitEthernet 0/1 - 2
3550(config-if)# switchport trunk encapsulation dot1q
3550(config-if)# switchport trunk allowed vlan 2,790
3550(config-if)# switchport mode trunk
Configure 24 fastethernet ports as trunk ports for phones and/or computers. Vlan 790 will be tagged and vlan 2 (the native vlan) will be untagged. Note: the untagged vlan is called the "native vlan" when the switchport mode is "trunk". The untagged vlan is called the "access vlan" when the switchport mode is "access".
3550(config)#int range fastEthernet 0/1 - 24
3550(config-if-range)# switchport trunk encapsulation dot1q
3550(config-if-range)# switchport trunk native vlan 2
3550(config-if-range)# switchport mode trunk

Resolving Inline Power Issue

When using a WS-C3550-24PWR-SMI with a default config a Polycom 335 using POE cannot successfully boot up. During the bootup process just before the Polycom typically displays the networking information on the screen, the Polycom restarts its ethernet interface. By default the Cisco 3550 stops sending power to the port when it detects the link is down which causes the phone to lose power and restart. To remedy this problem the 3550 interface can be configured to delay turning off power to port for a defined number of seconds after it detects the link is down.

power inline delay {shutdown seconds initial seconds}

The initial time period begins when the powered device is detected by the switch. If linkdown occurs
on the connected device during the initial time period, the shutdown time determines
how long the switch continues to provide power to the device.
3550(config)# int range fastEthernet 0/1 - 24
3550(config-if-range)# power inline delay shutdown 20 initial 300
By applying the above command to an interface the switch will continue to provide power to the device 20 seconds after linkdown and the power shutdown delay will be in effect for the first 300 seconds. It may be necessary to upgrade IOS image to c3550-ipservicesk9-mz.122-44.SE6.bin as the power inline command is not available in older versions.


Upgrading the IOS image

Obtain a copy of the new IOS image and place on TFTP server. c3550-ipservicesk9-mz.122-44.SE6.bin will be used as an example. Note: an EMI image (enhanced software) can run on SMI hardware.

Show contents of flash and the space left (listed at the bottom)
Make sure there is enough room for the new ISO image
3550# dir flash:
Directory of flash:/
    2  -rwx        2177   Mar 01 1993 00:07:02  config.text
    3  -rwx           5   Mar 01 1993 00:07:02  private-config.text
    4  -rwx         676   Mar 01 1993 00:41:24  vlan.dat
   21  -rwx     3334765   Mar 02 1993 03:09:04  c3550-i9q3l2-mz.121-14.EA1a.bin
15998976 bytes total (6278656 bytes free)
To delete a file
3550# delete flash:c3550-i9q3l2-mz.121-14.EA1a.bin
Delete filename [c3550-i9q3l2-mz.121-14.EA1a.bin]?
Delete flash:c3550-i9q3l2-mz.121-14.EA1a.bin? [confirm]
 To see contents of a folder
3550# dir c3550-i5q3l2-mz.121-11.EA1
To delete a folder
3550# delete /force /recursive c3550-i5q3l2-mz.121-11.EA1
3550# Delete filename [c3550-i5q3l2-mz.121-11.EA1]?

Download and install IOS image. It should also update the boot statement
3550#copy tftp://tftp-server-ip/c3550-ipservicesk9-mz.122-44.SE6.bin flash://c3550-ipservicesk9-mz.122-44.SE6.bin
Verify the image was corrupted in transfer
3550#verify /md5 flash:c3550-ipservicesk9-mz.122-44.SE6.bin
..........................Done!
verify /md5 (flash:c3550-ipservicesk9-mz.122-44.SE6.bin) = a829d14ab1ccd3ecf77b99d025d188ce
Tell the switch to use the new IOS image
3550(config)#boot system flash:c3550-ipservicesk9-mz.122-44.SE6.bin
Confirm the new boot statement is correct
3550 # show boot
BOOT path-list:       flash:c3550-ipservicesk9-mz.122-44.SE6.bin
Config file:          flash:/config.text
Private Config file:  flash:/private-config.text
Enable Break:         no
Manual Boot:          no
HELPER path-list:  
NVRAM/Config file
      buffer size:    393216
Save any changes made to the config
3550#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
Restart the switch
3550#reload
After restart, confirm switch is running new IOS
3550# show version
Cisco IOS Software, C3550 Software (C3550-IPSERVICESK9-M), Version 12.2(44)SE6, RELEASE SOFTWARE (fc1)
...
System image file is "flash:c3550-ipservicesk9-mz.122-44.SE6.bin"
...

Mediatrix 1124 5.0.24.172 MWI Woes

The mediatrix mwi subscription has never seemed to work quite right. Below is a list of the caveats I've noticed.

Caveat 1:
Summary: If the subscription timer (.1.3.6.1.4.1.4935.15.100.1.20 mwiExpirationTime) seems to be anything other than 180 seconds (the minimum) it does not seem to send the re-subscribe before the session expires like it should.
Explanation: When the subscription timer is set to 180, the mediatrix consistently re-subscribes every 120 seconds. When the subscription timer is set to 300 or 600, the mediatrix does not send the re-subscribe message. It instead waits for the subscription to expire producing the syslog message
SipEngine [0204] L2 subscription terminated, server shutting down, will retry subscription in 2 minutes.
All subsequent NOTIFY messages from the switch receive a 487 REQUEST TERMINATED until the mediatrix re-subscribes. It seems that it re-subscribes the next time it registers, or two mins after its subscription expired (which ever comes first)

Caveat 2:
Summary: The mediatrix breaks its subscription if it receives a NOTIFY for a line shortly after the line has been hung up.
Explanation. If the mediatrix receives a NOTIFY for a line just after that line has been hung up, it returns a 400 INVALID MESSAGE-SUMMARY. This causes the switch to drop the subscription and the end user to not get any notifications until later when the mediatrix tries to re-subscribe when it thinks the session expires. At this point the mediatrix tries to re-subscribe but since the switch has already dropped the subscription, it returns a 481 Call/Transaction Does Not Exist. The mediatrix sends a new subscribe a few mins later and succeeds. I suspect this problem has something to do with the state the mediatrix is in just after line is hung up, and the mediatrix just handles it poorly.

Here is summary of the tests I performed


mediatrix is registering with sip server in router every 2 mins for rate pacing purposes, but router only allowing registers to central office every 1800 seconds


Subscription Timer Set for 180 seconds (3 mins) and empty vm box
0  seconds - mediatrix sends SUBSCRIBE receives OK, immediately gets NOTIFY returns OK
2 mins - 120 seconds -mediatrix sends SUBSCRIBE receives OK, immediately gets NOTIFY returns OK
4 mins - 240 seconds - mediatrix sends SUBSCRIBE receives OK, immediately gets NOTIFY returns OK
Continue.



Subscription Timer Set for 300 seconds (5 mins) and empty vm box
0  seconds - mediatrix sends SUBSCRIBE receives OK, immediately gets NOTIFY returns OK
3 mins -180 seconds - gets unsolicited notify from NMS and mediatrix responds with OK
5 mins - 300 seconds - gets unsoliticted notify from NMS and mediatrix responds with 487 Request Terminated
6 mins - 360 seconds - mediatrix sends REGISTER to router (which doesn't make it to nms) and sends SUBSCRIBE (which does make it to nms). Nms responds with NOTIFY and the mediatrix OKs it.
Repeat.

Subscription timer set for 600 seconds (10 mins) and empty vm box
0  seconds - mediatrix sends SUBSCRIBE receives OK, immediately gets NOTIFY returns OK
3 mins - 180 seconds - gets unsolicited NOTIFY from NMS and mediatrix responds with OK
6 mins - 360 seconds - gets unsolicited NOTIFY from NMS and mediatrix responds with OK
9 mins - 540 seconds - gets unsolicited NOTIFY from NMS and mediatrix responds with OK
10 mins - 600 seconds - gets unsoliticted NOTIFY from NMS and mediatrix responds with 487 Request Terminated
12 mins - 720 seconds - mediatrix sends REGITSTER to router (which doesn't make it to nms b/c of rate pacing) and sends SUBSCRIBE (which does make it to nms). Nms responds with NOTIFY and the mediatrix OKs it.
Repeat.

Rsyslog

Wrote a customer Rsyslog.conf file to parse output from edgewater's edgemarc devices.

Things to remember:
using the optimized mysql module ommysql.

The following rule is what writes to the SystemEvents table using the default template
*.*     :ommysql:127.0.0.1,Syslog,syslogwriter,

I need to start rolling /var/log/messages

RT Exchange Loop

When someone submits a reply or ticket from a no-reply email address it is creating an email loop even with RT's StoreLoop enabled.

The email get sent in to create the reply. RT attempts to acknowledge it got the reply by responding to the reply. It delivers an outbound email to exchange which tries to deliver the email to the no-reply email address. Google comes back and says there is no account for that no-reply address. Exchange sends an email to RT saying that it will not continue to attempt to deliver this message. RT responds to this email. Enter loop.

iperf

wget https://downloads.sourceforge.net/project/iperf/iperf-2.0.5.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fiperf%2F&ts=1306362724&use_mirror=cdnetworks-us-2
tar -xvzf iperf-2.0.5.tar.gz
cd iperf-2.0.5
./configure
make
make install
iperf -c 69.68.5.149 -u -b 10m

fetchmail with RT

edit config for fetchmail in /etc/fetchmail

/etc/init.d/fetchmail start
to start fetchmail


poll remote.tlcl.net    proto pop3:
auth password
username rt                     password *****   mda "/opt/rt3/bin/rt-mailgate --url http://url --queue General --action correspond"

Enabling ASDM Access On Management Network

pixfirewall> enable
Password:
pixfirewall# configure terminal
pixfirewall(Config)# interface ethernet1
pixfirewall(Config-if)# nameif inside
pixfirewall(Config-if)# ip address 192.168.1.1 255.255.255.0
pixfirewall(Config-if)# no shutdown
pixfirewall(Config-if)#
Activate ASDM and enable http server.
pixfirewall(Config)# asdm image flash:/asdm.bin.
pixfirewall(Config)# http server enable.
Open a connection for your PC. Example your pc IP address is 192.168.1.2
pixfirewall(Config)# http 192.168.1.2 255.255.255.255 inside
Make sure all your config running properly.
pixfirewall(Config)# show running http
http server enabled
http 192.168.1.0 255.255.255.0 inside
pixfirewall(Config)#
Now your Cisco ASA/PIX can be access from your PC.
Make sure your PC and Firewall has connected and open your web browser then enter this address
https://192.168.1.1/admin

Converting Cisco 7912 to SIP

Converting 7940/7960 to SIP is a walk in the park compared to converting a 7912. In order to convert the phone I had to:

  • Point the phone to my tftp server and allow it to download the correct firmware. I used cp7912080000sip060111a
  • Then I found and edited the "sipexample.txt" file that came with the firmware to work with my SIP setup
  • Then I tried to run cfgfmt.exe on "sipexample.txt" but it told me that it could not find ptag.dat so I had to rename the file "sip_ptag.dat" that came with the firmware to ptag.dat for the tool to convert the text file into a binary file.
  • Finally i placed the binary file named gkMAC_ADDRESS in root of the tftp server and restarted the phone. My tftp server already had a binary copy of gkdefault.txt on it or otherwise I would have had to convert that file to binary with the tool and place it on the tftp server as well

VoIP Faxing Notes

Large fix size jitter buffer

Don't use echo cancellation

Call starts out in either g711 or g729
Then if the switch hears the cng tones and t.38 is enabled on the mediatrix box, it switches over to t.38
If you are using g729, the switch might not detect the cng tones which is why g711 is better.
The preferred Clear channel codec is only for when t.38 is disabled, and it describes what codec to then use for when cng tones are detected.
T.38 is not a call setup protocol, thus the T.38 devices need to use standard call setup protocols to negotiate the T.38 call, e.g. H.323, SIP & MGCP.
For call waiting to work the user must have the call waiting feature in broadsoft, it must be turned on and call waiting must be enabled on the mediatrix box otherwise it returns a busy signal
Faxes Have to be set to the lowest baud rate 9,600. The default for most of the newer machines is 33,600.


Step 1: Reduce baud rate to 9600 or lowest possible (probably 2400)
Step 2: Disable error correction (ECM)
Step 3: Disable bandwidth saver by dialing *99 (countrycode-areacode-number)

The call path is a little confusing (why is there an INVITE from
196.38.232.2 -> 192.168.0.14 and then an INVITE back to the latter from
the former?), but the basic problem seems to be that you the default
voice codec set to G.729A.  This would explain why "training failed."

The way that T.38 setup works - at least, in the Cisco voice gateway
world - is that the call is first established using a voice codec.  The
DSPs on the receiving gateway analyze the acoustic content of the audio
stream for fax tones and/or modem preambles ("listen").  If they are
detected, the receiving gateway issues a re-INVITE and requests a switch
to T.38 in its new SDP offer.

In order for this to happen, the frequency response of the codec must be
sufficient to reconstruct the clear-channel PCM content of the bearer
channel.  This is only possible with G.711u/A, which is little more than
a packetised form of clear-channel 8 KHz PCM that carries the 3.1 KHz
(300 Hz to 3400 Hz) bearer spectrum of a digital DS0 and/or a
modem-grade analog line.

G.729A is a codec that uses some advanced compression techniques relying
on CELP (Code Excited Linear Prediction).  Like many other compression
schemes, it also shrinks the size of the data by referring via shorthand
to elements of a waveform table/model that approximate the quantised
value of a sample, but do not EQUAL it.  It's good enough for voice that
humans don't see too much of a difference vs. clear-channel PCM, but for
any sort of scheme reliant on the encoding of digital data into the
acoustic content of the bearer, it will positively not work.

As a result, G.729A cannot be used for either the conveyance or
detection of fax tones.  You need to switch this call to G.711u or
G.711A (in Cisco, "g711ulaw" or "g711alaw") before the appropriate
exchange can take place.  Hopefully, that should be all that is
necessary to effect a switch to T.38.  Make sure the default audio codec
for the call is G.711u/A END-TO-END (in all VoIP legs), so that no
transcoding to/from G.729A occurs anywhere.

Of course, there are a variety of other issues that can be brought to
bear on this scenario, but try that and see how it plays out.  One thing
at a time.