apply proposed changes from https://github.com/2600hz/kazoo/tree/siplabs-KAZOO-2861