public:radio:mb7azeconf
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
public:radio:mb7azeconf [02/07/22 15:26 BST] – [DEVCAL] john | public:radio:mb7azeconf [26/04/23 14:49 BST] (current) – removed john | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | <-[[.:]] | ||
- | ====== MB7AZE : svxlink config ====== | ||
- | |||
- | ===== Main config file ===== | ||
- | ++++ svxlink.conf | | ||
- | |||
- | <file bash svxlink.conf> | ||
- | ############################################################################### | ||
- | # # | ||
- | # Configuration file for the SvxLink server | ||
- | # # | ||
- | ############################################################################### | ||
- | |||
- | [GLOBAL] | ||
- | # | ||
- | LOGICS=SimplexLogic, | ||
- | CFG_DIR=svxlink.d | ||
- | TIMESTAMP_FORMAT=" | ||
- | CARD_SAMPLE_RATE=48000 | ||
- | # | ||
- | LOCATION_INFO=LocationInfo | ||
- | LINKS=LinkToReflector | ||
- | |||
- | [SimplexLogic] | ||
- | TYPE=Simplex | ||
- | RX=Rx1 | ||
- | TX=Tx1 | ||
- | DEFAULT_LANG=en_US | ||
- | MODULES=ModuleHelp, | ||
- | CALLSIGN=MB7AZE | ||
- | SHORT_IDENT_INTERVAL=15 | ||
- | SHORT_CW_ID_ENABLE=1 | ||
- | SHORT_VOICE_ID_ENABLE=0 | ||
- | LONG_VOICE_ID_ENABLE=1 | ||
- | CW_AMP=-20 | ||
- | CW_PITCH=1000 | ||
- | CW_WPM=20 | ||
- | LONG_IDENT_INTERVAL=60 | ||
- | # | ||
- | # | ||
- | EVENT_HANDLER=/ | ||
- | RGR_SOUND_DELAY=0 | ||
- | # | ||
- | TX_CTCSS=ALWAYS | ||
- | MACROS=Macros | ||
- | FX_GAIN_NORMAL=0 | ||
- | FX_GAIN_LOW=-12 | ||
- | # | ||
- | # | ||
- | ONLINE_CMD=998877 | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | TIME_FORMAT=24 | ||
- | RGR_SOUND_ALWAYS=1 | ||
- | |||
- | [RepeaterLogic] | ||
- | TYPE=Repeater | ||
- | RX=Rx1 | ||
- | TX=Tx1 | ||
- | MODULES=ModuleHelp, | ||
- | CALLSIGN=MYCALL | ||
- | SHORT_IDENT_INTERVAL=10 | ||
- | LONG_IDENT_INTERVAL=60 | ||
- | # | ||
- | # | ||
- | EVENT_HANDLER=/ | ||
- | DEFAULT_LANG=en_US | ||
- | RGR_SOUND_DELAY=0 | ||
- | REPORT_CTCSS=136.5 | ||
- | # | ||
- | MACROS=Macros | ||
- | # | ||
- | FX_GAIN_NORMAL=0 | ||
- | FX_GAIN_LOW=-12 | ||
- | # | ||
- | # | ||
- | IDLE_TIMEOUT=30 | ||
- | OPEN_ON_1750=1000 | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | IDLE_SOUND_INTERVAL=3000 | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | |||
- | [ReflectorLogic] | ||
- | TYPE=Reflector | ||
- | DEFAULT_LANG=en_US | ||
- | HOSTS=" | ||
- | HOST_PORT=5300 | ||
- | CALLSIGN=MB7AZE | ||
- | AUTH_KEY=" | ||
- | JITTER_BUFFER_DELAY=0 | ||
- | DEFAULT_TG=0 | ||
- | MONITOR_TGS=8, | ||
- | TG_SELECT_TIMEOUT=60 | ||
- | ANNOUNCE_REMOTE_MIN_INTERVAL=300 | ||
- | MUTE_FIRST_TX_LOC=0 | ||
- | MUTE_FIRST_TX_REM=0 | ||
- | TMP_MONITOR_TIMEOUT=3600 | ||
- | EVENT_HANDLER=/ | ||
- | NODE_INFO_FILE=/ | ||
- | |||
- | [LinkToReflector] | ||
- | CONNECT_LOGICS=SimplexLogic: | ||
- | DEFAULT_ACTIVE=1 | ||
- | # | ||
- | # | ||
- | OPTIONS=DEFAULT_CONNECT, | ||
- | |||
- | [QsoRecorder] | ||
- | REC_DIR=/ | ||
- | # | ||
- | MAX_TIME=3600 | ||
- | SOFT_TIME=300 | ||
- | MAX_DIRSIZE=1024 | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | |||
- | [Voter] | ||
- | TYPE=Voter | ||
- | RECEIVERS=Rx1, | ||
- | VOTING_DELAY=200 | ||
- | BUFFER_LENGTH=0 | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | |||
- | [MultiTx] | ||
- | TYPE=Multi | ||
- | TRANSMITTERS=Tx1, | ||
- | |||
- | [NetRx] | ||
- | TYPE=Net | ||
- | HOST=remote.rx.host | ||
- | TCP_PORT=5210 | ||
- | # | ||
- | AUTH_KEY=" | ||
- | CODEC=S16 | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | |||
- | [NetTx] | ||
- | TYPE=Net | ||
- | HOST=remote.tx.host | ||
- | TCP_PORT=5210 | ||
- | # | ||
- | AUTH_KEY=" | ||
- | CODEC=S16 | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | |||
- | [Rx1] | ||
- | TYPE=Local | ||
- | AUDIO_DEV=alsa: | ||
- | AUDIO_CHANNEL=0 | ||
- | SQL_DET=CTCSS | ||
- | SQL_START_DELAY=0 | ||
- | SQL_DELAY=0 | ||
- | SQL_HANGTIME=200 | ||
- | # | ||
- | # | ||
- | # | ||
- | VOX_FILTER_DEPTH=20 | ||
- | VOX_THRESH=1000 | ||
- | # | ||
- | CTCSS_FQ=77.0 | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | HID_DEVICE=/ | ||
- | HID_SQL_PIN=!VOL_DN | ||
- | # | ||
- | SIGLEV_SLOPE=1 | ||
- | SIGLEV_OFFSET=0 | ||
- | # | ||
- | # | ||
- | SIGLEV_OPEN_THRESH=30 | ||
- | SIGLEV_CLOSE_THRESH=10 | ||
- | DEEMPHASIS=1 | ||
- | # | ||
- | PREAMP=-0.5 | ||
- | # | ||
- | DTMF_DEC_TYPE=INTERNAL | ||
- | DTMF_MUTING=1 | ||
- | DTMF_HANGTIME=40 | ||
- | DTMF_SERIAL=/ | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | #WBRX=WbRx1 | ||
- | |||
- | [WbRx1] | ||
- | # | ||
- | # | ||
- | # | ||
- | #PORT=1234 | ||
- | # | ||
- | #FQ_CORR=0 | ||
- | #GAIN=0 | ||
- | # | ||
- | # | ||
- | |||
- | [Tx1] | ||
- | TYPE=Local | ||
- | AUDIO_DEV=alsa: | ||
- | AUDIO_CHANNEL=0 | ||
- | PTT_TYPE=Hidraw | ||
- | # | ||
- | # | ||
- | HID_DEVICE=/ | ||
- | HID_PTT_PIN=GPIO3 | ||
- | # | ||
- | # | ||
- | # | ||
- | TIMEOUT=300 | ||
- | TX_DELAY=500 | ||
- | CTCSS_FQ=77.0 | ||
- | CTCSS_LEVEL=20 | ||
- | PREEMPHASIS=1 | ||
- | DTMF_TONE_LENGTH=100 | ||
- | DTMF_TONE_SPACING=50 | ||
- | DTMF_DIGIT_PWR=-15 | ||
- | MASTER_GAIN=-3.5 | ||
- | |||
- | [LocationInfo] | ||
- | APRS_SERVER_LIST=euro.aprs2.net: | ||
- | STATUS_SERVER_LIST=aprs.echolink.org: | ||
- | LON_POSITION=1.25.30W | ||
- | LAT_POSITION=60.17.18N | ||
- | CALLSIGN=EL-MB7AZE | ||
- | FREQUENCY=430.050 | ||
- | TX_POWER=1 | ||
- | ANTENNA_GAIN=0 | ||
- | ANTENNA_HEIGHT=1m | ||
- | ANTENNA_DIR=-1 | ||
- | # | ||
- | BEACON_INTERVAL=60 | ||
- | TONE=77 | ||
- | COMMENT=Connected to UK Svx Reflector | ||
- | |||
- | [Macros] | ||
- | 1=EchoLink: | ||
- | 2=EchoLink: | ||
- | 3=EchoLink: | ||
- | 4=:91235# | ||
- | 5=:9123561# | ||
- | 9=:910# | ||
- | |||
- | </ | ||
- | ++++ | ||
- | |||
- | ===== Audio levels ===== | ||
- | |||
- | ==== Devcal ==== | ||
- | |||
- | Use the '' | ||
- | |||
- | This allows adjustment of '' | ||
- | |||
- | Once the correct '' | ||
- | |||
- | To use '' | ||
- | |||
- | === For Receive audio input: === | ||
- | |||
- | <code bash> | ||
- | sudo devcal -r -m=3000 -d=3000 / | ||
- | </ | ||
- | |||
- | Inject a signal to the radio @ ±3kHz deviation Adjust audio input level via | ||
- | |||
- | * radio volume control | ||
- | * alsamixer Mic Capture level | ||
- | * devcal +/- to adjust PRE-AMP setting | ||
- | |||
- | until the displayed deviation agrees with the input signal' | ||
- | |||
- | **Q**uit '' | ||
- | |||
- | Transfer the displayed '' | ||
- | |||
- | === For Transmit audio output === | ||
- | |||
- | Monitor TX deviation | ||
- | |||
- | <code bash> | ||
- | sudo devcal -t -m=3000 -d=3000 / | ||
- | </ | ||
- | |||
- | Toggle TX with '' | ||
- | |||
- | Adjust | ||
- | |||
- | * Alsamixer output | ||
- | * devcal +/- | ||
- | |||
- | to achieve ±3kHz TX deviation. | ||
- | |||
- | Turn off TX with '' | ||
- | |||
- | **Q**uit '' | ||
- | |||
- | Copy the displayed '' | ||
- | |||
- | <code bash> | ||
- | sudo alsactl store | ||
- | </ | ||
- | |||
- | to save current mixer levels. | ||
- | |||
- | |||
- | ===== To prevent Echolink incoming connections while a Talkgroup is active ===== | ||
- | |||
- | Uncomment : | ||
- | |||
- | <code tcl> | ||
- | proc tg_selected {new_tg old_tg} { | ||
- | puts "### tg_selected #$new_tg (old # | ||
- | # Reject incoming Echolink connections while a talkgroup is active | ||
- | if {$new_tg != 0} { | ||
- | setConfigValue " | ||
- | } else { | ||
- | setConfigValue " | ||
- | } | ||
- | } | ||
- | |||
- | </ | ||
- | |||
- | in ''/ | ||
- | |||
- | |||
- | ===== < | ||
- | |||
- | Here are the 3 files containing tweaks to the standard behaviour. | ||
- | |||
- | Editing the original files (in '' | ||
- | |||
- | The actual path is: | ||
- | |||
- | ''/ | ||
- | |||
- | |||
- | I'll try to document what is different once I refresh my memory. | ||
- | |||
- | ++++ ReflectorLogic.tcl | | ||
- | |||
- | <code tcl> | ||
- | ############################################################################### | ||
- | # | ||
- | # ReflectorLogic event handlers | ||
- | # | ||
- | ############################################################################### | ||
- | |||
- | # | ||
- | # This is the namespace in which all functions below will exist. The name | ||
- | # must match the corresponding section " | ||
- | # file. The name may be changed but it must be changed in both places. | ||
- | # | ||
- | namespace eval ReflectorLogic { | ||
- | |||
- | # The currently selected TG. Variable set from application. | ||
- | variable selected_tg 0 | ||
- | |||
- | # The previously selected TG. Variable set from application. | ||
- | variable previous_tg 0 | ||
- | |||
- | # Timestamp for previous TG announcement | ||
- | variable prev_announce_time 0 | ||
- | |||
- | # The previously announced TG | ||
- | variable prev_announce_tg 0 | ||
- | |||
- | # The minimum time between announcements of the same TG. | ||
- | # Change through ANNOUNCE_REMOTE_MIN_INTERVAL config variable. | ||
- | variable announce_remote_min_interval 0 | ||
- | |||
- | # This variable will be set to 1 if the QSY pending feature ("QSY on squelch | ||
- | # activity" | ||
- | variable qsy_pending_active 0 | ||
- | |||
- | # | ||
- | # Checking to see if this is the correct logic core | ||
- | # | ||
- | if {$logic_name != [namespace tail [namespace current]]} { | ||
- | return; | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when an unknown command is received | ||
- | # cmd - The command string | ||
- | # | ||
- | proc unknown_command {cmd} { | ||
- | Logic:: | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a received command fails | ||
- | # | ||
- | proc command_failed {cmd} { | ||
- | Logic:: | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when manual TG announcement is triggered | ||
- | # | ||
- | proc report_tg_status {} { | ||
- | variable selected_tg | ||
- | variable previous_tg | ||
- | variable prev_announce_time | ||
- | variable prev_announce_tg | ||
- | playSilence 100 | ||
- | if {$selected_tg > 0} { | ||
- | set prev_announce_time [clock seconds] | ||
- | set prev_announce_tg $selected_tg | ||
- | playMsg " | ||
- | spellNumber $selected_tg | ||
- | } else { | ||
- | playMsg " | ||
- | playMsg " | ||
- | spellNumber $previous_tg | ||
- | } | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a TG has been selected | ||
- | # This function is called immediately when a change in talkgroup selection | ||
- | # occurs. In constrast, the other more specific talkgroup selection event | ||
- | # functions below is called with a delay in order to make announcement ordering | ||
- | # more logical. | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | proc tg_selected {new_tg old_tg} { | ||
- | puts "### tg_selected #$new_tg (old # | ||
- | # Reject incoming Echolink connections while a talkgroup is active | ||
- | if {$new_tg != 0} { | ||
- | setConfigValue " | ||
- | } else { | ||
- | setConfigValue " | ||
- | } | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a TG has been selected due to local activity | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | proc tg_local_activation {new_tg old_tg} { | ||
- | variable prev_announce_time | ||
- | variable prev_announce_tg | ||
- | variable selected_tg | ||
- | |||
- | puts "### tg_local_activation" | ||
- | if {$new_tg != $old_tg} { | ||
- | set prev_announce_time [clock seconds] | ||
- | set prev_announce_tg $new_tg | ||
- | playSilence 100 | ||
- | playMsg " | ||
- | spellNumber $new_tg | ||
- | } | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a TG has been selected due to remote activity | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | proc tg_remote_activation {new_tg old_tg} { | ||
- | variable prev_announce_time | ||
- | variable prev_announce_tg | ||
- | variable announce_remote_min_interval | ||
- | |||
- | puts "### tg_remote_activation" | ||
- | set now [clock seconds]; | ||
- | if {($new_tg == $prev_announce_tg) && \ | ||
- | ($now - $prev_announce_time < $announce_remote_min_interval)} { | ||
- | return; | ||
- | } | ||
- | if {$new_tg != $old_tg} { | ||
- | set prev_announce_time $now | ||
- | set prev_announce_tg $new_tg | ||
- | playSilence 100 | ||
- | playMsg " | ||
- | spellNumber $new_tg | ||
- | } | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a TG has been selected due to remote activity on a prioritized | ||
- | # monitored talk group while a lower prio talk group is selected | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | proc tg_remote_prio_activation {new_tg old_tg} { | ||
- | tg_remote_activation $new_tg $old_tg | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a TG has been selected by DTMF command | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | proc tg_command_activation {new_tg old_tg} { | ||
- | variable prev_announce_time | ||
- | variable prev_announce_tg | ||
- | |||
- | puts "### tg_command_activation" | ||
- | set prev_announce_time [clock seconds] | ||
- | set prev_announce_tg $new_tg | ||
- | playSilence 100 | ||
- | playMsg " | ||
- | spellNumber $new_tg | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a TG has been selected due to DEFAULT_TG configuration | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | proc tg_default_activation {new_tg old_tg} { | ||
- | #variable prev_announce_time | ||
- | #variable prev_announce_tg | ||
- | #variable selected_tg | ||
- | puts "### tg_default_activation" | ||
- | #if {$new_tg != $old_tg} { | ||
- | # set prev_announce_time [clock seconds] | ||
- | # set prev_announce_tg $new_tg | ||
- | # playSilence 100 | ||
- | # playMsg " | ||
- | # spellNumber $new_tg | ||
- | #} | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a TG QSY request have been acted upon | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | proc tg_qsy {new_tg old_tg} { | ||
- | variable prev_announce_time | ||
- | variable prev_announce_tg | ||
- | |||
- | puts "### tg_qsy" | ||
- | set prev_announce_time [clock seconds] | ||
- | set prev_announce_tg $new_tg | ||
- | playSilence 100 | ||
- | playMsg " | ||
- | #playMsg " | ||
- | spellNumber $new_tg | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a QSY is followed due to squelch open (see QSY_PENDING_TIMEOUT) | ||
- | # | ||
- | # tg -- The talk group that has been activated | ||
- | # | ||
- | proc tg_qsy_on_sql {tg} { | ||
- | playSilence 100 | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a TG QSY request fails | ||
- | # | ||
- | # A TG QSY may fail for primarily two reasons, either no talk group is | ||
- | # currently active or there is no connection to the reflector server. | ||
- | # | ||
- | proc tg_qsy_failed {} { | ||
- | puts "### tg_qsy_failed" | ||
- | playSilence 100 | ||
- | playMsg " | ||
- | playSilence 200 | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a TG QSY request is pending | ||
- | # | ||
- | # tg -- The talk group requested in the QSY | ||
- | # | ||
- | proc tg_qsy_pending {tg} { | ||
- | playSilence 100 | ||
- | playMsg " | ||
- | spellNumber $tg | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a TG QSY request is ignored | ||
- | # | ||
- | # tg -- The talk group requested in the QSY | ||
- | # | ||
- | proc tg_qsy_ignored {tg} { | ||
- | variable qsy_pending_active | ||
- | playSilence 100 | ||
- | if {!$qsy_pending_active} { | ||
- | playMsg " | ||
- | spellNumber $tg | ||
- | } | ||
- | playMsg " | ||
- | playSilence 500 | ||
- | playTone 880 200 50 | ||
- | playTone 659 200 50 | ||
- | playTone 440 200 50 | ||
- | playSilence 100 | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a TG selection has timed out | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | proc tg_selection_timeout {new_tg old_tg} { | ||
- | puts "### tg_selection_timeout" | ||
- | if {$old_tg != 0} { | ||
- | playSilence 50 | ||
- | playTone 880 200 50 | ||
- | playTone 659 200 50 | ||
- | playTone 440 200 50 | ||
- | playSilence 50 | ||
- | # } else { | ||
- | # playSilence 50 | ||
- | # playTone 440 200 150 | ||
- | # playSilence 50 | ||
- | |||
- | } | ||
- | } | ||
- | |||
- | # | ||
- | # Executed on talker start | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | proc talker_start {tg callsign} { | ||
- | #puts "### Talker DID start on TG #$tg: $callsign" | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed on talker stop | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | proc talker_stop {tg callsign} { | ||
- | variable selected_tg | ||
- | variable :: | ||
- | #puts "### Talker DID stop on TG #$tg: $callsign" | ||
- | if {($tg == $selected_tg) && ($callsign != $:: | ||
- | playSilence 100 | ||
- | playTone 440 200 50 | ||
- | playTone 659 200 50 | ||
- | playTone 880 200 50 | ||
- | playSilence 100 | ||
- | } | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # A talk group was added for temporary monitoring | ||
- | # | ||
- | # tg -- The added talk group | ||
- | # | ||
- | proc tmp_monitor_add {tg} { | ||
- | puts "### tmp_monitor_add: | ||
- | playSilence 50 | ||
- | playMsg " | ||
- | playMsg " | ||
- | spellNumber $tg | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # A talk group was removed from temporary monitoring | ||
- | # | ||
- | # tg -- The removed talk group | ||
- | # | ||
- | proc tmp_monitor_remove {tg} { | ||
- | puts "### tmp_monitor_remove: | ||
- | playSilence 50 | ||
- | playMsg " | ||
- | playMsg " | ||
- | spellNumber $tg | ||
- | } | ||
- | |||
- | |||
- | if [info exists :: | ||
- | set announce_remote_min_interval $:: | ||
- | } | ||
- | |||
- | if [info exists :: | ||
- | if {$:: | ||
- | set qsy_pending_active 1 | ||
- | } | ||
- | } | ||
- | |||
- | |||
- | # end of namespace | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # This file has not been truncated | ||
- | # | ||
- | </ | ||
- | |||
- | ++++ | ||
- | |||
- | ++++ Logic.tcl | | ||
- | |||
- | <code tcl> | ||
- | ############################################################################### | ||
- | # | ||
- | # Generic Logic event handlers | ||
- | # | ||
- | ############################################################################### | ||
- | |||
- | # | ||
- | # This is the namespace in which all functions and variables below will exist. | ||
- | # | ||
- | namespace eval Logic { | ||
- | |||
- | |||
- | # | ||
- | # A variable used to store a timestamp for the last identification. | ||
- | # | ||
- | variable prev_ident 0; | ||
- | |||
- | # | ||
- | # A constant that indicates the minimum time in seconds to wait between two | ||
- | # identifications. Manual and long identifications is not affected. | ||
- | # | ||
- | variable min_time_between_ident 120; | ||
- | |||
- | # | ||
- | # Short and long identification intervals. They are setup from config | ||
- | # variables below. | ||
- | # | ||
- | variable short_ident_interval 0; | ||
- | variable long_ident_interval 0; | ||
- | |||
- | variable short_voice_id_enable | ||
- | variable short_cw_id_enable | ||
- | variable short_announce_enable | ||
- | variable short_announce_file | ||
- | |||
- | variable long_voice_id_enable | ||
- | variable long_cw_id_enable | ||
- | variable long_announce_enable | ||
- | variable long_announce_file | ||
- | |||
- | # | ||
- | # The ident_only_after_tx variable indicates if identification is only to | ||
- | # occur after the node has transmitted. The variable is setup below from the | ||
- | # configuration variable with the same name. | ||
- | # The need_ident variable indicates if identification is needed. | ||
- | # | ||
- | variable ident_only_after_tx 0; | ||
- | variable need_ident 0; | ||
- | |||
- | # | ||
- | # List of functions that should be called periodically. Use the | ||
- | # addMinuteTickSubscriber and addSecondTickSubscriber functions to | ||
- | # add subscribers. | ||
- | # | ||
- | variable minute_tick_subscribers [list]; | ||
- | variable second_tick_subscribers [list]; | ||
- | |||
- | # | ||
- | # Contains the ID of the last receiver that indicated squelch activity | ||
- | # | ||
- | variable sql_rx_id "?"; | ||
- | |||
- | # | ||
- | # Executed when the SvxLink software is started | ||
- | # | ||
- | proc startup {} { | ||
- | #playMsg " | ||
- | # | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a specified module could not be found | ||
- | # | ||
- | # | ||
- | proc no_such_module {module_id} { | ||
- | playMsg " | ||
- | playNumber $module_id; | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a manual identification is initiated with the * DTMF code | ||
- | # | ||
- | proc manual_identification {} { | ||
- | global mycall; | ||
- | global report_ctcss; | ||
- | global active_module; | ||
- | global loaded_modules; | ||
- | variable CFG_TYPE; | ||
- | variable prev_ident; | ||
- | |||
- | set epoch [clock seconds]; | ||
- | set hour [clock format $epoch -format " | ||
- | regexp {([1-5]? | ||
- | set prev_ident $epoch; | ||
- | |||
- | playMsg " | ||
- | spellWord $mycall; | ||
- | if {$CFG_TYPE == " | ||
- | playMsg " | ||
- | } | ||
- | playSilence 250; | ||
- | playMsg " | ||
- | playTime $hour $minute; | ||
- | playSilence 250; | ||
- | if {$report_ctcss > 0} { | ||
- | playMsg " | ||
- | playFrequency $report_ctcss | ||
- | playSilence 300; | ||
- | } | ||
- | if {$active_module != "" | ||
- | playMsg " | ||
- | playMsg $active_module " | ||
- | playSilence 250; | ||
- | set func "::"; | ||
- | append func $active_module ":: | ||
- | if {" | ||
- | $func; | ||
- | } | ||
- | } else { | ||
- | foreach module [split $loaded_modules " "] { | ||
- | set func "::"; | ||
- | append func $module ":: | ||
- | if {" | ||
- | $func; | ||
- | } | ||
- | } | ||
- | } | ||
- | #playMsg " | ||
- | # | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a short identification should be sent | ||
- | # | ||
- | # | ||
- | # | ||
- | proc send_short_ident {{hour -1} {minute -1}} { | ||
- | global mycall; | ||
- | variable CFG_TYPE; | ||
- | variable short_announce_file | ||
- | variable short_announce_enable | ||
- | variable short_voice_id_enable | ||
- | variable short_cw_id_enable | ||
- | |||
- | # Play voice id if enabled | ||
- | if {$short_voice_id_enable} { | ||
- | puts " | ||
- | spellWord $mycall; | ||
- | if {$CFG_TYPE == " | ||
- | playMsg " | ||
- | } | ||
- | playSilence 500; | ||
- | } | ||
- | |||
- | # Play announcement file if enabled | ||
- | if {$short_announce_enable} { | ||
- | puts " | ||
- | if [file exist " | ||
- | playFile " | ||
- | playSilence 500 | ||
- | } | ||
- | } | ||
- | |||
- | # Play CW id if enabled | ||
- | if {$short_cw_id_enable} { | ||
- | puts " | ||
- | if {$CFG_TYPE == " | ||
- | set call " | ||
- | CW::play $call | ||
- | } else { | ||
- | CW::play $mycall | ||
- | } | ||
- | playSilence 500; | ||
- | } | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a long identification (e.g. hourly) should be sent | ||
- | # | ||
- | # | ||
- | # | ||
- | proc send_long_ident {hour minute} { | ||
- | global mycall; | ||
- | global loaded_modules; | ||
- | global active_module; | ||
- | variable CFG_TYPE; | ||
- | variable long_announce_file | ||
- | variable long_announce_enable | ||
- | variable long_voice_id_enable | ||
- | variable long_cw_id_enable | ||
- | |||
- | # Play the voice ID if enabled | ||
- | if {$long_voice_id_enable} { | ||
- | puts " | ||
- | spellWord $mycall; | ||
- | if {$CFG_TYPE == " | ||
- | playMsg " | ||
- | } | ||
- | playSilence 500; | ||
- | playMsg " | ||
- | playSilence 100; | ||
- | playTime $hour $minute; | ||
- | playSilence 500; | ||
- | |||
- | # Call the " | ||
- | if {$active_module == "" | ||
- | foreach module [split $loaded_modules " "] { | ||
- | set func "::"; | ||
- | append func $module ":: | ||
- | if {" | ||
- | $func; | ||
- | } | ||
- | } | ||
- | } | ||
- | |||
- | playSilence 500; | ||
- | } | ||
- | |||
- | # Play announcement file if enabled | ||
- | if {$long_announce_enable} { | ||
- | puts " | ||
- | if [file exist " | ||
- | playFile " | ||
- | playSilence 500 | ||
- | } | ||
- | } | ||
- | |||
- | # Play CW id if enabled | ||
- | if {$long_cw_id_enable} { | ||
- | puts " | ||
- | if {$CFG_TYPE == " | ||
- | set call " | ||
- | CW::play $call | ||
- | } else { | ||
- | CW::play $mycall | ||
- | } | ||
- | playSilence 100 | ||
- | } | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when the squelch have just closed and the RGR_SOUND_DELAY timer has | ||
- | # expired. | ||
- | # | ||
- | proc send_rgr_sound {} { | ||
- | variable sql_rx_id | ||
- | |||
- | if {$sql_rx_id != "?" | ||
- | # 150 CPM, 1000 Hz, -4 dBFS | ||
- | CW::play $sql_rx_id 150 1000 -4 | ||
- | set sql_rx_id "?" | ||
- | } else { | ||
- | playTone 440 500 100 | ||
- | } | ||
- | playSilence 100 | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when an empty macro command (i.e. D#) has been entered. | ||
- | # | ||
- | proc macro_empty {} { | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when an entered macro command could not be found | ||
- | # | ||
- | proc macro_not_found {} { | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a macro syntax error occurs (configuration error). | ||
- | # | ||
- | proc macro_syntax_error {} { | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when the specified module in a macro command is not found | ||
- | # (configuration error). | ||
- | # | ||
- | proc macro_module_not_found {} { | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when the activation of the module specified in the macro command | ||
- | # failed. | ||
- | # | ||
- | proc macro_module_activation_failed {} { | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a macro command is executed that requires a module to | ||
- | # be activated but another module is already active. | ||
- | # | ||
- | proc macro_another_active_module {} { | ||
- | global active_module; | ||
- | |||
- | playMsg " | ||
- | playMsg " | ||
- | playMsg $active_module " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when an unknown DTMF command is entered | ||
- | # cmd - The command string | ||
- | # | ||
- | proc unknown_command {cmd} { | ||
- | spellWord $cmd; | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when an entered DTMF command failed | ||
- | # cmd - The command string | ||
- | # | ||
- | proc command_failed {cmd} { | ||
- | spellWord $cmd; | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a link to another logic core is activated. | ||
- | # | ||
- | # | ||
- | proc activating_link {name} { | ||
- | if {[string length $name] > 0} { | ||
- | playMsg " | ||
- | spellWord $name; | ||
- | } | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a link to another logic core is deactivated. | ||
- | # | ||
- | # | ||
- | proc deactivating_link {name} { | ||
- | if {[string length $name] > 0} { | ||
- | playMsg " | ||
- | spellWord $name; | ||
- | } | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when trying to deactivate a link to another logic core but the | ||
- | # link is not currently active. | ||
- | # | ||
- | # | ||
- | proc link_not_active {name} { | ||
- | if {[string length $name] > 0} { | ||
- | playMsg " | ||
- | spellWord $name; | ||
- | } | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when trying to activate a link to another logic core but the | ||
- | # link is already active. | ||
- | # | ||
- | # | ||
- | proc link_already_active {name} { | ||
- | if {[string length $name] > 0} { | ||
- | playMsg " | ||
- | spellWord $name; | ||
- | } | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed each time the transmitter is turned on or off | ||
- | # is_on - Set to 1 if the transmitter is on or 0 if it's off | ||
- | # | ||
- | proc transmit {is_on} { | ||
- | #puts " | ||
- | variable prev_ident; | ||
- | variable need_ident; | ||
- | if {$is_on && ([clock seconds] - $prev_ident > 5)} { | ||
- | set need_ident 1; | ||
- | } | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed each time the squelch is opened or closed | ||
- | # | ||
- | # | ||
- | # | ||
- | proc squelch_open {rx_id is_open} { | ||
- | variable sql_rx_id; | ||
- | #puts "The squelch is $is_open on RX $rx_id"; | ||
- | set sql_rx_id $rx_id; | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a DTMF digit has been received | ||
- | # | ||
- | # | ||
- | # | ||
- | # Return 1 to hide the digit from further processing in SvxLink or | ||
- | # return 0 to make SvxLink continue processing as normal. | ||
- | # | ||
- | proc dtmf_digit_received {digit duration} { | ||
- | #puts "DTMF digit \" | ||
- | return 0; | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a DTMF command has been received | ||
- | # cmd - The command | ||
- | # | ||
- | # Return 1 to hide the command from further processing is SvxLink or | ||
- | # return 0 to make SvxLink continue processing as normal. | ||
- | # | ||
- | # This function can be used to implement your own custom commands or to disable | ||
- | # DTMF commands that you do not want users to execute. | ||
- | proc dtmf_cmd_received {cmd} { | ||
- | #global active_module | ||
- | |||
- | # Example: Ignore all commands starting with 3 in the EchoLink module. | ||
- | # Allow commands that have four or more digits. | ||
- | #if {$active_module == " | ||
- | # if {[string length $cmd] < 4 && [string index $cmd 0] == " | ||
- | # puts " | ||
- | # return 1 | ||
- | # } | ||
- | #} | ||
- | |||
- | # Handle the "force core command" | ||
- | # executed by the core command processor instead of by an active module. | ||
- | # The "force core command" | ||
- | #if {$active_module != "" | ||
- | # return 0 | ||
- | #} | ||
- | #if {[string index $cmd 0] == " | ||
- | # set cmd [string range $cmd 1 end] | ||
- | #} | ||
- | |||
- | # Example: Custom command executed when DTMF 99 is received | ||
- | #if {$cmd == " | ||
- | # puts " | ||
- | # playMsg " | ||
- | # exec ls & | ||
- | # return 1 | ||
- | #} | ||
- | |||
- | return 0 | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed once every whole minute. Don't put any code here directly | ||
- | # Create a new function and add it to the timer tick subscriber list | ||
- | # by using the function addMinuteTickSubscriber. | ||
- | # | ||
- | proc every_minute {} { | ||
- | variable minute_tick_subscribers; | ||
- | #puts [clock format [clock seconds] -format " | ||
- | foreach subscriber $minute_tick_subscribers { | ||
- | $subscriber; | ||
- | } | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed once every whole minute. Don't put any code here directly | ||
- | # Create a new function and add it to the timer tick subscriber list | ||
- | # by using the function addSecondTickSubscriber. | ||
- | # | ||
- | proc every_second {} { | ||
- | variable second_tick_subscribers; | ||
- | #puts [clock format [clock seconds] -format " | ||
- | foreach subscriber $second_tick_subscribers { | ||
- | $subscriber; | ||
- | } | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Deprecated: Use the addMinuteTickSubscriber function instead | ||
- | # | ||
- | proc addTimerTickSubscriber {func} { | ||
- | puts "*** WARNING: Calling deprecated TCL event handler addTimerTickSubcriber." | ||
- | puts " | ||
- | addMinuteTickSubscriber $func; | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Use this function to add a function to the list of functions that | ||
- | # should be executed once every whole minute. This is not an event | ||
- | # function but rather a management function. | ||
- | # | ||
- | proc addMinuteTickSubscriber {func} { | ||
- | variable minute_tick_subscribers; | ||
- | lappend minute_tick_subscribers $func; | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Use this function to add a function to the list of functions that | ||
- | # should be executed once every second. This is not an event | ||
- | # function but rather a management function. | ||
- | # | ||
- | proc addSecondTickSubscriber {func} { | ||
- | variable second_tick_subscribers; | ||
- | lappend second_tick_subscribers $func; | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Should be executed once every whole minute to check if it is time to | ||
- | # identify. Not exactly an event function. This function handle the | ||
- | # identification logic and call the send_short_ident or send_long_ident | ||
- | # functions when it is time to identify. | ||
- | # | ||
- | proc checkPeriodicIdentify {} { | ||
- | variable prev_ident; | ||
- | variable short_ident_interval; | ||
- | variable long_ident_interval; | ||
- | variable min_time_between_ident; | ||
- | variable ident_only_after_tx; | ||
- | variable need_ident; | ||
- | global logic_name; | ||
- | |||
- | if {$short_ident_interval == 0} { | ||
- | return; | ||
- | } | ||
- | |||
- | set now [clock seconds]; | ||
- | set hour [clock format $now -format " | ||
- | regexp {([1-5]? | ||
- | |||
- | set short_ident_now \ | ||
- | [expr {($hour * 60 + $minute) % $short_ident_interval == 0}]; | ||
- | set long_ident_now 0; | ||
- | if {$long_ident_interval != 0} { | ||
- | set long_ident_now \ | ||
- | [expr {($hour * 60 + $minute) % $long_ident_interval == 0}]; | ||
- | } | ||
- | |||
- | if {$long_ident_now} { | ||
- | puts " | ||
- | send_long_ident $hour $minute; | ||
- | set prev_ident $now; | ||
- | set need_ident 0; | ||
- | } else { | ||
- | if {$now - $prev_ident < $min_time_between_ident} { | ||
- | return; | ||
- | } | ||
- | if {$ident_only_after_tx && !$need_ident} { | ||
- | return; | ||
- | } | ||
- | |||
- | if {$short_ident_now} { | ||
- | puts " | ||
- | send_short_ident $hour $minute; | ||
- | set prev_ident $now; | ||
- | set need_ident 0; | ||
- | } | ||
- | } | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when the QSO recorder is being activated | ||
- | # | ||
- | proc activating_qso_recorder {} { | ||
- | playMsg " | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when the QSO recorder is being deactivated | ||
- | # | ||
- | proc deactivating_qso_recorder {} { | ||
- | playMsg " | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when trying to deactivate the QSO recorder even though it's | ||
- | # not active | ||
- | # | ||
- | proc qso_recorder_not_active {} { | ||
- | playMsg " | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when trying to activate the QSO recorder even though it's | ||
- | # already active | ||
- | # | ||
- | proc qso_recorder_already_active {} { | ||
- | playMsg " | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when the timeout kicks in to activate the QSO recorder | ||
- | # | ||
- | proc qso_recorder_timeout_activate {} { | ||
- | playMsg " | ||
- | playMsg " | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when the timeout kicks in to deactivate the QSO recorder | ||
- | # | ||
- | proc qso_recorder_timeout_deactivate {} { | ||
- | playMsg " | ||
- | playMsg " | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when the user is requesting a language change | ||
- | # | ||
- | proc set_language {lang_code} { | ||
- | global logic_name; | ||
- | puts " | ||
- | |||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when the user requests a list of available languages | ||
- | # | ||
- | proc list_languages {} { | ||
- | global logic_name; | ||
- | puts " | ||
- | |||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when the node is being brought online or offline | ||
- | # | ||
- | proc logic_online {online} { | ||
- | global mycall | ||
- | variable CFG_TYPE | ||
- | |||
- | if {$online} { | ||
- | playMsg " | ||
- | spellWord $mycall; | ||
- | if {$CFG_TYPE == " | ||
- | playMsg " | ||
- | } | ||
- | } | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a configuration variable is updated at runtime in the logic | ||
- | # core | ||
- | # | ||
- | proc config_updated {tag value} { | ||
- | #puts " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a DTMF command is received from another linked logic core | ||
- | # | ||
- | # logic -- The name of the logic core | ||
- | # | ||
- | # | ||
- | proc remote_cmd_received {logic cmd} { | ||
- | #puts " | ||
- | #playDtmf " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a talkgroup is received from another linked logic core | ||
- | # | ||
- | # logic -- The name of the logic core | ||
- | # | ||
- | # | ||
- | proc remote_received_tg_updated {logic tg} { | ||
- | #puts " | ||
- | #if {$tg > 0} { | ||
- | # playDtmf " | ||
- | #} | ||
- | } | ||
- | |||
- | |||
- | ############################################################################## | ||
- | # | ||
- | # Main program | ||
- | # | ||
- | ############################################################################## | ||
- | |||
- | if [info exists CFG_SHORT_IDENT_INTERVAL] { | ||
- | if {$CFG_SHORT_IDENT_INTERVAL > 0} { | ||
- | set short_ident_interval $CFG_SHORT_IDENT_INTERVAL; | ||
- | } | ||
- | } | ||
- | |||
- | if [info exists CFG_LONG_IDENT_INTERVAL] { | ||
- | if {$CFG_LONG_IDENT_INTERVAL > 0} { | ||
- | set long_ident_interval $CFG_LONG_IDENT_INTERVAL; | ||
- | if {$short_ident_interval == 0} { | ||
- | set short_ident_interval $long_ident_interval; | ||
- | } | ||
- | } | ||
- | } | ||
- | |||
- | if [info exists CFG_IDENT_ONLY_AFTER_TX] { | ||
- | if {$CFG_IDENT_ONLY_AFTER_TX > 0} { | ||
- | set ident_only_after_tx $CFG_IDENT_ONLY_AFTER_TX; | ||
- | } | ||
- | } | ||
- | |||
- | if [info exists CFG_SHORT_ANNOUNCE_ENABLE] { | ||
- | set short_announce_enable $CFG_SHORT_ANNOUNCE_ENABLE | ||
- | } | ||
- | |||
- | if [info exists CFG_SHORT_ANNOUNCE_FILE] { | ||
- | set short_announce_file $CFG_SHORT_ANNOUNCE_FILE | ||
- | } | ||
- | |||
- | if [info exists CFG_SHORT_VOICE_ID_ENABLE] { | ||
- | set short_voice_id_enable $CFG_SHORT_VOICE_ID_ENABLE | ||
- | } | ||
- | |||
- | if [info exists CFG_SHORT_CW_ID_ENABLE] { | ||
- | set short_cw_id_enable $CFG_SHORT_CW_ID_ENABLE | ||
- | } | ||
- | |||
- | if [info exists CFG_LONG_ANNOUNCE_ENABLE] { | ||
- | set long_announce_enable $CFG_LONG_ANNOUNCE_ENABLE | ||
- | } | ||
- | |||
- | if [info exists CFG_LONG_ANNOUNCE_FILE] { | ||
- | set long_announce_file $CFG_LONG_ANNOUNCE_FILE | ||
- | } | ||
- | |||
- | if [info exists CFG_LONG_VOICE_ID_ENABLE] { | ||
- | set long_voice_id_enable $CFG_LONG_VOICE_ID_ENABLE | ||
- | } | ||
- | |||
- | if [info exists CFG_LONG_CW_ID_ENABLE] { | ||
- | set long_cw_id_enable $CFG_LONG_CW_ID_ENABLE | ||
- | } | ||
- | |||
- | |||
- | # end of namespace | ||
- | } | ||
- | |||
- | # | ||
- | # This file has not been truncated | ||
- | # | ||
- | </ | ||
- | ++++ | ||
- | |||
- | ++++ EchoLink.tcl | | ||
- | |||
- | <code tcl> | ||
- | ############################################################################### | ||
- | # | ||
- | # EchoLink module event handlers | ||
- | # | ||
- | ############################################################################### | ||
- | |||
- | # | ||
- | # This is the namespace in which all functions and variables below will exist. | ||
- | # The name must match the configuration variable " | ||
- | # [ModuleEchoLink] section in the configuration file. The name may be changed | ||
- | # but it must be changed in both places. | ||
- | # | ||
- | namespace eval EchoLink { | ||
- | |||
- | # | ||
- | # Check if this module is loaded in the current logic core | ||
- | # | ||
- | if {![info exists CFG_ID]} { | ||
- | return; | ||
- | } | ||
- | |||
- | # | ||
- | # Extract the module name from the current namespace | ||
- | # | ||
- | set module_name [namespace tail [namespace current]]; | ||
- | |||
- | # | ||
- | # An " | ||
- | # as the first argument. | ||
- | # | ||
- | proc playMsg {msg} { | ||
- | variable module_name; | ||
- | ::playMsg $module_name $msg; | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # A convenience function for printing out information prefixed by the | ||
- | # module name | ||
- | # | ||
- | proc printInfo {msg} { | ||
- | variable module_name; | ||
- | puts " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # This variable is updated by the EchoLink module when a station connects or | ||
- | # disconnects. It contains the number of currently connected stations. | ||
- | # | ||
- | variable num_connected_stations 0; | ||
- | |||
- | |||
- | # | ||
- | # Executed when this module is being activated | ||
- | # | ||
- | proc activating_module {} { | ||
- | variable module_name; | ||
- | Module:: | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when this module is being deactivated. | ||
- | # | ||
- | proc deactivating_module {} { | ||
- | variable module_name; | ||
- | Module:: | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when the inactivity timeout for this module has expired. | ||
- | # | ||
- | proc timeout {} { | ||
- | variable module_name; | ||
- | Module:: | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when playing of the help message for this module has been requested. | ||
- | # | ||
- | proc play_help {} { | ||
- | variable module_name; | ||
- | Module:: | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Spell an EchoLink callsign | ||
- | # | ||
- | proc spellEchoLinkCallsign {call} { | ||
- | global langdir | ||
- | if [regexp {^(\w+)-L$} $call ignored callsign] { | ||
- | spellWord $callsign | ||
- | playSilence 50 | ||
- | playMsg " | ||
- | } elseif [regexp {^(\w+)-R$} $call ignored callsign] { | ||
- | spellWord $callsign | ||
- | playSilence 50 | ||
- | playMsg " | ||
- | } elseif [regexp {^\*(.+)\*$} $call ignored name] { | ||
- | playMsg " | ||
- | playSilence 50 | ||
- | set lc_name [string tolower $name] | ||
- | if [file exists " | ||
- | playFile " | ||
- | } else { | ||
- | spellEchoLinkCallsign $name | ||
- | } | ||
- | } else { | ||
- | spellWord $call | ||
- | } | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a request to list all connected stations is received. | ||
- | # That is, someone press DTMF " | ||
- | # | ||
- | proc list_connected_stations {connected_stations} { | ||
- | playNumber [llength $connected_stations]; | ||
- | playSilence 50; | ||
- | playMsg " | ||
- | foreach {call} " | ||
- | spellEchoLinkCallsign $call; | ||
- | playSilence 250; | ||
- | } | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when someone tries to setup an outgoing EchoLink connection but | ||
- | # the directory server is offline due to communications failure. | ||
- | # | ||
- | proc directory_server_offline {} { | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when the limit for maximum number of QSOs has been reached and | ||
- | # an outgoing connection request is received. | ||
- | # | ||
- | proc no_more_connections_allowed {} { | ||
- | # FIXME: Change the message to something that makes more sense... | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a status report is requested. This usually happens at | ||
- | # manual identification when the user press DTMF " | ||
- | # | ||
- | proc status_report {} { | ||
- | variable num_connected_stations; | ||
- | variable module_name; | ||
- | global active_module; | ||
- | | ||
- | if {$active_module == $module_name} { | ||
- | playNumber $num_connected_stations; | ||
- | playMsg " | ||
- | } | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when an EchoLink id cannot be found in an outgoing connect request. | ||
- | # | ||
- | proc station_id_not_found {station_id} { | ||
- | playNumber $station_id; | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when the lookup of an EchoLink callsign fail in an outgoing connect | ||
- | # request. | ||
- | # | ||
- | proc lookup_failed {station_id} { | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a local user tries to connect to the local node. | ||
- | # | ||
- | proc self_connect {} { | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a local user tries to connect to a node that is already | ||
- | # connected. | ||
- | # | ||
- | proc already_connected_to {call} { | ||
- | playMsg " | ||
- | playSilence 50; | ||
- | spellEchoLinkCallsign $call; | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when an internal error occurs. | ||
- | # | ||
- | proc internal_error {} { | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when an outgoing connection has been requested. | ||
- | # | ||
- | proc connecting_to {call} { | ||
- | playMsg " | ||
- | spellEchoLinkCallsign $call; | ||
- | playSilence 500; | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when an EchoLink connection has been terminated | ||
- | # | ||
- | proc disconnected {call} { | ||
- | spellEchoLinkCallsign $call; | ||
- | playMsg " | ||
- | playSilence 500; | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when an incoming EchoLink connection has been accepted. | ||
- | # | ||
- | proc remote_connected {call} { | ||
- | playMsg " | ||
- | spellEchoLinkCallsign $call; | ||
- | playSilence 500; | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when an outgoing connection has been established. | ||
- | # call - The callsign of the remote station | ||
- | # | ||
- | proc connected {call} { | ||
- | #puts " | ||
- | playMsg " | ||
- | playSilence 500; | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when the list of connected remote EchoLink clients changes | ||
- | # | ||
- | # | ||
- | proc client_list_changed {client_list} { | ||
- | #foreach {call} $client_list { | ||
- | # puts $call | ||
- | #} | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when the EchoLink connection has been idle for too long. The | ||
- | # connection will be terminated. | ||
- | # | ||
- | proc link_inactivity_timeout {} { | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a too short connect by callsign command is received | ||
- | # | ||
- | proc cbc_too_short_cmd {cmd} { | ||
- | spellWord $cmd; | ||
- | playSilence 50; | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when the connect by callsign function cannot find a match | ||
- | # | ||
- | proc cbc_no_match {code} { | ||
- | playNumber $code; | ||
- | playSilence 50; | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when the connect by callsign list has been retrieved | ||
- | # | ||
- | proc cbc_list {call_list} { | ||
- | playMsg " | ||
- | set idx 0; | ||
- | foreach {call} $call_list { | ||
- | incr idx; | ||
- | playSilence 500; | ||
- | playNumber $idx; | ||
- | playSilence 200; | ||
- | spellEchoLinkCallsign $call; | ||
- | } | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when the connect by callsign function is manually aborted | ||
- | # | ||
- | proc cbc_aborted {} { | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when an out of range index is entered in the connect by callsign | ||
- | # list | ||
- | # | ||
- | proc cbc_index_out_of_range {idx} { | ||
- | playNumber $idx; | ||
- | playSilence 50; | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when there are more than nine matches in the connect by | ||
- | # callsign function | ||
- | # | ||
- | proc cbc_too_many_matches {} { | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when no station have been chosen in 60 seconds in the connect | ||
- | # by callsign function | ||
- | # | ||
- | proc cbc_timeout {} { | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when the disconnect by callsign list has been retrieved | ||
- | # | ||
- | proc dbc_list {call_list} { | ||
- | playMsg " | ||
- | playSilence 200 | ||
- | playMsg " | ||
- | set idx 0; | ||
- | foreach {call} $call_list { | ||
- | incr idx; | ||
- | playSilence 500; | ||
- | playNumber $idx; | ||
- | playSilence 200; | ||
- | spellEchoLinkCallsign $call; | ||
- | } | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when the disconnect by callsign function is manually aborted | ||
- | # | ||
- | proc dbc_aborted {} { | ||
- | playMsg " | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when an out of range index is entered in the disconnect by callsign | ||
- | # list | ||
- | # | ||
- | proc dbc_index_out_of_range {idx} { | ||
- | playNumber $idx; | ||
- | playSilence 50; | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when no station have been chosen in 60 seconds in the disconnect | ||
- | # by callsign function | ||
- | # | ||
- | proc dbc_timeout {} { | ||
- | playMsg " | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a local user enter the DTMF code for playing back the | ||
- | # local node ID. | ||
- | # | ||
- | proc play_node_id {my_node_id} { | ||
- | playMsg " | ||
- | playSilence 200; | ||
- | if { $my_node_id != 0} { | ||
- | playNumber $my_node_id; | ||
- | } else { | ||
- | playMsg " | ||
- | } | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when an entered command failed or have bad syntax. | ||
- | # | ||
- | proc command_failed {cmd} { | ||
- | spellWord $cmd; | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when an unrecognized command has been received. | ||
- | # | ||
- | proc unknown_command {cmd} { | ||
- | spellWord $cmd; | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when the listen only feature is activated or deactivated | ||
- | # | ||
- | # | ||
- | # | ||
- | # | ||
- | proc listen_only {status activate} { | ||
- | variable module_name; | ||
- | |||
- | if {$status == $activate} { | ||
- | playMsg " | ||
- | playMsg [expr {$status ? " | ||
- | } else { | ||
- | puts " | ||
- | listen only mode."; | ||
- | playMsg [expr {$activate ? " | ||
- | playMsg " | ||
- | } | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when an outgoing connection is rejected. This can happen if | ||
- | # REJECT_OUTGOING and/or ACCEPT_OUTGOING has been setup. | ||
- | # | ||
- | proc reject_outgoing_connection {call} { | ||
- | spellEchoLinkCallsign $call; | ||
- | playSilence 50; | ||
- | playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a transmission from an EchoLink station is starting | ||
- | # or stopping | ||
- | # | ||
- | # call - The callsign of the remote station | ||
- | # | ||
- | # | ||
- | proc is_receiving {rx call} { | ||
- | if {$rx == 0} { | ||
- | playTone 1000 100 100; | ||
- | } | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a chat message is received from a remote station | ||
- | # | ||
- | # msg -- The message text | ||
- | # | ||
- | # WARNING: This is a slightly dangerous function since unexepected input | ||
- | # may open up a security flaw. Make sure that the message string is handled | ||
- | # as unknown data that can contain anything. Check it thoroughly before | ||
- | # using it. Do not run SvxLink as user root. | ||
- | proc chat_received {msg} { | ||
- | #puts $msg | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when an info message is received from a remote station | ||
- | # | ||
- | # call -- The callsign of the sending station | ||
- | # | ||
- | # | ||
- | # WARNING: This is a slightly dangerous function since unexepected input | ||
- | # may open up a security flaw. Make sure that the message string is handled | ||
- | # as unknown data that can contain anything. Check it thoroughly before | ||
- | # using it. Do not run SvxLink as user root. | ||
- | proc info_received {call msg} { | ||
- | #puts " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when a configuration variable is updated at runtime | ||
- | # | ||
- | proc config_updated {tag value} { | ||
- | #puts " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # The events below are for remote EchoLink announcements. Sounds are not | ||
- | # played over the local transmitter but are sent to the remote station. | ||
- | # | ||
- | |||
- | # | ||
- | # Executed when an incoming connection is accepted | ||
- | # | ||
- | proc remote_greeting {call} { | ||
- | # playSilence 1000; | ||
- | # playMsg " | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when an incoming connection is rejected | ||
- | # | ||
- | proc reject_remote_connection {perm} { | ||
- | playSilence 1000; | ||
- | if {$perm} { | ||
- | playMsg " | ||
- | } else { | ||
- | playMsg " | ||
- | playMsg " | ||
- | } | ||
- | playSilence 1000; | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when the inactivity timer times out | ||
- | # | ||
- | proc remote_timeout {} { | ||
- | playMsg " | ||
- | playSilence 1000; | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | # Executed when the squelch state changes | ||
- | # | ||
- | proc squelch_open {is_open} { | ||
- | # The listen_only_active and CFG_REMOTE_RGR_SOUND global variables are set by | ||
- | # the C++ code | ||
- | variable listen_only_active | ||
- | variable CFG_REMOTE_RGR_SOUND | ||
- | if {$CFG_REMOTE_RGR_SOUND && !$is_open && !$listen_only_active} { | ||
- | playSilence 200 | ||
- | playTone 1000 100 100 | ||
- | } | ||
- | } | ||
- | |||
- | |||
- | # end of namespace | ||
- | } | ||
- | |||
- | # | ||
- | # This file has not been truncated | ||
- | # | ||
- | </ | ||
- | ++++ | ||
- | |||
- | |||
- | |||
- | // | ||
- | |||
- | Page Updated : ~~LASTMOD~~ | ||
- | |||
- | {{tag> |
public/radio/mb7azeconf.1656771996.txt.gz · Last modified: 06/03/25 06:49 GMT (external edit)