Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add attachment via SMS #95

Closed
cecilia-donnelly opened this issue Apr 8, 2016 · 6 comments
Closed

Add attachment via SMS #95

cecilia-donnelly opened this issue Apr 8, 2016 · 6 comments

Comments

@cecilia-donnelly
Copy link

At the ChiLadiesHack event, a group including @lorenanicole, @uchennafokoye, @hectron, @arieldiamond and others (please tag those I missed) worked on the following feature:

Currently, to add attachments (like pictures) to an incident in DCSOps, a responder needs to send the files to a dispatcher, who downloads them and re-uploads them into the system. Since DCSOps can already handle some text messaging via Twilio, the goal is to allow responders to send MMS messages back to the system and add the images from those messages as attachments on the incident.

Some work was done at the hackathon on this enhancement. @uchennafokoye, @arieldiamond, what's the status of that work? What needs to be done in order to turn it into a pull request?

@cecilia-donnelly
Copy link
Author

Oh, I missed PR #93, which updates the install file and sample data with information for this feature. That has the commits I pointed to in the previous comment.

See that PR for how to set up and test a local version of this. @arieldiamond, I think you had written some sample code to handle incoming MMS? Is that right? Care to push that to the existing PR or create a new one that references #93?

@jasonwinget
Copy link

Ideally it would be nice to be able to classify the attachment at a permission level for dispatcher or open. i.e. if the MMS is a picture of a case file then the viewer should have permissions that a client caseworker would have to see the "clients" tab.

@arieldiamond
Copy link

Hi Cecelia, I haven't had a chance to push up any changes/summaries yet,
but I will be able to in the next few days.

On Sunday, April 10, 2016, Jason Winget [email protected] wrote:

Ideally it would be nice to be able to classify the attachment at a
permission level for dispatcher or open. i.e. if the MMS is a picture of a
case file then the viewer should have permissions that a client caseworker
would have to see the "clients" tab.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#95 (comment)

.............................
Ariel K. Diamond
Web Developer, Butcher, Baker
arielkdiamond.com
meat-match.me
(773) 972-3870

@cecilia-donnelly
Copy link
Author

@arieldiamond thanks, that would be great! Just tag me in the commit message(s) and/or PR when you make them.

@jasonwinget that's a great idea. I think we'll probably go with "get attachments from SMS working" first and then move on to adding specific permissions. The responders would need to be trained in what images should have which permissions, too.

@arieldiamond
Copy link

Okay, I am going through my changes, and most of them are more helpful
roadmap-wise and not code-wise, since we couldn't test any twilio incoming
messages. I pushed to my fork, and I'm not sure it you can see that. Let me
know.

This is where the primary edit needs to happen:
app/controllers/incidents/api/responder_messages_twilio_controller.rb
in 'incoming', you already have access to the params[:mediaUrl], which is
how the media data comes through twilio, kind of like an imgur link. Right
now, the code is counting the number of media items, but not saving the
url. I was not able to test this, but inside of that map statement, I
pushed the mediaUrls into an array, where they can then be saved,
displayed, etc. Since we never got to receive a message, we don't know
exactly how the media urls are structured, if they are different for video,
if the data is saved anywhere permanently, etc. We were so close! I wish we
had gotten further.

Also, in lib/incidents/sms_client.rb
on client.account.messages.create, I added another element of 'mediaUrl:
responder_message.mediaUrl to that list.

I think you might know about this, but in lib/vc/client.rb, there is a
typo: attr_accesible should be attr_accessor, and I had to add a password
field to db/migrate/20130419235200_create_roster_chapters.rb.

I believe that is it! Let me know if you need anything else :)

Ariel

On Mon, Apr 11, 2016 at 12:14 PM, Cecilia Donnelly <[email protected]

wrote:

@arieldiamond https://github.com/arieldiamond thanks, that would be
great! Just tag me in the commit message(s) and/or PR when you make them.

@jasonwinget https://github.com/jasonwinget that's a great idea. I
think we'll probably go with "get attachments from SMS working" first and
then move on to adding specific permissions. The responders would need to
be trained in what images should have which permissions, too.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#95 (comment)

Ariel K. Diamond
Web Developer, Butcher, Baker
arielkdiamond.com
meat-match.me
(773) 972-3870

@cecilia-donnelly
Copy link
Author

@arieldiamond I see the PR, thank you! I'll probably make a new branch off dev-setup and merge your work there. Thanks too for catching the attr-* error -- my bad!

We do have a working Heroku instance, is that right? (cc: @lorenanicole). I could perhaps use that to test incoming text messages?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants