Gotoif statement using with text and issue with recorded file quality

Little issue with GotoIf statement, When I want to use word musicone it always search first statement. I tried with or without braces ()

exten => s,n,GotoIf($[“${tempvalueeee}”=~ “one”]?ClassS1)
exten => s,n,GotoIf($[“${tempvalueeee}”=~ “(two)”]?ClassS2)
exten => s,n,GotoIf($[“${tempvalueeee}”=~ “(musicone)”]?ClassS3)

Additionally i want to know that is there any limit of Gotoif statement, As I feel some misbehave after 25 Gotoif statements.

You are using regular expression matches and the first with “one” always win. You probably need to change the order, or use simple string comparisons.

There is no internal connection between the GotoIFs, so you can have as many as you can have priorities for an extension, which is going to orders of magnitude more than you could conceivably code.

Thanks for reply , As suggested following, it seems working.
Is my syntax is right or some changes is required?

exten => s,n,GotoIf($[“${tempvalueeee}”=~ “(musicone)”]?ClassS3)
exten => s,n,GotoIf($[“${tempvalueeee}”=~ “(musictwo)”]?ClassS4)
exten => s,n,GotoIf($[“${tempvalueeee}”=~ “(one)”]?ClassS1)
exten => s,n,GotoIf($[“${tempvalueeee}”=~ “(two)”]?ClassS2)

=~ is not the same thing as =

thanks for you suggestion.

I am facing problem in record application when user record something though headphone , it is fine to use but when user record through their mobile , file is not so good or qualitative. I even tried to increase volume but not good result. We need to use this recorded file for speech purpose, that is why quality is needed.

exten => s,n,Record(/root/tempfiles/test2/${callerdatafile}:wav,0,2)
exten => s,n,System(/usr/bin/ffmpeg -i /root/tempfiles/test2/${callerdatafile}.wav -filter:a “volume=2” /root/tempfiles/test2/${callerdatafile2}.wav)

How is this related to your GotoIf problem?

Hi @EkFudrek
I followed your instruction and GotoIf issue is much better now.
No this is different problem.

There are times where people start new threads for problems that are really related, but this sounds to be sufficiently unrelated that it should be a new thread.

You need to be more precise about what is wrong. However, if we are talking about true mobile phone calls, especially outside of a rich country, you would expect the quality to be less (an in particular, anything musical to be badly compromised) when using a mobile phone. Mobile phone networks use codecs, like GSM, which are speech only and designed to minimise data rates whilst producing speech intelligible to a human. They have probably also been optimised for English speakers.

Even standard PSTN calls compromise speech quality, as they don’t carry the high frequencies needed to distinguish well between unvoiced fricatives, such as (English) f and s. That makes speech recognition over phones particularly difficult. GSM has the same frequency range compromise, but then further compromises the quality.

Can we use Hindi language words in dialplan
and also editor vi and vim creating little misbehave with Hindi language, which one is good multilingual editor, we can use for extensions.conf

exten => s,n,GotoIf($[“${tempvalu1eee}” = “वन”]?ClassS1)
exten => s,n,GotoIf($[“${tempvalu1eee}” = “तो”]?ClassS2)

What happened when you tried it?

You will need to balance the value of using Hindi with coders who are Hindi fluent versus members of this forum who I suspect are (largely) not.

As an American (AKA mostly monolingual), I have no experience in coding in languages other than English, but I find vi[m] obtuse and emacs delightful :slight_smile:

yes following statement is working
exten => s,n,GotoIf($[“${tempvalu1eee}” = “वन”]?ClassS1)

but I want to know better placement for above code with Hindi language for long term use.
Yes , I tried vi/vim/nano editor but showing little misbehave.

Providing you make sure you are working in UTF-8, I’d expect हिन्दी to work. However, I am not sure if everything will count multibyte characters properly, so when substringing variables you may have problems.

I suspect your vim problems are really with the terminal emulator. gedit, at least under gnome, seems to cope, although, for example, left arrow treats हि as one character, even though backspace treats the ि as as separate character as it does for the ् in न्द, but maybe that is what you expect.

Watch out for byte order marks in any responses you receive, as I don’t think Asterisk will delete these before comparing.

By हिन्दी I assume you really mean देवनागरी

One other thing to remember is that string length limits are in bytes, not characters, so you will only get 1/3rd of the number of characters as you would for English.

Thanks for reply.

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