Skip to content

Implement MMS Image Reception and Processing for AI Analysis #474

@chrispaskvan

Description

@chrispaskvan

Summary
This feature involves creating the necessary infrastructure to receive MMS messages from users, specifically those containing images. The system must be able to detect an incoming image, download it from the provider (e.g., Twilio), and prepare it for a subsequent upload to an AI service for analysis.

User Story
As a user of the service, I want to be able to send an MMS message with an image to a designated phone number so that the image can be analyzed by an AI to provide me with relevant information or process a request.

Acceptance Criteria
[ ] A webhook endpoint (e.g., POST /mms/incoming) is created and configured to receive MMS notifications from a provider like Twilio.

[ ] The webhook handler correctly parses incoming requests and checks for the presence of attached media (i.e., NumMedia > 0).

[ ] The system can extract the MediaUrl for each attached image from the webhook payload.

[ ] A service or function is implemented to download the image from the extracted MediaUrl and store it temporarily on the server's filesystem or in-memory buffer.

[ ] Proper error handling is in place for cases where no media is attached, the download fails, or the media is not an image.

[ ] A placeholder or stub function exists that takes the path to the downloaded image as input, ready to be implemented for uploading to the AI analysis service.

[ ] The webhook responds to the provider with a 200 OK status and appropriate TwiML to acknowledge receipt of the message.

Reference
For implementation guidance on receiving and downloading images via MMS with Node.js, please refer to the following Twilio tutorial:

How to Receive and Download Images from Incoming MMS Messages in Node.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions