I’m learning ARI in Asterisk, I manage to run it and get a response successfully. However, their some requests that I don’t understand what it is for, or how can I use it. I hope someone will guide me through it either by giving example or tell me which chapter of the asterisk guide book 5th edition I can look for the answer.
get /asterisk/config/dynamic/{configClass}/{objectType}/{id}
put /endpoints/sendMessage
Linux aasterisk 3.10.0-1062.9.1.el7.x86_64 #1 SMP Fri Dec 6 15:49:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
I'm Using Asterisk 16 cert
Routes are documented on the wiki[1][2]. The first one being for getting the configuration of an object configured using ARI push configuration. The second one being for sending a text message to an endpoint.
Hi Jcolp,
I did read both wikis before I ask the question. But thankfully the term ARI push configuration (which you mention ) is the thing I was looking for, and it guides me to two good articles Here and Here
Regarding endpoint messages, dose it means sending messages like SMS (or something like it ? )
Here me tring to do it, do can you guide me where is the issue
It means to send a SIP MESSAGE to the endpoint. What that does or means is up to the endpoint itself. I haven’t sent a message from the Swagger-UI site, so I do not know what is precisely expected from it to have it work.
In the swagger definition and UI the SIP MESSAGE “body” is marked as a query parameter. However, for some reason the swagger UI does not let you specify it as such. Oddly enough it does let you set it as a body parameter. Try adding something like the following in the “variables” field:
{
"body": "this is a test"
}
Note, that setting it as a query parameter in other clients like curl seems to work fine so I suspect a bug maybe in the swagger UI client.
I believe you’re getting that message due to not specifying the tech in the to/from field. You must specify the channel tech (pjsip, sip, etc…) there. For example:
to = pjsip:506
from = pjsip:Moha
Subsequently, you can remove the “tech” key/value from the variables object.
I tried SIP/506 before but not SIP:506.
There something I relies SMS before use to come from Moha (name of the sender ) now its coming with Asterisk as sender, do you have idea why ?
I’m not sure how chan_sip works in this regard. Make sure the “from” field is being set, and maybe check the “fromuser” setting on the peer? Maybe someone else has a better idea?