# Event throwing ast\_yyerrer()

**URL:** <https://community.allstarlink.org/t/event-throwing-ast-yyerrer/20895>\
**Category:** AllStarLink\
**Tags:** beta\
**Created:** [February 29, 2024, 7:41pm UTC](https://community.allstarlink.org/t/event-throwing-ast-yyerrer/20895 "2024-02-29T19:41:22Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![N8RAW](https://community.allstarlink.org/user_avatar/community.allstarlink.org/n8raw/32/2906_2.png) [@N8RAW](https://community.allstarlink.org/u/N8RAW)\
**Post date:** [February 29, 2024, 7:41pm UTC](https://community.allstarlink.org/t/event-throwing-ast-yyerrer/20895/1 "2024-02-29T19:41:23Z")

</div>

We have what appears to be a “standard” event file which should be generating a file when a remote node is connected:

```auto
; ###### Things to do when the System is keyed by a Remote Connection
rmtactive = v|e|${RPT_ALINKS} =~ "\"[TRC]K\""
/usr/local/bin/voter/ctpicker = s|t|rmtactive
touch /temp/rmon.sig =s|t|rmtactive
rm /temp/rmon.sig = s|f|rmtactive

```

Unfortunatly, asterisk is complaining about the `rmtactive=` evaluation with:

```auto
[Feb 29 14:15:36] WARNING[622] ast_expr2.fl: ast_yyerror(): syntax error: syntax error, unexpected '='TILDE, expecting $end; Input:
  =~ "[TRC]K"
  ^
[Feb 29 14:15:36] WARNING[622] ast_expr2.fl: If you have questions, please refer to doc/channelvariables.txt in the asterisk source.

```

Anyone else seeing this? Any pointers as to what is wrong with the =~ test (it’s really exactly what is found in the cookbook).

---

<div class="post-metadata">

**Author:** ![Mike](https://community.allstarlink.org/user_avatar/community.allstarlink.org/mike/32/1569_2.png) [@Mike](https://community.allstarlink.org/u/Mike)\
**Post date:** [February 29, 2024, 7:45pm UTC](https://community.allstarlink.org/t/event-throwing-ast-yyerrer/20895/2 "2024-02-29T19:45:58Z")

</div>

You might start by saying the version of software you are using and hardware.

I take it you are using the voter system as well ?

---

<div class="post-metadata">

**Author:** ![N8RAW](https://community.allstarlink.org/user_avatar/community.allstarlink.org/n8raw/32/2906_2.png) [@N8RAW](https://community.allstarlink.org/u/N8RAW)\
**Post date:** [March 1, 2024, 12:14pm UTC](https://community.allstarlink.org/t/event-throwing-ast-yyerrer/20895/3 "2024-03-01T12:14:12Z")

</div>

Oh yah- the devil is in the details 🙂

Asterisk reports:  
AllStarLink Asterisk Version 2.0.0-beta 03/24/2021 GIT 645450c  
Copyright (C) 1999 - 2018 Digium, Inc. Jim Dixon and others  
Copyright (C) 2018-2021 AllStarLink Inc.

Looking through our old repeater controller (Debian 10), I’m seeing the same error.  
Asterisk 1538, Copyright (C) 1999 - 2008 Digium, Inc. and others.

We have a Doug Hall voter on the primary input, and the voter.conf is also configured for 2 additional nodes.

---

<div class="post-metadata">

**Author:** ![Mike](https://community.allstarlink.org/user_avatar/community.allstarlink.org/mike/32/1569_2.png) [@Mike](https://community.allstarlink.org/u/Mike)\
**Post date:** [March 1, 2024, 2:14pm UTC](https://community.allstarlink.org/t/event-throwing-ast-yyerrer/20895/4 "2024-03-01T14:14:30Z")

</div>

I am still not clear on your configuration and unable to assist.

Perhaps others with more voter experience will chime in.

But I would make it easy for someone else and state your configuration. Otherwise the error looks like a wild one.

---

<div class="post-metadata">

**Author:** ![N8RAW](https://community.allstarlink.org/user_avatar/community.allstarlink.org/n8raw/32/2906_2.png) [@N8RAW](https://community.allstarlink.org/u/N8RAW)\
**Post date:** [March 1, 2024, 4:24pm UTC](https://community.allstarlink.org/t/event-throwing-ast-yyerrer/20895/5 "2024-03-01T16:24:50Z")

</div>

Thanks for following up. It’s probably my lack of experience here - I thought this was a somewhat standard event file. When “things” happen, actions can be triggered.  
The file is included from rpt.conf: (Like this)

```auto
[events]
#include /etc/asterisk/local/events

```

the total event file looks like this:

```auto

; ###### Event Management configuration file - K8SN

; ###### Things to do when the System is keyed by a LOCAL or RTCM Remote Rptr Site based Signal.
rxactive = v|e|${RPT_RXKEYED}
/usr/local/bin/voter/ctpicker = s|t|rxactive
touch /temp/rxon.sig =s|t|rxactive
rm /temp/rxon.sig = s|f|rxactive

; ###### Things to do when the System is keyed by a Remote Connection
rmtactive = v|e|${RPT_ALINKS} =~ "\"[TRC]K\""
/usr/local/bin/voter/ctpicker = s|t|rmtactive
touch /temp/rmon.sig =s|t|rmtactive
rm /temp/rmon.sig = s|f|rmtactive

; ###### Things to do when the Transmitter is keyed:
txactive = v|e|${RPT_TXKEYED}
touch /temp/onair.sig =s|t|txactive
rm /temp/onair.sig = s|f|txactive

```

rxactive and txactive work fine, and rmtactive works “most” of the time, except when it doesn’t 🙂 When things aren’t “right” I’m finding the `ast_yyerrer()` message in the log.  
I’m really at a loss for what could be wrong with the expression where it works some times and not others.

I did see in an asterisk forum something about Null or None types in comparisons triggering this type of error. If that were the case, I’m thinking v|e|${RPT\_ALINKS} is returning a none or null some of the times (which it probably shouldn’t).

Hopefully someone has the solution

---

<div class="post-metadata">

**Author:** ![Mike](https://community.allstarlink.org/user_avatar/community.allstarlink.org/mike/32/1569_2.png) [@Mike](https://community.allstarlink.org/u/Mike)\
**Post date:** [March 2, 2024, 2:51pm UTC](https://community.allstarlink.org/t/event-throwing-ast-yyerrer/20895/6 "2024-03-02T14:51:51Z")

</div>

What you are posting is code of event management subsystem  
Custom code for user decided control…

It would be hard for anyone to know what might be incorrect because it requires knowing the logic of everything connected, which nobody knows just what that is. Or the purpose of the code.

But, I think you are going to have to follow it logically on your own.  
It might help to ask the guy who wrote it.

Just guessing, but it is complaining of a syntax error and showing you the error line

```auto
  syntax error: syntax error, unexpected '='TILDE, expecting $end; Input: =~ "[TRC]K"

```

So, I’m not sure what the function of the tilde is in your code. But it looks like that is what it is complaining about.

[https://wiki.allstarlink.org/wiki/Event\_Management](https://wiki.allstarlink.org/wiki/Event_Management)

---

<div class="post-metadata">

**Author:** ![N8RAW](https://community.allstarlink.org/user_avatar/community.allstarlink.org/n8raw/32/2906_2.png) [@N8RAW](https://community.allstarlink.org/u/N8RAW)\
**Post date:** [March 2, 2024, 5:06pm UTC](https://community.allstarlink.org/t/event-throwing-ast-yyerrer/20895/7 "2024-03-02T17:06:08Z")

</div>

Right - that’s the web page that I have copied.  
this is my code

```auto
rmtactive = v|e|${RPT_ALINKS} =~ "\"[TRC]K\""

```

this is the example:

```auto
TEMPVAR = v|e|${RPT_ALINKS} =~ "\",2001[TRC]K\""

```

We are looking for “any” node adjacent.

It appears that `RPT_ALINKS` or `v|e|${RPT_ALINKS}` is resolving to something that asterisk doesn’t like.  
After a bit more digging, it looks like if no adjacent nodes (RPT\_ALINKS) connected, the error shows up in the log. Maybe it’s just an annoyance that we have to live with ☹

This link is somewhat related [Asterisk: Dropping calls with an "ast\_yyerror" - Server Fault](https://serverfault.com/questions/129491/asterisk-dropping-calls-with-an-ast-yyerror) - similar error, but I don’t believe the resolution is possible in the events file.

---

<div class="post-metadata">

**Author:** ![Mike](https://community.allstarlink.org/user_avatar/community.allstarlink.org/mike/32/1569_2.png) [@Mike](https://community.allstarlink.org/u/Mike)\
**Post date:** [March 2, 2024, 6:44pm UTC](https://community.allstarlink.org/t/event-throwing-ast-yyerrer/20895/8 "2024-03-02T18:44:57Z")

</div>

I can only say what it shows is a syntax error.  
So something is fat fingered.  
Review the commands for correctness.

When you first error is a syntax error, the subsequent errors may result because of it not executing.  
So, you gotta fix it first.

---

<div class="post-metadata">

**Author:** ![encbar5](https://community.allstarlink.org/letter_avatar_proxy/v4/letter/e/c37758/32.png) [@encbar5](https://community.allstarlink.org/u/encbar5)\
**Post date:** [March 3, 2024, 1:45pm UTC](https://community.allstarlink.org/t/event-throwing-ast-yyerrer/20895/9 "2024-03-03T13:45:58Z")

</div>

Could you try one of the tricks from the serverfault post, like using double quotes:  
`rmtactive = v|e|"${RPT_ALINKS}" =~ "\"[TRC]K\""`

---

<div class="post-metadata">

**Author:** ![N8RAW](https://community.allstarlink.org/user_avatar/community.allstarlink.org/n8raw/32/2906_2.png) [@N8RAW](https://community.allstarlink.org/u/N8RAW)\
**Post date:** [March 3, 2024, 3:15pm UTC](https://community.allstarlink.org/t/event-throwing-ast-yyerrer/20895/10 "2024-03-03T15:15:26Z")

</div>

encbar5 - thanks for the idea. I had already tried the " and it did not evaluate correctly ☹

I think I have figured out the issue. `${RPT_ALINKS}` is not defined after startup or reload of asterisk.  
doing a rpt xnode shows NO `${RPT_ALINKS}`. Connect to a remote node and `${RPT_ALINKS}` appears with the correct format, Disconnect from remote node at `${RPT_ALINKS}` = 0 (and the error goes/stays away).  
I suppose some sort of initialization for this var needs to happen in a config file somewhere… or just live with the errors in the log until a connect actually happens.

---

<div class="post-metadata">

**Author:** ![Mike](https://community.allstarlink.org/user_avatar/community.allstarlink.org/mike/32/1569_2.png) [@Mike](https://community.allstarlink.org/u/Mike)\
**Post date:** [March 4, 2024, 7:49pm UTC](https://community.allstarlink.org/t/event-throwing-ast-yyerrer/20895/11 "2024-03-04T19:49:31Z")

</div>

If you have a var or global var, you need to double check it’s creation and a default/starting value.  
And just when those occur because you can’t set a global var that has yet to be created. Timing…
