[asterisk-users] What replaces Macro() now? And how do you do the equivalent?

Anthony Messina amessina at messinet.com
Wed Mar 12 09:21:13 CDT 2008


On Sunday 09 March 2008 09:59:32 pm Philip Prindeville wrote:
> http://bugs.digium.com/view.php?id=11969
>
> If Macro()/MacroExit() is deprecated, how does one go about achieving
> the same functionality with Gosub()/Return()?

i agree--an excellent question.  Since Macro is depreciated and I am using 
1.4, planning on upgrading to 1.6, I started to mess around a bit with this.

Currently, I use:
[incoming]
; Calls from outside
exten => 2202,1,Dial(${F1000G},30,kKotTwW)
exten => 2202,n,Goto(vm-external,${EXTEN},1)

[internal-extens]
; Calls from inside
exten => 2202,1,Dial(${F1000G},30,kKotTwW)
exten => 2202,n,Goto(vm-internal,${EXTEN},1)

And the Goto directs you to this context:
[vm](!)
exten => _X.,1,Answer(500)
exten => _X.,n,Exec(${IF($["${DIALSTATUS}" 
= "BUSY"]?VoiceMail(${EXTEN},b):VoiceMail(${EXTEN},u))})
exten => _X.,n,Playback(vm-goodbye)
exten => _X.,n,Hangup()

[vm-internal](vm)

[vm-external](vm)

I use two separate, but equal contexts so that in voicemail, i could 
distinguish between whether a call was "from-extension" or "from-phonenumber"

I didn't need to use Gosub since I don't need a return.

I'm sure there are plenty of ways that are simpler, etc.  They have not yet 
arrived at my brain's doorstep.
-- 
Anthony -  http://messinet.com - http://messinet.com/~amessina/gallery
8F89 5E72 8DF0 BCF0 10BE 9967 92DC 35DC B001 4A4E
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20080312/ef472750/attachment.pgp 


More information about the asterisk-users mailing list