From e8c9c69906436774abd508f36d3c9292145b2aa5 Mon Sep 17 00:00:00 2001 From: Alexandre Savard <alexandresavard@alexandresavard-desktop.(none)> Date: Wed, 10 Feb 2010 17:49:27 -0500 Subject: [PATCH] [#2521] Fix pysflphonectrlsimple (Module md5 not supported anymore) --- tools/pysflphone/sflphonectrlsimple.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/pysflphone/sflphonectrlsimple.py b/tools/pysflphone/sflphonectrlsimple.py index a7d0a5ee2a..bf5ffb75ad 100755 --- a/tools/pysflphone/sflphonectrlsimple.py +++ b/tools/pysflphone/sflphonectrlsimple.py @@ -29,7 +29,7 @@ from gobject import GObject import getopt import time -import md5 +import hashlib from threading import Thread @@ -405,11 +405,12 @@ class SflPhoneCtrlSimple(object): if dest is None or dest == "": raise SflPhoneError("Invalid call destination") - # callid = str(random.randrange(2**32-1)) + # Generate a call ID for this + m = hashlib.md5() t = long( time.time() * 1000 ) r = long( random.random()*100000000000000000L ) - data = str(t) + str(r) - callid = md5.md5(data).hexdigest() + m.update(str(t) + str(r)) + callid = m.hexdigest() # Add the call to the list of active calls and set status to SENT self.activeCalls[callid] = {'Account': self.account, 'To': dest, 'State': 'SENT' } -- GitLab