It's a message from the SMPP gateway, and I think it's coming from your new_transmitter() call. Why don't you change your error message "print" statements to "warn", so that a line number gets reported. That will help to disambiguate what point along the way the message is being generated.

Out of curiosity, is it intentional that your "system_type" and "system_id" are being set to the same value?

When putting a smiley right before a closing parenthesis, do you:

Use two parentheses: (Like this: :) )
Use one parenthesis: (Like this: :)
Reverse direction of the smiley: (Like this: (: )
Use angle/square brackets instead of parentheses
Use C-style commenting to set the smiley off from the closing parenthesis
Make the smiley a dunce: (:>
I disapprove of emoticons
Other