How to use Asterisk Dialplan Context Priority Label on Debian 12
To Use Asterisk Dialplan Context Priority Label On Debian 12
Introduction
Asterisk's common practice is to assign text labels to priorities. This is to ensure that you can refer to a priority by something other than its number, which probably isn’t known, given that dialplans now generally use unnumbered priorities. To assign a text label to a priority, simply add the label inside parentheses after the priority.
Procedure:
Step 1: Check the OS version by using the below command.
root@linuxhelp:~#cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL=https://bugs.debian.org/
Step 2: Check the asterisk version by using the below command.
root@linuxhelp:~#asterisk -V
Asterisk 20.4.0
Step 3: Go to the following location by using the below command.
root@linuxhelp:~#cd /etc/asterisk/
Step 4: Edit extension.conf file for making dialplan using priority label by using the below command.
root@linuxhelp:/etc/asterisk#vim extensions.conf
[internal]
exten => 110,1,NoOp(Print the context)
same => n,Goto(111,test)
same => n,Dial(PJSIP/110, 20)
same => n,Playback(sorry_didnt_get)
same => n,Hangup()
exten => 111,1,NoOp(Print the context)
same => n,Dial(PJSIP/111, 20)
same => n(test),Playback(sorry_didnt_get)
same => n,Hangup()
exten => 112,1,NoOp(Print the context)
same => n,Dial(PJSIP/112, 20)
same => n,Playback(sorry_didnt_get)
same => n,Hangup()
Step 5: Login to the asterisk console by using the below command.
ot@linuxhelp:/etc/asterisk#asterisk -rvvvvvvvvvvvvvvvvvvvvv
Asterisk 20.4.0, Copyright (C) 1999 - 2022, Sangoma Technologies Corporation and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 20.4.0 currently running on linuxhelp (pid = 946)
linuxhelp*CLI>
Step 6: Reload the dialplan by using following command.
nuxhelp*CLI> dialplan reload
Dialplan reloaded.
-- Time to scan old dialplan and merge leftovers back into the new: 0.000007 sec
-- Time to restore hints and swap in new dialplan: 0.000007 sec
-- Time to delete the old dialplan: 0.000006 sec
-- Total time merge_contexts_delete: 0.000020 sec
-- pbx_config successfully loaded 1 contexts (enable debug for details).
Step 7: Make the call to check the priority label by using microsip application.

-- Executing [110@internal:1] NoOp("PJSIP/112-00000006", "Print the context") in new stack
-- Executing [110@internal:2] Goto("PJSIP/112-00000006", "111,test") in new stack
-- Goto (internal,111,3)
-- Executing [111@internal:3] Playback("PJSIP/112-00000006", "sorry_didnt_get") in new stack
> 0x7effb0013680 -- Strict RTP learning after remote address set to: 192.168.6.102:4000
-- <PJSIP/112-00000006> Playing 'sorry_didnt_get.ulaw' (language 'en')
> 0x7effb0013680 -- Strict RTP switching to RTP target address 192.168.6.102:4000 as source
-- Executing [111@internal:4] Hangup("PJSIP/112-00000006", "") in new stack
== Spawn extension (internal, 111, 4) exited non-zero on 'PJSIP/112-00000006'
Conclusion:
We have reached the end of this article. In this guide, we have walked you through the steps required to use Asterisk Dialplan Context Priority Label on Debian 12. Your feedback is much welcome.
Comments ( 0 )
No comments available