[PATCH] smpp: Move the coding/mode detection into a utils file