Dialplan => start dialing when endpoint registers (PUSH) improve the wait

Hi
i’m looking for a way to improve my dialplan…
I use android with softphones, but when the sofphone app is closed, the registration is gone… and it cant be called, so i send a PUSH message with webhook that starts the app in background
Works verry good, i see the registration coming in after 1-2 seconds

exten => 8003,1,Set(CURL_RESULT=${SHELL(curl -X POST http://localhost:8123/api/webhook/push_sip)})
exten => 8003,n,Wait(4)
exten => 8003,n,Dial(SIP/8003,30,rt)

In the dialplan, i just wait 4 seconds before dialing, should be enough… but i want to improve it by a check… is there some command i can use to see if there is an active registration, some kind of IF THEN …
like
=> IF registration = available => ring
=> ELSE wait for registration => then call

is this possible?

You should be able to use the DEVICE_STATE function.

You should no longer be using chan_sip.

thx, yeah i know, thats the next step :slight_smile:
running asterisk in docker, pjsip not implemented yet

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