Commit 1ef9fed3 authored by Valentin Samir's avatar Valentin Samir
Browse files

[sip/sms] Possibilité d'envoyer des IM vers la fédération sip

Ça marche probablement, je ne peux pas tester, je n'ai pas de compte sip
supportant les IM hors crans.
parent 64b0ee04
......@@ -136,7 +136,10 @@ class Sms(object):
caller = "ServiceCenter"
if isinstance(dst, lc_ldap.objets.proprio):
to = "sip:1%04d" % dst['aid'][0].value
to = dst
ast_manager = Manager('sms', secrets.get('asterisk_sms_passwd'))
......@@ -40,8 +40,14 @@ if __name__ == '__main__':
dst = args.dst
if not dst:
dst = src
dst ="(|(uid=%(dst)s)(mailAlias=%(dst)" % {'dst' : dst, 'dst_alt' : dst.replace('sip:','')[1:]})[0]
elif not dst.startswith('sip:') and '@' in dst and not dst.endswith(''):
dst = 'sip:%s' % dst
elif not dst.startswith('sip:'):
dst = dst.replace('', '')
dst ="(|(uid=%(dst)s)(mailAlias=%(dst)" % {'dst' : dst})[0]
except IndexError:
sys.stderr.write("Pas utilisateur trouvé pour %s\n" % args.dst)
sms=Sms("dbname='django' user='crans' host=''", "voip_sms")
sms.send(dst,, src)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment