Need Help With A Custom Extension script

Hi community, firstly big shout out to everyone involved i have used freePbx several times and love it. However im stuck on a bit of code i found in the community, the call just hangs up after the wait 10 seconds command. Can someone please explain or show me where i am going wrong im pulling my hair out :slightly_frowning_face:

The error i am getting is

[2024-10-15 02:57:51] WARNING[28429][C-000003a5] pbx.c: No application ‘’ for extension (automated-booking, 07XXXXXXXXX, 1)

Here is my script.

[automated-booking]
exten => s,1,NoOp(Entering email code)
same => n,Set([email protected])
same => n,Answer()
same => n,Playback(custom/tapp_enter_mobile_number)
same => n,Playback(custom/enter_number_now)
same => n,WaitExten(10)
same => n,Goto(check_number,s,)

exten => _X.,1(check_number)
same => n,NoOp(Checking entered number: ${EXTEN})
same => n,Set(number=${EXTEN})
same => n,GotoIf($[${LEN(${number})} = 11]?send_email:invalid_number)

exten => send_email,1
same => n,NoOp(Sending email with the entered number)
same => n,System(echo “Number: ${number}” | mail -s “Entered Number” ${EMAIL_ADDRESS})
same => n,Playback(custom/thank_you_goodbye)
same => n,Hangup()

exten => invalid_number,1
same => n,NoOp(Invalid number entered)
same => n,Playback(custom/tapp_invalid_number)
same => n,Goto(s,1)

The message is quite clear. There must be an application (typically Noop, here) on every priority.

I don’t believe that the priority is optional.

I have changed the code to add priority but it still hangs up

same => n,Goto(check_number,s,1)

exten => _X.,1(check_number)

as i assumed that exten => _X.,1(check_number) is infact just a stage in the script called check_number, do i need to remove this code and make a [check_number] application then? Or maybe exten => check_number, 1 instead of exten => _X.,1(check_number)

Thanks for your advice

It looks to me as though:

should be:

exten => _X.,1,NoOp(Entering email code)

[quote=“Madscotslad83, post:1, topic:101679”]
same => n,Goto(check_number,s,)

exten => _X.,1(check_number)

should be deleted

should be

same => n(send_email),NoOp(Sending email with the entered number)

should be

same => n(invalid_number),NoOp(Invalid number entered)

and

should be

same => n,Goto(1)

although a symbolic name would be better, and you don’t need to start from the very beginning.

This is based on certain assumptions about what you are trying to do, and may not be correct, e.g. it is possible that you could really receive extension s.

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