Hal De 4 år sedan
förälder
incheckning
aa910b1cdb
1 ändrade filer med 3 tillägg och 2 borttagningar
  1. 3 2
      app/app.py

+ 3 - 2
app/app.py

@@ -201,9 +201,9 @@ async def newchannelCallback(mngr: Manager, msg: Message):
         cid = msg.calleridnum
       uid = msg.uniqueid
     if device is not None:
-      app.logger.warning('gonna make callback')
       row = await db.fetch_one(query='SELECT url FROM callback_urls WHERE device = :device',
-                               values={'device': app.cache['devicemap'][user]})
+                               values={'device': device})
+      app.logger.warning('{}-{}-{}'.format((row is not None), ('url' in row), (row['url'].startswith('http'))))
       if (row is not None) and ('url' in row) and (row['url'].startswith('http')):
         reply = await app.config['HTTP_CLIENT'].post(row['url'],
                                                      json={'user': user,
@@ -212,6 +212,7 @@ async def newchannelCallback(mngr: Manager, msg: Message):
                                                            'callerId': cid,
                                                            'did': did,
                                                            'callId': uid})
+        app.logger.warning('callback done')
 
 async def getCDR(start=None,
                  end=None,