Receive a call with ARI

Hi,
With the following code, ARI answer a call from ZOIPER which is connected to my asterisk server.
Then when I call a specific number (let’s say 00XXYY) I receive the event from STATISSTART.

ari.connect(url, username, password,(err, client) => {
			if (err) {
				throw err;
			}
			client.start('externalMedia2');	
				client.on('StasisStart', (event, locchannel) => {
					console.log('StasisStart event received');
                                        .....

But, if the call is maid from a real phone, I receive errors from ASTERISK:

[Dec 13 09:04:28] WARNING[5786][C-00000013]: chan_sip.c:17443 check_auth: username mismatch, have <00XXYY>, digest has <anonymous>
[Dec 13 09:04:28] NOTICE[5786][C-00000013]: chan_sip.c:19650 send_check_user_failure_response: Failed to authenticate device "MY_NUM" <sip:MY_NUM@sbc6.fr.sip.ovh;user=phone>;tag=tag for INVITE, code = -2

It looks like 00XXYY is considered as the external number and MY_NUM the internal number.
I supposed to have sip:00XXYY@..ovh..
I also tried to use const extension = '00XXYY'; as a parameter but it does not work.

How to proceed to make this code answering when the call is from outside?

Thanks

The error is not ARI related. You have not provided the relevant configuration to try to understand the error.

Also you are using an unsupported channel driver and one that is not present in the source code of the latest version of Asterisk.

Thanks for your answer.
sip.conf :

[general]
defaultexpiry=1800
context=00XXYY
qualiffier = no
disallow = all
srvlookup = yes
allowguest=yes
register=>00XXYY:PASSWORD@sbc6.fr.sip.ovh:5060
context=00XXYY
bindport=18756
allow=alaw,ulaw,slin,gsm,g729,g723
accept_outofcall_message=yes
outofcall_message_context=astsms

[00XXYY]
type=friend
host=sbc6.fr.sip.ovh
context=incoming
language=fr
insecure=peer
username=00XXYY
secret=PASSWORD

myconf.conf :

[router]
exten => _X.,1,Goto(incoming,${EXTEN},1)

[incoming]
exten => 00XXYY,1,Stasis(externalMedia2)

When I add extension to the ari.connect command, ASTERISK returns that externalMedia2 is not active.

I precise that when I call 00XXYY with my zoiper number (connected to the asterisk server) it works.

For the channel driver you mean that I have to use PJSIP?

This is meaningless.

Replace “secret” with “remotesecret” and drop; the “insecure” setting.

Thanks!

to complete the solution, I modified the SIP conf:

exten => 00XXYY,1,Stasis(externalMedia2) ----> exten => s,1,Stasis(externalMedia2)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.