3 Commits 988a585bb8 ... 2c7204eb2f

Author SHA1 Message Date
  Hal De 2c7204eb2f BNumber 3 years ago
  Hal De 252a2756b6 Merge branch 'master' of https://gogs.halsbox.ru/RRT/pbx 3 years ago
  Hal De 694e404f26 logging 3 years ago
2 changed files with 13 additions and 0 deletions
  1. 8 0
      app/app.py
  2. 5 0
      docker-compose.yml

+ 8 - 0
app/app.py

@@ -224,6 +224,8 @@ async def newchannelCallback(mngr: Manager, msg: Message):
         _cb['WebCallId'] = app.cache['cel_calls'][msg.linkedid]['WebCallId']
         _cb['WebCallId'] = app.cache['cel_calls'][msg.linkedid]['WebCallId']
       if (msg.linkedid in  app.cache['cel_calls']) and ('CallerNumber' in app.cache['cel_calls'][msg.linkedid]):
       if (msg.linkedid in  app.cache['cel_calls']) and ('CallerNumber' in app.cache['cel_calls'][msg.linkedid]):
         _cb['CallerNumber'] = app.cache['cel_calls'][msg.linkedid]['CallerNumber']
         _cb['CallerNumber'] = app.cache['cel_calls'][msg.linkedid]['CallerNumber']
+      if (msg.linkedid in  app.cache['cel_calls']) and ('BNumber' in app.cache['cel_calls'][msg.linkedid]):
+        _cb['BNumber'] = app.cache['cel_calls'][msg.linkedid]['BNumber']
       #reply = await doCallback(device, _cb)
       #reply = await doCallback(device, _cb)
 
 
 @manager.register_event('CEL')
 @manager.register_event('CEL')
@@ -289,6 +291,8 @@ async def celCallback(mngr: Manager, msg: Message):
              _cb['WebCallId'] = app.cache['cel_calls'][msg.linkedid]['WebCallId']
              _cb['WebCallId'] = app.cache['cel_calls'][msg.linkedid]['WebCallId']
            if ('CallerNumber' in app.cache['cel_calls'][msg.linkedid]):
            if ('CallerNumber' in app.cache['cel_calls'][msg.linkedid]):
              _cb['CallerNumber'] = app.cache['cel_calls'][msg.linkedid]['CallerNumber']
              _cb['CallerNumber'] = app.cache['cel_calls'][msg.linkedid]['CallerNumber']
+           if ('BNumber' in app.cache['cel_calls'][msg.linkedid]):
+             _cb['BNumber'] = app.cache['cel_calls'][msg.linkedid]['BNumber']
            reply = await doCallback(device, _cb)
            reply = await doCallback(device, _cb)
     if ((msg.Application == 'Queue') and
     if ((msg.Application == 'Queue') and
         (msg.EventName == 'APP_START') and 
         (msg.EventName == 'APP_START') and 
@@ -328,6 +332,8 @@ async def celCallback(mngr: Manager, msg: Message):
               _cb['WebCallId'] = app.cache['cel_calls'][msg.linkedid]['WebCallId']
               _cb['WebCallId'] = app.cache['cel_calls'][msg.linkedid]['WebCallId']
           if ('CallerNumber' in app.cache['cel_calls'][msg.linkedid]):
           if ('CallerNumber' in app.cache['cel_calls'][msg.linkedid]):
              _cb['CallerNumber'] = app.cache['cel_calls'][msg.linkedid]['CallerNumber']
              _cb['CallerNumber'] = app.cache['cel_calls'][msg.linkedid]['CallerNumber']
+          if ('BNumber' in app.cache['cel_calls'][msg.linkedid]):
+             _cb['BNumber'] = app.cache['cel_calls'][msg.linkedid]['BNumber']
           reply = await doCallback('groupRinging', _cb)
           reply = await doCallback('groupRinging', _cb)
         if ((msg.EventName == 'ANSWER') and
         if ((msg.EventName == 'ANSWER') and
           (msg.Application == 'AppDial') and
           (msg.Application == 'AppDial') and
@@ -343,6 +349,8 @@ async def celCallback(mngr: Manager, msg: Message):
             _cb['WebCallId'] = app.cache['cel_calls'][msg.linkedid]['WebCallId']
             _cb['WebCallId'] = app.cache['cel_calls'][msg.linkedid]['WebCallId']
           if ('CallerNumber' in app.cache['cel_calls'][msg.linkedid]):
           if ('CallerNumber' in app.cache['cel_calls'][msg.linkedid]):
              _cb['CallerNumber'] = app.cache['cel_calls'][msg.linkedid]['CallerNumber']
              _cb['CallerNumber'] = app.cache['cel_calls'][msg.linkedid]['CallerNumber']
+          if ('BNumber' in app.cache['cel_calls'][msg.linkedid]):
+             _cb['BNumber'] = app.cache['cel_calls'][msg.linkedid]['BNumber']
           reply = await doCallback('groupAnswered', _cb)
           reply = await doCallback('groupAnswered', _cb)
           
           
     if ((msg.Application == 'Queue') and
     if ((msg.Application == 'Queue') and

+ 5 - 0
docker-compose.yml

@@ -51,6 +51,11 @@ services:
       - /etc/localtime:/etc/localtime:ro
       - /etc/localtime:/etc/localtime:ro
       - ./app:/app
       - ./app:/app
       - ${PERSISTENT_STORAGE_PATH}/pbx/var/spool/asterisk/monitor:/app/static/records
       - ${PERSISTENT_STORAGE_PATH}/pbx/var/spool/asterisk/monitor:/app/static/records
+    logging:
+      driver: json-file
+      options:
+        max-size: 50m
+        max-file: 10
     environment:
     environment:
     - APP_FQDN
     - APP_FQDN
     - APP_API_PORT
     - APP_API_PORT