File tree Expand file tree Collapse file tree 4 files changed +38
-4
lines changed Expand file tree Collapse file tree 4 files changed +38
-4
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 Sms77LookupCnamAction (Action ):
8+ def __init__ (self , config = None , action_service = None ):
9+ super (Sms77LookupCnamAction , self ).__init__ (config , action_service )
10+ self .client = Sms77api (self .config ['api_key' ])
11+
12+ def run (self , number ):
13+ def on_error (ex ):
14+ err = ('Failed looking up CNAM 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 .CNAM , number )
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 caller name information using sms77.
3+ enabled : true
4+ entry_point : lookup_cnam.py
5+ name : lookup_cnam
6+ parameters :
7+ number :
8+ description : The phone number to look up.
9+ position : 0
10+ required : true
11+ type : string
12+ runner_type : python-script
Original file line number Diff line number Diff line change 44from st2common .runners .base_action import Action
55
66
7- class Sms77SendVoiceAction (Action ):
7+ class Sms77LookupHlrAction (Action ):
88 def __init__ (self , config = None , action_service = None ):
9- super (Sms77SendVoiceAction , self ).__init__ (config , action_service )
9+ super (Sms77LookupHlrAction , self ).__init__ (config , action_service )
1010 self .client = Sms77api (self .config ['api_key' ])
1111
1212 def run (self , number ):
Original file line number Diff line number Diff line change 44from st2common .runners .base_action import Action
55
66
7- class Sms77SendVoiceAction (Action ):
7+ class Sms77LookupMnpAction (Action ):
88 def __init__ (self , config = None , action_service = None ):
9- super (Sms77SendVoiceAction , self ).__init__ (config , action_service )
9+ super (Sms77LookupMnpAction , self ).__init__ (config , action_service )
1010 self .client = Sms77api (self .config ['api_key' ])
1111
1212 def run (self , number , json = False ):
You can’t perform that action at this time.
0 commit comments