Good afternoon. I have something I’m working on - a ZoHo Creator application that can be used to kick off a test call to our techs in the field for an inbound call test.
Ultimately what I want Asterisk/FreePBX to do is:
-Call the external number (give up after 30 seconds)
-Once connected to the external number, route the call to the Echo Test (stop after 2 minutes)
My hope was to have ZoHo send the AMI command to Asterisk, but I don’t know what that command would look like. Meaning, we have multiple outbound trunk groups so naming the SIP channel for outbound isn’t the greatest (I’d rather it use the Outbound Route patterns FreePBX built). Also, in general, I’m not sure what I’d have to submit to AMI to make this all happen.
I toyed with actually making a little dialplan application that did all this, then just use AMI to call that application, but don’t really even now how to do that either (I thought maybe the application would have a variable for the external number, and in the AMI command, the VAR value would be transmitted to define the external number).
Anyone have any thoughts on this, or the best way to achieve it?
My Echo Test extension is *90 and external calling can be processed either as a 10-digit number or 9+<10DigitNumber>.
Also, right after I posted this, i found out my issue was with the context I was using. This command works:
Action: Originate
Channel: SIP/C1a-OUT/
Context: from-internal
Exten: *90
Priority: 1
Callerid: 5138888888
Timeout: 30000
ActionID: ZOHO-Test
But, I still don’t know how to put a max duration on it, nor how to not require naming the outbound SIP trunk (since we have 5 possible outbound trunks).
I was thinking if web manager worked, I could actually post a URL to kick it off, but haven’t been able to get that to work as of yet even with me just entering the data manually myself (comes back with 404 Not Found): http://<SystemAddress>:8088/manager?action=login&username=<TheActualUserName>&secret=<TheActualSecret>
then: http://<SystemAddress>:8088/manager?action=Originate&Channel=SIP/C1a-OUT/<DestinationNumber>&Context=from-internal&Exten=*90&Priority=1&Callerid=GCIT%20VoiceTest%20%3C5138888888%3E&Timeout=30000&ActionID=ZOHO-Test-%3Crandom%3E
I’m concerned with being able to actually get the call file onto the system, since the Zoho Creator application is on other servers in another data center.
Apparently HTTP access to manager is disabled (even though in the manager_custom.conf I have “webenabled = yes”.
HTTP Server Status:
Prefix:
Server: Asterisk/13.19.1
Server Enabled and Bound to [::]:8088
HTTPS Server Enabled and Bound to [::]:8089
Enabled URI's:
/httpstatus => Asterisk HTTP General Status
/static/... => Asterisk HTTP Static Delivery
/ari/... => Asterisk RESTful API
/ws => Asterisk HTTP WebSocket
It matters where the include lines are placed in the original file. In this case, manager.conf does not have an include for the [general] section. If it did, it would be called something like manager_general_custom.conf and the include line would be placed after the [general] line not at the end of the file.
Unlike most Asterisk conf files, FreePBX permits users to edit manager.conf so it is simple to just make the changes directly.
Is there any way to have the authenticate and originate actions in the same string? I tried assembling it as all one thing, and it didn’t seem to like that. I had to authenticate first, then send the second submission with the originate action.
Since there’s an AMI acknowledgment in between those, I don’t think so. You might be able to do it with a pair of new-lines in the string (simulating a blank line) in the string, but I still think it’s going to end up being two pieces. Try it and see - AMI is a reasonably forgiving protocol.
That’s what I was afraid of. I’ve got a 3rd party system that I want to send a command to the system to issue a test call, and it’s sending the two URLs but it’s happening so fast, it’s before the AUTH has been received and I’m not really able to slow it down (that I’ve found yet). It’s also possible the auth is coming from a different IP than the next URL pull (the system is in multiple data centers). So, bummer there…
You would need to have a proxy running on 5038 listening to the 3rd party, then serialize the two before calling AMI on 127.0.0.1:5038, and have ami only bind to localhost. (or change the ports for one or the other)
I see you might be using ami over html, the same thing would apply but you need in your case to proxy 8888 from ethN to localhost and bind the ami/http similarly to localhost only