From 22f9ea8cee20433f1b539117a0f4a35a2f62d969 Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Tue, 3 Dec 2013 20:01:10 +0100 Subject: [PATCH] =?UTF-8?q?[asterisk]=C2=A0s/base64.encodestring/base64.b6?= =?UTF-8?q?4encode/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sip/asterisk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sip/asterisk.py b/sip/asterisk.py index 3f27e461..2df97b4c 100644 --- a/sip/asterisk.py +++ b/sip/asterisk.py @@ -101,7 +101,7 @@ class Sms(object): raise EnvironmentError("body_type sould be 'str' ou 'base64' not %r" % body_type) conn = psycopg2.connect(self.sql_params) cur = conn.cursor() - cur.execute('INSERT INTO %s (date, "from", "to", body, "user") VALUES (NOW(), %%s, %%s, %%s, %%s)' % self.database, (src, dst, base64.encodestring(body).strip() if body_type=='str' else body, user)) + cur.execute('INSERT INTO %s (date, "from", "to", body, "user") VALUES (NOW(), %%s, %%s, %%s, %%s)' % self.database, (src, dst, base64.b64encode(body).strip() if body_type=='str' else body, user)) conn.commit() cur.close() conn.close()