Resolved: Handle incoming call if DND is set on an extension

Hi,

Can anyone advise me where should I check to send incoming call to its voicemail if an extension is set to DND (Do Not Disturb)? I am getting “im-sorry&an-error-has-occured” instead of getting the voicemail when I call to an extension which is set to DND.

Thanks for your sharing.

Regards,

Lay

Hi Phil,

I am sorry to miss to update this on-time. The issue was resolved a few days after your last advice. There was extra “” in general context in voicemail.conf as following:
[general]
#include “vm_email.inc”
#include “vm_general.inc”

After removing those quotes, changes started propagating into the file.

Thanks very much for your time and sharing. Wish you an excellent new year.

Regards,
Lay

there should be an entry created by FreePBX in the voicemail.conf file.

something isn’t right on your system. You may want to try editing the extension and re-submitting it to see if changes are now propagating into the file.

Thanks again, Phil.

[Dec 16 07:32:18] VERBOSE[2673] logger.c: == dialparties.agi: Extension 0711 has do not disturb enabled, or followme pre-ring returned busy
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – dialparties.agi: Filtered ARG3:
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – <IAX2/-7614>AGI Script dialparties.agi completed, returning 0
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:4] NoOp(“IAX2/-7614”, “Returned from dialparties with no extensions to call and DIALSTATUS: BUSY”) in new stack
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:10] GotoIf(“IAX2/-7614”, “0?exit,return”) in new stack
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:11] Set(“IAX2/-7614”, “SV_DIALSTATUS=BUSY”) in new stack
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:12] GosubIf(“IAX2/-7614”, “0?docfu,1”) in new stack
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:13] GosubIf(“IAX2/-7614”, “0?docfb,1”) in new stack
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:14] Set(“IAX2/-7614”, “DIALSTATUS=BUSY”) in new stack
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:15] NoOp(“IAX2/-7614”, “Voicemail is ‘0711’”) in new stack
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:16] GotoIf(“IAX2/-7614”, “0?s-BUSY,1”) in new stack
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:17] NoOp(“IAX2/-7614”, “Sending to Voicemail box 0711”) in new stack
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:18] Macro(“IAX2/-7614”, “vm,0711,BUSY,”) in new stack
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:1] Macro(“IAX2/-7614”, “user-callerid,SKIPTTL”) in new stack
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:1] Set(“IAX2/-7614”, “AMPUSER=0812345678”) in new stack
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:2] GotoIf(“IAX2/-7614”, “0?report”) in new stack
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:3] ExecIf(“IAX2/-7614”, “0?Set(REALCALLERIDNUM=0812345678)”) in new stack
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:4] Set(“IAX2/-7614”, “AMPUSER=”) in new stack
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:5] Set(“IAX2/-7614”, “AMPUSERCIDNAME=”) in new stack
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:6] GotoIf(“IAX2/-7614”, “1?report”) in new stack
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Goto (macro-user-callerid,s,9)
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:9] GotoIf(“IAX2/-7614”, “1?continue”) in new stack
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Goto (macro-user-callerid,s,18)
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:18] NoOp(“IAX2/-7614”, “Using CallerID “0812345678” <0812345678>”) in new stack
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:2] Set(“IAX2/-7614”, “VMGAIN=”"") in new stack
[Dec 16 07:32:18] WARNING[2673] func_db.c: DB requires an argument, DB(/)
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:3] GotoIf(“IAX2/-7614”, “1?vmx,1”) in new stack
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Goto (macro-vm,vmx,1)
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:1] GotoIf(“IAX2/-7614”, “0?s-BUSY,1”) in new stack
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:2] Set(“IAX2/-7614”, “MODE=busy”) in new stack
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:3] GotoIf(“IAX2/-7614”, “1?notdirect”) in new stack
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Goto (macro-vm,vmx,5)
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:5] NoOp(“IAX2/-7614”, “Checking if ext 0711 is enabled: blocked”) in new stack
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:6] GotoIf(“IAX2/-7614”, “1?s-BUSY,1”) in new stack
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Goto (macro-vm,s-BUSY,1)
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:1] NoOp(“IAX2/-7614”, “BUSY voicemail”) in new stack
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:2] Macro(“IAX2/-7614”, “get-vmcontext,0711”) in new stack
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:1] Set(“IAX2/-7614”, “VMCONTEXT=default”) in new stack
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:2] GotoIf(“IAX2/-7614”, “0?200:300”) in new stack
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Goto (macro-get-vmcontext,s,300)
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:300] NoOp(“IAX2/-7614”, “”) in new stack
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:3] VoiceMail(“IAX2/-7614”, “[email protected],b”) in new stack
[Dec 16 07:32:18] WARNING[2673] app_voicemail.c: No entry in voicemail config file for ‘0711’
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:4] Goto(“IAX2/-7614”, “exit-FAILED,1”) in new stack
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Goto (macro-vm,exit-FAILED,1)
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – Executing [[email protected]:1] Playback(“IAX2/-7614”, “im-sorry&an-error-has-occured”) in new stack
[Dec 16 07:32:18] VERBOSE[2673] logger.c: – <IAX2/-7614> Playing ‘im-sorry.slin’ (language ‘en’)
[Dec 16 07:32:19] VERBOSE[2673] logger.c: – <IAX2/-7614> Playing ‘an-error-has-occured.slin’ (language ‘en’)
[Dec 16 07:32:19] VERBOSE[2673] logger.c: == Spawn extension (macro-vm, exit-FAILED, 1) exited non-zero on ‘IAX2/-7614’ in macro ‘vm’
[Dec 16 07:32:19] VERBOSE[2673] logger.c: == Spawn extension (macro-exten-vm, s, 18) exited non-zero on ‘IAX2/-7614’ in macro ‘exten-vm’
[Dec 16 07:32:19] VERBOSE[2673] logger.c: == Spawn extension (from-did-direct, 0711, 1) exited non-zero on ‘IAX2/-7614’

By looking into following CLI output, I have checked voicemail.conf and noticed that there is no entry under [default]. I have added an entry for the extension 0711 manually as following and I start getting “Extension 0711 is on the phone, please leave your message…”.

[default]
0711 => 1234,Supervisor/Planner,attach=yes|saycid=yes|envelope=yes|delete=no

And, I can find my test voicemmail in a folder by that extension name 0711 under /var/spool/asterisk/voicemail/default. However, my concern is if I need to enter entries for all extensions in voicemail.conf manually and if FreePBX will overwrite them when a change is made on FreePBX GUI. I appreciate your assistance. Regards

have a look at your log file at the point where Voicemail() is called and see if there are any relevant errors/warnings being displayed.

Tried “amportal chown”, SETTING FILE PERMISSIONS Permissions OK. But I am still getting same error. Any advice please? When the user was asked to initializes its voicemail greetings, we have got incorrect voicemail login although the correct one was put in.

Hi,

This post look a lot like my issue: http://www.freepbx.org/forum/freepbx/beta-program-issues/ext-with-dnd-will-not-send-to-voicemail. I have tried but it doesn’t work for me.

Could you please explain a bit about - and + in your revise?

Index: extensions.conf

— extensions.conf (revision 5527)
+++ extensions.conf (working copy)
@@ -70,7 +70,7 @@
exten => s,n(dial),AGI(dialparties.agi)
exten => s,n,NoOp(Returned from dialparties with no extensions to call and DIALSTATUS: ${DIALSTATUS})

-exten => s,n(normdial),Dial(${ds}) ; dialparties will set the priority to 10 if $ds is not null
+exten => s,n+2(normdial),Dial(${ds}) ; dialparties will set the priority to 10 if $ds is not null
exten => s,n,Set(DIALSTATUS=${IF($["${DIALSTATUS_CW}"!="" ]?${DIALSTATUS_CW}:${DIALSTATUS})})

exten => s,20(huntdial),NoOp(Returned from dialparties with hunt groups to dial )

Thanks again for your sharing.

Regards,
Lay

it won’t be created until the first voicemail is left or the user initializes it with greetings.

my best guess is you have some permission problems or something.

try typing "amportal chown’ as root to get all the permissions hopefully set correctly and see if that helps.

Thanks, Phil. Voicemail is enable on that extension on FreePBX. But I do not see any folder by that extension name 0711 under /var/spool/asterisk/voicemail/default. Is that because the user has not recorded/created his voicemail yet?

[[email protected] ~]# asterisk -r
Asterisk 1.6.0.26, Copyright © 1999 - 2010 Digium, Inc. and others.
Created by Mark Spencer [email protected]
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 1.6.0.26 currently running on pbx (pid = 1663)
Verbosity is at least 21
– Accepting AUTHENTICATED call from 1.2.3.4:
> requested format = gsm,
> requested prefs = (gsm),
> actual format = gsm,
> host prefs = (ulaw|alaw|gsm),
> priority = mine
– Executing [[email protected]:1] Set(“IAX2/-6876”, “__FROM_DID=0512340711”) in new stack
– Executing [[email protected]:2] ExecIf(“IAX2/-6876”, “0 ?Set(CALLERID(name)=0812345678)”) in new stack
– Executing [[email protected]:3] Set(“IAX2/-6876”, “__CALLINGPRES_SV=allowed_passed_screen”) in new stack
– Executing [[email protected]:4] Set(“IAX2/-6876”, “CALLERPRES()=allowed_not_screened”) in new stack
– Executing [[email protected]:5] Goto(“IAX2/-6876”, “from-did-direct,0711,1”) in new stack
– Goto (from-did-direct,0711,1)
– Executing [[email protected]:1] Macro(“IAX2/-6876”, “exten-vm,0711,0711”) in new stack
– Executing [[email protected]:1] Macro(“IAX2/-6876”, “user-callerid”) in new stack
– Executing [[email protected]:1] Set(“IAX2/-6876”, “AMPUSER=0812345678”) in new stack
– Executing [[email protected]:2] GotoIf(“IAX2/-6876”, “0?report”) in new stack
– Executing [[email protected]:3] ExecIf(“IAX2/-6876”, “1?Set(REALCALLERIDNUM=0812345678)”) in new stack
– Executing [[email protected]:4] Set(“IAX2/-6876”, “AMPUSER=”) in new stack
– Executing [[email protected]:5] Set(“IAX2/-6876”, “AMPUSERCIDNAME=”) in new stack
– Executing [[email protected]:6] GotoIf(“IAX2/-6876”, “1?report”) in new stack
– Goto (macro-user-callerid,s,9)
– Executing [[email protected]:9] GotoIf(“IAX2/-6876”, “0?continue”) in new stack
– Executing [[email protected]:10] Set(“IAX2/-6876”, “__TTL=64”) in new stack
– Executing [[email protected]:11] GotoIf(“IAX2/-6876”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,18)
– Executing [[email protected]:18] NoOp(“IAX2/-6876”, “Using CallerID “NOC” <0812345678>”) in new stack
– Executing [[email protected]:2] Set(“IAX2/-6876”, “RingGroupMethod=none”) in new stack
– Executing [[email protected]:3] Set(“IAX2/-6876”, “VMBOX=0711”) in new stack
– Executing [[email protected]:4] Set(“IAX2/-6876”, “EXTTOCALL=0711”) in new stack
– Executing [[email protected]:5] Set(“IAX2/-6876”, “CFUEXT=”) in new stack
– Executing [[email protected]:6] Set(“IAX2/-6876”, “CFBEXT=”) in new stack
– Executing [[email protected]:7] Set(“IAX2/-6876”, “RT=45”) in new stack
– Executing [[email protected]:8] Macro(“IAX2/-6876”, “record-enable,0711,IN”) in new stack
– Executing [[email protected]:1] GotoIf(“IAX2/-6876”, “1?check”) in new stack
– Goto (macro-record-enable,s,4)
– Executing [[email protected]:4] AGI(“IAX2/-6876”, “recordingcheck,20101215-095959,1292378399.182060”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck
recordingcheck,20101215-095959,1292378399.182060: Inbound recording not enabled
– <IAX2/-6876>AGI Script recordingcheck completed, returning 0
– Executing [[email protected]:5] MacroExit(“IAX2/-6876”, “”) in new stack
– Executing [[email protected]:9] Macro(“IAX2/-6876”, “dial,45,tr,0711”) in new stack
– Executing [[email protected]:1] GotoIf(“IAX2/-6876”, “1?dial”) in new stack
– Goto (macro-dial,s,3)
– Executing [[email protected]:3] AGI(“IAX2/-6876”, “dialparties.agi”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
dialparties.agi: Starting New Dialparties.agi
dialparties.agi: Caller ID name is ‘NOC’ number is ‘0812345678’
> dialparties.agi: USE_CONFIRMATION: ‘FALSE’
> dialparties.agi: RINGGROUP_INDEX: ''
dialparties.agi: Methodology of ring is ‘none’
– dialparties.agi: Added extension 0711 to extension map
> dialparties.agi: Extension 0711 has call screening off
– dialparties.agi: Extension 0711 cf is disabled
== dialparties.agi: Extension 0711 has do not disturb enabled, or followme pre-ring returned busy
– dialparties.agi: Filtered ARG3:
– <IAX2/-6876>AGI Script dialparties.agi completed, returning 0
– Executing [[email protected]:4] NoOp(“IAX2/-6876”, “Returned from dialparties with no extensions to call and DIALSTATUS: BUSY”) in new stack
– Executing [[email protected]:10] GotoIf(“IAX2/-6876”, “0?exit,return”) in new stack
– Executing [[email protected]:11] Set(“IAX2/-6876”, “SV_DIALSTATUS=BUSY”) in new stack
– Executing [[email protected]:12] GosubIf(“IAX2/-6876”, “0?docfu,1”) in new stack
– Executing [[email protected]:13] GosubIf(“IAX2/-6876”, “0?docfb,1”) in new stack
– Executing [[email protected]:14] Set(“IAX2/-6876”, “DIALSTATUS=BUSY”) in new stack
– Executing [[email protected]:15] NoOp(“IAX2/-6876”, “Voicemail is ‘0711’”) in new stack
– Executing [[email protected]:16] GotoIf(“IAX2/-6876”, “0?s-BUSY,1”) in new stack
– Executing [[email protected]:17] NoOp(“IAX2/-6876”, “Sending to Voicemail box 0711”) in new stack
– Executing [[email protected]:18] Macro(“IAX2/-6876”, “vm,0711,BUSY,”) in new stack
– Executing [[email protected]:1] Macro(“IAX2/-6876”, “user-callerid,SKIPTTL”) in new stack
– Executing [[email protected]:1] Set(“IAX2/-6876”, “AMPUSER=0812345678”) in new stack
– Executing [[email protected]:2] GotoIf(“IAX2/-6876”, “0?report”) in new stack
– Executing [[email protected]:3] ExecIf(“IAX2/-6876”, “0?Set(REALCALLERIDNUM=0812345678)”) in new stack
– Executing [[email protected]:4] Set(“IAX2/-6876”, “AMPUSER=”) in new stack
– Executing [[email protected]:5] Set(“IAX2/-6876”, “AMPUSERCIDNAME=”) in new stack
– Executing [[email protected]:6] GotoIf(“IAX2/-6876”, “1?report”) in new stack
– Goto (macro-user-callerid,s,9)
– Executing [[email protected]:9] GotoIf(“IAX2/-6876”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,18)
– Executing [[email protected]:18] NoOp(“IAX2/-6876”, “Using CallerID “NOC” <0812345678>”) in new stack
– Executing [[email protected]:2] Set(“IAX2/-6876”, “VMGAIN=”"") in new stack
– Executing [[email protected]:3] GotoIf(“IAX2/-6876”, “1?vmx,1”) in new stack
– Goto (macro-vm,vmx,1)
– Executing [[email protected]:1] GotoIf(“IAX2/-6876”, “0?s-BUSY,1”) in new stack
– Executing [[email protected]:2] Set(“IAX2/-6876”, “MODE=busy”) in new stack
– Executing [[email protected]:3] GotoIf(“IAX2/-6876”, “1?notdirect”) in new stack
– Goto (macro-vm,vmx,5)
– Executing [[email protected]:5] NoOp(“IAX2/-6876”, "Checking if ext 0711 is enabled: ") in new stack
– Executing [[email protected]:6] GotoIf(“IAX2/-6876”, “1?s-BUSY,1”) in new stack
– Goto (macro-vm,s-BUSY,1)
– Executing [[email protected]:1] NoOp(“IAX2/-6876”, “BUSY voicemail”) in new stack
– Executing [[email protected]:2] Macro(“IAX2/-6876”, “get-vmcontext,0711”) in new stack
– Executing [[email protected]:1] Set(“IAX2/-6876”, “VMCONTEXT=default”) in new stack
– Executing [[email protected]:2] GotoIf(“IAX2/-6876”, “0?200:300”) in new stack
– Goto (macro-get-vmcontext,s,300)
– Executing [[email protected]:300] NoOp(“IAX2/-6876”, “”) in new stack
– Executing [[email protected]:3] VoiceMail(“IAX2/-6876”, “[email protected],b”) in new stack
– Executing [[email protected]:4] Goto(“IAX2/-6876”, “exit-FAILED,1”) in new stack
– Goto (macro-vm,exit-FAILED,1)
– Executing [[email protected]:1] Playback(“IAX2/-6876”, “im-sorry&an-error-has-occured”) in new stack
– <IAX2/-6876> Playing ‘im-sorry.slin’ (language ‘en’)
– <IAX2/-6876> Playing ‘an-error-has-occured.slin’ (language ‘en’)
– Executing [[email protected]:2] GotoIf(“IAX2/-6876”, “0?exit-RETURN,1”) in new stack
– Executing [[email protected]:3] Hangup(“IAX2/-6876”, “”) in new stack
== Spawn extension (macro-vm, exit-FAILED, 3) exited non-zero on ‘IAX2/-6876’ in macro ‘vm’
== Spawn extension (macro-exten-vm, s, 18) exited non-zero on ‘IAX2/-6876’ in macro ‘exten-vm’
== Spawn extension (from-did-direct, 0711, 1) exited non-zero on ‘IAX2/-6876’
– Hungup 'IAX2/-6876’
pbx*CLI> exit
[[email protected] ~]#

Best regards,

Lay

If they have voicemail enabled, it should go there automatically.

If you have it configured, then something else is going wrong and you may need to put a CLI trace up here to see if someone can spot what is going on.