I am development a new Dialplan for my PBX and get the question:
I should validate the DEVICE_STATE for the endpoint before Dial or not? My doubt is because in my tests when the endpoint is unreachable the Asterisk 18.2.0 return ERROR message as bellow:
-- Executing [543132462222@incoming:14] Dial("PJSIP/ALGAR-ULA-0000007d", "PJSIP/10101,20,tT") in new stack [Jun 25 09:15:27] **ERROR**: res_pjsip.c:3938 ast_sip_create_dialog_uac: Endpoint '10101': Could not create dialog to invalid URI '10101'. Is endpoint registered and reachable? [Jun 25 09:15:27] **ERROR**: chan_pjsip.c:2645 request: Failed to create outgoing session to endpoint '10101' [Jun 25 09:15:27] WARNING[C-0000004d]: app_dial.c:2596 dial_exec_full: Unable to create channel of type 'PJSIP' (cause 3 - No route to destination)
How Asterisk treat it as an error, should I check the status before Dial, or just ignore this error and leave Asterisk follow with the Dialplan?
What is your opinion?