fixed config, moved lots of code to sipgateio class