# Cmd in rpt.conf to run a script

**URL:** <https://community.allstarlink.org/t/cmd-in-rpt-conf-to-run-a-script/22105>\
**Category:** AllStarLink\
**Created:** [October 21, 2024, 3:48pm UTC](https://community.allstarlink.org/t/cmd-in-rpt-conf-to-run-a-script/22105 "2024-10-21T15:48:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZS6DAV](https://community.allstarlink.org/letter_avatar_proxy/v4/letter/z/e5b9ba/32.png) [@ZS6DAV](https://community.allstarlink.org/u/ZS6DAV)\
**Post date:** [October 21, 2024, 3:48pm UTC](https://community.allstarlink.org/t/cmd-in-rpt-conf-to-run-a-script/22105/1 "2024-10-21T15:48:33Z")

</div>

I cannot seem to get a cmd to run a script from the rpt.conf.

I have a script in the folder /etc/asterisk/local called hello.sh  
The script works fine if I run it from the command line. However, I would like to attach it to a dtmf command.  
I have tried multiple numbers in the functions stanza but none of them work.  
eg.

819 = cmd,/etc/asterisk/local/hello

using \*819 as a dtmf yields nothing at all.  
Has anyone managed to get a dtmf code attached to a script file in ASL3?

---

<div class="post-metadata">

**Author:** ![N8EI](https://community.allstarlink.org/user_avatar/community.allstarlink.org/n8ei/32/4254_2.png) [@N8EI](https://community.allstarlink.org/u/N8EI)\
**Post date:** [October 21, 2024, 7:03pm UTC](https://community.allstarlink.org/t/cmd-in-rpt-conf-to-run-a-script/22105/2 "2024-10-21T19:03:07Z")

</div>

Make sure your file is owned and executable by the asterisk user.

> **[Permissions - AllStarLink Manual](https://allstarlink.github.io/adv-topics/permissions/#filesystem-permissions)**
>
> AllStarLink Manual

---

<div class="post-metadata">

**Author:** ![ZS6DAV](https://community.allstarlink.org/letter_avatar_proxy/v4/letter/z/e5b9ba/32.png) [@ZS6DAV](https://community.allstarlink.org/u/ZS6DAV)\
**Post date:** [October 22, 2024, 9:58am UTC](https://community.allstarlink.org/t/cmd-in-rpt-conf-to-run-a-script/22105/3 "2024-10-22T09:58:45Z")

</div>

EDIT: - ok still permissions down the line - managed to get it working.

ok - have checked the permissions.  
script is called saytime.sh in this case.  
ls -l shows the following permissions.  
-rwxr-xr-x 1 root asterisk 97 Oct 21 16:46 saytime.sh

Running the script at the command line works every time.  
rpt.conf has the following line under the functions stanza  
819 = cmd,/etc/asterisk/local/saytime

I still get nothing when I run \*819 dtmf on the node.

---

<div class="post-metadata">

**Author:** ![N8EI](https://community.allstarlink.org/user_avatar/community.allstarlink.org/n8ei/32/4254_2.png) [@N8EI](https://community.allstarlink.org/u/N8EI)\
**Post date:** [October 22, 2024, 3:38pm UTC](https://community.allstarlink.org/t/cmd-in-rpt-conf-to-run-a-script/22105/4 "2024-10-22T15:38:13Z")

</div>

If your file is `saytime.sh` on disk, then the file needs to be `saytime.sh` in `rpt.conf`. The “no file extension” thing is limited to sound files so Asterisk can pick the best format from a set of options.

---

<div class="post-metadata">

**Author:** ![ZS6DAV](https://community.allstarlink.org/letter_avatar_proxy/v4/letter/z/e5b9ba/32.png) [@ZS6DAV](https://community.allstarlink.org/u/ZS6DAV)\
**Post date:** [October 22, 2024, 4:58pm UTC](https://community.allstarlink.org/t/cmd-in-rpt-conf-to-run-a-script/22105/5 "2024-10-22T16:58:41Z")

</div>

Perfect. Thanks. All working now.

---

<div class="post-metadata">

**Author:** ![system](https://community.allstarlink.org/uploads/default/original/2X/4/42700284e201b031bd667c3f63bbae05a74b3104.png) [@system](https://community.allstarlink.org/u/system)\
**Post date:** [October 25, 2024, 4:59pm UTC](https://community.allstarlink.org/t/cmd-in-rpt-conf-to-run-a-script/22105/6 "2024-10-25T16:59:00Z")

</div>

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