instedd / verboice

Open source toolkit for voice services; with special focus to the needs of medium- and low-income countries, scalable services, and interacting with vulnerable populations
http://verboice.instedd.org/
GNU General Public License v3.0
43 stars 18 forks source link

Africa's Talking calls are missing Workflow & Network Logs #929

Open matiasgarciaisaia opened 1 year ago

matiasgarciaisaia commented 1 year ago

Africa's Talking calls are not showing Workflow Logs nor Network Logs.

Screenshot 2023-03-06 at 17 56 59

We should show the Workflow Logs the same way with do with other providers, and also show Network Logs with every request/response that we send to and receive from Africa's Talking for each specific phone call.

matiasgarciaisaia commented 1 year ago

For reference, I'd expect the Workflow Logs to look like SIP/Twilio's calls'.

Screenshot 2023-03-06 at 18 04 46

And this is what Africa's Talking's current call logs show (to draw inspiration from):

Screenshot 2023-03-06 at 18 09 00
ysbaddaden commented 1 year ago

@matiasgarciaisaia I don't see the Network Logs (aka PbxLog) for calls to Twilio.

Searching into the Broker, only the Asterisk PBX associates a PbxLog to a CallLog.

matiasgarciaisaia commented 1 year ago

Yes, that's true. Twilio calls only show Workflow Logs.

I guess it may make sense to log both ways? Have the Workflow Logs as a "logic" view of the call (in terms of playing a message, asking for input, recording a message), and then have the Network Logs show the request/responses we have for each call?

Both for Africa's Talking and Twilio.

ysbaddaden commented 1 year ago

I can't reproduce. I hacked the twilio simulator to behave like AFT, created an AFT channel, simulated a basic questionnaire from Surveda using it, and... I do get a Workflow Logs:

Capture d’écran de 2023-05-17 00-25-27@2x

ysbaddaden commented 1 year ago

The session as recorded by the simulator. It uses proper XML as per Africa's Talking. The Workflow Logs feels like TwiML but I guess that's caused by the Verboice flow (which might be TwiML)?

{
  "calls": {
     "fd9f95de": {
      "id": "fd9f95de",
      "username": "sandbox",
      "to": "3308",
      "from": "+33100000000",
      "no_reply": false,
      "status": "completed",
      "messages": [
        {
          "sid": "fd9f95de",
          "status": "in-progress",
          "sent_at": "2023-05-16T22:24:59Z"
        },
        {
          "message": "<?xml version=\"1.0\"?><Response><GetDigits timeout=\"5\" numDigits=\"1\"><Say language=\"en\">#oneof:1,0</Say></GetDigits><Redirect>http://broker.verboice.lvh.me:8080/africas_talking</Redirect></Response>",
          "received_at": "2023-05-16T22:24:59Z"
        },
        {
          "sid": "fd9f95de",
          "status": "in-progress",
          "digits": "0",
          "sent_at": "2023-05-16T22:25:01Z"
        },
        {
          "message": "<?xml version=\"1.0\"?><Response><Say language=\"en\">Thank you</Say><Say language=\"en\">.</Say></Response>",
          "received_at": "2023-05-16T22:25:01Z"
        }
      ]
    }
  }
}