I’m trying to replicate a channel that is created when a SIP endpoint calls an extension:
server*CLI> core show channel PJSIP/1011009248-00000002
-- General --
Name: PJSIP/1011009248-00000002
Type: PJSIP
UniqueID: pbx.example.com-1606346626.4
LinkedID: pbx.example.com-1606346626.4
Caller ID: 2003
Caller ID Name: [redacted]
Connected Line ID: (N/A)
Connected Line ID Name: (N/A)
Eff. Connected Line ID: (N/A)
Eff. Connected Line ID Name: (N/A)
DNID Digits: 600
Language: en
State: Up (6)
NativeFormats: (ulaw)
WriteFormat: gsm
ReadFormat: ulaw
WriteTranscode: Yes (gsm@8000)->(slin@8000)->(ulaw@8000)
ReadTranscode: No
Time to Hangup: 0
Elapsed Time: 0h0m7s
Bridge ID: (Not bridged)
-- PBX --
Context: internal-sip
Extension: 600
Priority: 1
Call Group: 0
Pickup Group: 0
Application: BackGround
Data: demo-echotest
Call Identifer: [C-00000002]
Variables:
CDR Variables:
level 1: dnid=600
level 1: clid="[redacted]" <2003>
level 1: src=2003
level 1: dst=600
level 1: dcontext=internal-sip
level 1: channel=PJSIP/1011009248-00000002
level 1: lastapp=BackGround
level 1: lastdata=demo-echotest
level 1: start=1606346626.867974
level 1: answer=1606346626.869008
level 1: end=0.000000
level 1: duration=6
level 1: billsec=6
level 1: disposition=1
level 1: amaflags=3
level 1: uniqueid=pbx.example.com-1606346626.4
level 1: linkedid=pbx.example.com-1606346626.4
level 1: sequence=2
My understanding is that something like:
curl -q -v -u [redacted]:[redacted] -X POST 'http://pbx:8088/ari/channels?endpoint=PJSIP/1011009248&extension=600&context=internal-sip&priority=1&callerId=12345'
should do it. But instead I am getting:
{"message":"Resource not found"}
from the curl
command and the ari debug
on the Asterisk console shows:
<--- ARI request received from: 10.75.22.1:47770 --->
Host: pbx:8088
Authorization: Basic [redacted]
User-Agent: curl/7.69.1
Accept: */*
endpoint: PJSIP/1011009248
extension: 600
context: internal-sip
priority: 1
callerId: 12345
body:
<--- Sending ARI response to 10.75.22.1:47770 --->
404 Not Found
Content-type: application/json
{"message":"Resource not found"}
What am I missing?
jcolp
November 26, 2020, 1:03am
2
Do you have all of the ARI and Stasis modules loaded?
In modules.conf
I do have:
load => res_ari.so
load => res_ari_applications.so
load => res_ari_asterisk.so
load => res_ari_bridges.so
load => res_ari_channels.so
load => res_ari_device_states.so
load => res_ari_endpoints.so
load => res_ari_events.so
load => res_ari_mailboxes.so
load => res_ari_playbacks.so
load => res_ari_recordings.so
load => res_ari_sounds.so
load => res_endpoint_stats.so
load => res_phoneprov.so
However modules show
reports:
res_ari.so Asterisk RESTful Interface 0 Running core
res_ari_applications.so RESTful API module - Stasis application 0 Not Running core
res_ari_asterisk.so RESTful API module - Asterisk resources 0 Not Running core
res_ari_bridges.so RESTful API module - Bridge resources 0 Not Running core
res_ari_channels.so RESTful API module - Channel resources 0 Not Running core
res_ari_device_states.so RESTful API module - Device state resour 0 Not Running core
res_ari_endpoints.so RESTful API module - Endpoint resources 0 Not Running core
res_ari_events.so RESTful API module - WebSocket resource 0 Not Running core
res_ari_model.so ARI Model validators 0 Running core
res_ari_playbacks.so RESTful API module - Playback control re 0 Not Running core
res_ari_recordings.so RESTful API module - Recording resources 0 Not Running core
res_ari_sounds.so RESTful API module - Sound resources 0 Not Running core
and res_ari.so
is only Running
because I did:
server*CLI> module load res_ari.so
So I’m not quite sure why those other res_ari_*.so
modules aren’t auto-loading.
However
server*CLI> module load res_ari_channels.so
did allow the curl
command to make the call.
So the question remains why those load => res_ari_*.so
are not loading those modules.
jcolp
November 26, 2020, 10:14am
4
You’d need to look at the log at Asterisk start to see if anything stands out.
The only thing that stands out is:
[Nov 25 17:20:45] WARNING[31554] loader.c: Error loading module 'res_ari_mailboxes.so': /usr/lib64/asterisk/modules/res_ari_mailboxes.so: cannot open shared object file: No such file or directory
Seems an odd error though that one missing module causes the rest to fail to load.
Indeed, however, modifying my modules.conf
as such:
load => res_ari.so
;load => res_ari_applications.so
;load => res_ari_asterisk.so
;load => res_ari_bridges.so
;load => res_ari_channels.so
;load => res_ari_device_states.so
;load => res_ari_endpoints.so
;load => res_ari_events.so
;load => res_ari_mailboxes.so
;load => res_ari_playbacks.so
;load => res_ari_recordings.so
;load => res_ari_sounds.so
;load => res_endpoint_stats.so
;load => res_phoneprov.so
actually caused all of the res_ari_*.so
modules to load and run.
Cheers!
system
Closed
December 26, 2020, 10:52am
6
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.