[sip/sms] Indentation fail
This commit is contained in:
parent
399bf75dbe
commit
f8f4d7e9ec
2 changed files with 13 additions and 28 deletions
|
@ -66,7 +66,7 @@ class Sms(object):
|
|||
except (socket.error, asterisk.NullRecv):
|
||||
pass
|
||||
|
||||
def _mkdirs(path):
|
||||
def _mkdirs(self, path):
|
||||
try:
|
||||
os.makedirs(path)
|
||||
except OSError as exc:
|
||||
|
@ -80,11 +80,11 @@ class Sms(object):
|
|||
date = datetime.now().strftime('%Y%m%d%H%M%S.%f')
|
||||
path = self.sms_dir + user + '/' + date + '/'
|
||||
self._mkdirs(path)
|
||||
with open(path + 'from') as f:
|
||||
with open(path + 'from', 'w') as f:
|
||||
f.write(src)
|
||||
with open(path + 'to') as f:
|
||||
with open(path + 'to', 'w') as f:
|
||||
f.write(dst)
|
||||
with open(path + 'body') as f:
|
||||
with open(path + 'body', 'w') as f:
|
||||
if body_type=='str':
|
||||
f.write(body)
|
||||
elif body_type=='base64':
|
||||
|
@ -311,17 +311,3 @@ class Manager(object):
|
|||
if body_type == "str":
|
||||
body = base64.encodestring(body).strip()
|
||||
return self._action('messageSend', {'to':dst, 'from':src, 'base64body':body})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -5,4 +5,3 @@ from asterisk import Sms
|
|||
if __name__ == '__main__' :
|
||||
sms=Sms('/var/spool/asterisk/sms/')
|
||||
sms.sms_daemon('localhost',5038,'sms','6m6lTaEOTMsyM')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue