I have an digium app that talks to a dual-headed JSON<->PHP<->AMI and it get MailboxStatus (and perhaps anything on AMI) I don’t want to talk directly to AMI as I want to have AMI listen only to loopback.
I need to pass the extension number to the “id” of the JSON request.
how do i get the extension number (and hopefully the context) and other details of a phone?
The extension number isn’t something known by the phone. Only Asterisk knows the extensions. The API also doesn’t expose the SIP user or pass to custom applications. So, if you want to pass in something to an application that’s analogous to an extension, just pass in your own values when you load the application onto the phone.
Because DPMA knows the session of the phone and the SIP peer for that session, and, by inference, the app_voicemail mailbox for that SIP peer. Custom apps have no such ability to reach into the bowels of Asterisk that way. It’s DPMA magic.
You’ll have to figure that out, and you’ll have to pass it to your application as settings. Your app won’t be able to derive that from Asterisk.