File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ from sms77api .Sms77api import Sms77api
2+ from sms77api .classes .Lookup import LookupType
3+
4+ from st2common .runners .base_action import Action
5+
6+
7+ class Sms77SendVoiceAction (Action ):
8+ def __init__ (self , config = None , action_service = None ):
9+ super (Sms77SendVoiceAction , self ).__init__ (config , action_service )
10+ self .client = Sms77api (self .config ['api_key' ])
11+
12+ def run (self , number , json = False ):
13+ def on_error (ex ):
14+ err = ('Failed looking up MNP for: %s, exception: %s\n ' % (number , str (ex )))
15+ self .logger .error (err )
16+ raise Exception (err )
17+
18+ try :
19+ return self .client .lookup (LookupType .MNP , number , json )
20+
21+ except Exception as e :
22+ on_error (e )
Original file line number Diff line number Diff line change 1+ ---
2+ description : This looks up mobile number portability information using sms77.
3+ enabled : true
4+ entry_point : lookup_mnp.py
5+ name : lookup_mnp
6+ parameters :
7+ json :
8+ description : Return a detailed JSON response?
9+ position : 1
10+ type : boolean
11+ number :
12+ description : The phone number to look up.
13+ position : 0
14+ required : true
15+ type : string
16+ runner_type : python-script
You can’t perform that action at this time.
0 commit comments