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

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to