[Asterisk-Dev] Centralized voicemail
Soren Rathje
asterisk at lolle.org
Mon Jun 14 14:59:56 MST 2004
----- Original Message -----
From: "Rob Gagnon" <rob at networkip.net>
To: <asterisk-dev at lists.digium.com>
Sent: Monday, June 14, 2004 8:43 PM
Subject: Re: [Asterisk-Dev] Centralized voicemail
> Solution for the bug in ast_data has been located and updated on the SVN
> server at
> http://svn.asteriskdocs.org/res_data/
>
> (Rev 143 or newer contains the fix)
>
> A logical issue was found in ast_data_extract_packet() that has been
> resolved. Originally I was having the routine bail out of the function upon
> the first instance of an attribute not being present in a packet. This
> doesn't work so well with a request for a voicemail account that has a
> missing context.
>
> The subroutine has been adjusted to compensate for this, and should work
> well for everyone now.
>
> Thanks for your implied patience. :-)
>
> Rob
143 works fine with no segfaults, but breaks something at my end...
ast_data is configured for Voicemail _only_, phones and dialplans are kept in their respective files.
I have configured two voicemail contexts with similar numbers SIP/100 = 100 at internal and SIP/1100 = 100 at external and running everything from .conf files, "exten => _80,1,VoicemailMain(${CALLERIDNUM})" is able to figure out my voicemail context and will only prompt me for the password.
Moving voicemail.conf into the database something breaks, I now have to change my dialplan to exten => _80,1,VoicemailMain(${CALLERIDNUM}@internal) in order to check my voicemail, this will fail for 100 at external so 100 at external will need a similar dialplan with a different context. If I leave it as it is it assumes context=default and fails regardless of anything.
Also, leaving voicemails becomes a problem, below is my macro for placing internal calls..
[Internals]
exten => 100,1,Macro(stdexten,100,SIP/100)
[macro-stdexten]
;
; ${ARG1} - Extension
; ${ARG2} - Device(s) to ring
;
exten => s,1,DBget(temp=DND/${ARG1}) ; Get DND key
exten => s,102,Goto(s,3) ; DND key is NOT set
exten => s,2,Goto(s,11) ; DND key is set
exten => s,3,ChanisAvail(${ARG2}) ; Is channel up?
exten => s,104,Goto(s,13) ; Channel in NOT up
exten => s,4,DBget(temp=CFIM/${ARG1}) ; Get CFIM key
exten => s,105,Goto(s,6) ; CFIM key is NOT set
exten => s,5,Dial(Local/${temp}@Internals) ; Unconditional forward
exten => s,6,Dial(${ARG2},20,tm) ; Ring the interface
exten => s,107,Goto(s,9) ; B party is BUSY
exten => s,7,DBget(temp=CFBS/${ARG1}) ; Get CFBS key
exten => s,108,Goto(s,13) ; CFBS key in NOT set
exten => s,8,Dial(Local/${temp}@Internals) ; Unavailable forward
exten => s,9,DBget(temp=CFBS/${ARG1}) ; Get CFBS key
exten => s,110,Goto(s,11) ; CFBS key is NOT set
exten => s,10,Dial(Local/${temp}@Internals) ; Busy forward
exten => s,11,Voicemail(b${ARG1}) ; Send to voicemail w/ busy announce
exten => s,12,Hangup() ; Hangup
exten => s,13,Voicemail(u${ARG1}) ; Send to voicemail w/ unavail announce
exten => s,14,Hangup() ; Hangup
Phone number 100 (line-1, vm=100 at internal) calling 100 (line-2, vm=100 at internal) and eventually going to voicemail.
-- Executing Macro("SIP/100-c37f", "stdexten|100|SIP/100") in new stack
-- Executing DBget("SIP/100-c37f", "temp=DND/100") in new stack
-- DBget: varname=temp, family=DND, key=100
-- DBget: Value not found in database.
-- Executing Goto("SIP/100-c37f", "s|3") in new stack
-- Goto (macro-stdexten,s,3)
-- Executing ChanIsAvail("SIP/100-c37f", "SIP/100") in new stack
-- Executing DBget("SIP/100-c37f", "temp=CFIM/100") in new stack
-- DBget: varname=temp, family=CFIM, key=100
-- DBget: Value not found in database.
-- Executing Goto("SIP/100-c37f", "s|6") in new stack
-- Goto (macro-stdexten,s,6)
-- Executing Dial("SIP/100-c37f", "SIP/100|20|tm") in new stack
-- Called 100
-- Started music on hold, class 'default', on SIP/100-c37f
-- SIP/100-e174 is ringing
-- Nobody picked up in 20000 ms
-- Stopped music on hold on SIP/100-c37f
-- Executing DBget("SIP/100-c37f", "temp=CFBS/100") in new stack
-- DBget: varname=temp, family=CFBS, key=100
-- DBget: Value not found in database.
-- Executing Goto("SIP/100-c37f", "s|13") in new stack
-- Goto (macro-stdexten,s,13)
-- Executing VoiceMail("SIP/100-c37f", "u100") in new stack
Jun 14 23:18:54 WARNING[131081]: app_voicemail.c:1711 leave_voicemail: No entry in voicemail config file for '100'
-- Executing Hangup("SIP/100-c37f", "") in new stack
== Spawn extension (macro-stdexten, s, 14) exited non-zero on 'SIP/100-c37f' in macro 'stdexten'
== Spawn extension (From-Internal, 100, 1) exited non-zero on 'SIP/100-c37f'
If I change the context of that particular entry in the database to "default" it works...
Somehow ast_data do not resolve the voicemail context of the called party the same way as core asterisk.
The question is; is this intentional or ??
I can resolve the problem by altering macro-stdext to include a third parameter, the voicemail context but that only means additional administration when creating new clients.
[Internals]
exten => 100,1,Macro(stdexten,100,SIP/100,internal)
and
[macro-stdexten]
;
; ${ARG1} - Extension
; ${ARG2} - Device(s) to ring
; ${ARG3} - VoiceMail context
;
exten => s,1,DBget(temp=DND/${ARG1}) ; Get DND key
...
...
exten => s,10,Dial(Local/${temp}@Internals) ; Busy forward
exten => s,11,Voicemail(b${ARG1}@${ARG3}) ; Send to voicemail w/ busy announce
exten => s,12,Hangup() ; Hangup
exten => s,13,Voicemail(u${ARG1}@${ARG3}) ; Send to voicemail w/ unavail announce
exten => s,14,Hangup() ; Hangup
Suggestion ??
-- Soren
More information about the asterisk-dev
mailing list