-
#5893 |
How do I pass a parameter to a return statement in VDP? Asterisk 1.6 lets you pass a parameter which can be checked in the ${GOSUB_RETVAL} variable e.g.
exten => s,n(closed),Return(1)
VPD doesn’t seem provide a facility to do so. Am I missing something or is it not supported? I’m using version 3.1.
thanks,
Paolo#5894 |Paolo
Maybe you should try with CustomCode component,it’s located on the General sheet.
CustomCode block allows user to write traditional Asterisk dialplan code and to keep that code inside the Visual Dialplan.
So, just type Return(1) and connect output port with regular Return block.
In this way asterisk will read and accept Return command from custom block and return control back from the subroutine to the main call flow.
Regular Return block will be ignored.#5895 |The code I’m trying to write looks like this:
exten => s,1,GotoIf($${DB_EXISTS(holiday/${STRFTIME(${EPOCH},,%Y%m%d)})}=1?s,closed)
exten => s,n,GotoIfTime(12:00-23:00,*,31,dec?s,closed)
exten => s,n,GotoIfTime(*,*,1,jan?s,closed)
exten => s,n,GotoIfTime(${open_monfri}:00-${close_monfri}:00,Mon-Fri,*,*?s,open)
exten => s,n,GotoIfTime(${open_sat}:00-${close_sat}:00,Sat,*,*?s,open)
exten => s,n(closed),Return(1)
exten => s,n(open),Return(0)The problem I’m having with the custom code component is that VDP won’t validate this because the last custom return doesn’t have it’s output port connected to anything. It shouldn’t need to as it’s a return. I looked around but didn’t see an end anywhere. Would just need to be an actual return to connect it?
#5896 |Hi Pta200,
Pta200 wrote:
The problem I’m having with the custom code component is that VDP won’t validate this because the last custom return doesn’t have it’s output port connected to anything.Yes and thats why I put regular return block, just to pass validation.
Pta200 wrote:
It shouldn’t need to as it’s a returnIt’s custom code block and VDP can’t predict what command user would type.
You must be logged in to reply to this topic.