Events reach your application as HTTP requests the provider sends to URLs you host. They come in two kinds.
The first kind reports on something you started. The pharmacy's request included a StatusCallback URL, so Twilio posts status updates to that address as the message's status changes. The statuses Twilio documents for an outbound message include queued, sending, sent, delivered, undelivered and failed.
The pharmacy's code should act on the statuses it's told about. It can mark the order as notified when a delivered report arrives, and put the customer on a list for a phone call when the report says undelivered or failed. A delivered status doesn't show that the customer read the text, and the order needs a state for a text that was sent with no delivery report yet. Twilio's webhook guide says informational requests need only a standard 200 OK in reply.
The second kind starts outside your application. In Twilio, a phone number is an IncomingPhoneNumber resource with a voice URL and an SMS URL. Twilio calls the SMS URL when the number receives a text, so a customer's reply to the pharmacy arrives there. An incoming call goes to the voice URL, with one difference. Twilio waits for your response and treats it as instructions for the call, which we cover in how CPaaS handles an incoming call.
Both kinds of URL sit on the public internet, so your code should confirm that each request came from the provider. Twilio signs its requests with an X-Twilio-Signature header and recommends checking it with the validation method in its SDK.