diff --git a/src/mod/applications/mod_httapi/examples/perl/ext_pin.cgi b/src/mod/applications/mod_httapi/examples/perl/ext_pin.cgi index 0ffbc3fc43..7b5afd2755 100755 --- a/src/mod/applications/mod_httapi/examples/perl/ext_pin.cgi +++ b/src/mod/applications/mod_httapi/examples/perl/ext_pin.cgi @@ -33,6 +33,12 @@ if ($pin) { } $writer->endTag('params'); +if ($exten eq "invalid" || $pin eq "invalid") { + $writer->startTag('work'); + $writer->emptyTag('hangup', cause => "destination_out_of_order"); + $writer->endTag('work'); +} + if ($exten && $pin) { $writer->startTag('work'); $writer->dataElement("playback", "http://sidious.freeswitch.org/sounds/ext_num.wav"); @@ -58,6 +64,7 @@ if ($exten && $pin) { $writer->startTag('playback', name => "exten", file => "http://sidious.freeswitch.org/sounds/exten.wav", + loops => "3", 'error-file' => "http://sidious.freeswitch.org/sounds/invalid.wav", 'input-timeout' => "5000"); diff --git a/src/mod/applications/mod_httapi/mod_httapi.c b/src/mod/applications/mod_httapi/mod_httapi.c index 08ef37d446..ae4782b9bc 100644 --- a/src/mod/applications/mod_httapi/mod_httapi.c +++ b/src/mod/applications/mod_httapi/mod_httapi.c @@ -447,6 +447,8 @@ static switch_status_t parse_playback(const char *tag_name, client_t *client, sw if (status == SWITCH_STATUS_BREAK) { if (error_file) { switch_ivr_play_file(client->session, NULL, error_file, &nullargs); + switch_event_add_header_string(client->one_time_params, SWITCH_STACK_BOTTOM, name, "invalid"); + switch_event_add_header_string(client->one_time_params, SWITCH_STACK_BOTTOM, "input_type", "invalid"); status = SWITCH_STATUS_SUCCESS; } } else if (status == SWITCH_STATUS_FOUND) {