#NEWLINE# def send( self , msg , * args , **kwargs ) : #NEWLINE# #INDENT# phone_number = strip_plus ( msg . phone_number ) #NEWLINE# if ( not phone_number . startswith ( '63' ) ) : #NEWLINE# #INDENT# raise MegamobileException ( 'Only Filipino phone numbers are supported' ) #NEWLINE# #UNINDENT# phone_number = phone_number [ 2 : ] #NEWLINE# text = msg . text . encode ( 'utf-8' ) #NEWLINE# pid = DEFAULT_PID #NEWLINE# config = self . config #NEWLINE# params = urlencode ( { #NEWLINE# #INDENT# 'pid' : phone_number , #NEWLINE# 'cel' : phone_number , #NEWLINE# 'msg' : text , #NEWLINE# 'src' : config . source_identifier , #NEWLINE# #UNINDENT# } ) #NEWLINE# api_account_name = quote ( config . api_account_name ) #NEWLINE# url = ( 'http://api.mymegamobile.com/%s?%s' % ( api_account_name , params ) ) #NEWLINE# response = urlopen ( url , timeout = settings . SMS_GATEWAY_TIMEOUT ) . read ( )