Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] ${MACRO_CONTEXT} for Subroutines


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
ml04 at reventix.de
Guest





PostPosted: Thu Aug 20, 2015 10:53 am    Post subject: [asterisk-users] ${MACRO_CONTEXT} for Subroutines Reply with quote

Hello Everybody,

in past times I used macros but since a while they are deprecated.
So I replaced my macros with subroutines. In most cases this is really
no problem.

But in some rare cases I miss the macro channel variables (e.g.
${MACRO_CONTEXT}).
https://wiki.asterisk.org/wiki/display/AST/Dialplan+Macros+Channel+Variables

Is there something similar for subroutines?

Kind regards
Bastian

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
jhester at digium.com
Guest





PostPosted: Thu Aug 20, 2015 12:10 pm    Post subject: [asterisk-users] ${MACRO_CONTEXT} for Subroutines Reply with quote

On Thu, Aug 20, 2015 at 10:52 AM, Bastian Schern <ml04@reventix.de (ml04@reventix.de)> wrote:
Quote:
Hello Everybody,
Howdy
 
Quote:

in past times I used macros but since a while they are deprecated.
So I replaced my macros with subroutines. In most cases this is really no problem.

But in some rare cases I miss the macro channel variables (e.g. ${MACRO_CONTEXT}).
https://wiki.asterisk.org/wiki/display/AST/Dialplan+Macros+Channel+Variables

Is there something similar for subroutines?
Due to the nature of GoSub() vs. Macro() there is no built in channel variable which carries 
that information with a GoSub(). Devs keep me honest here.


If the subroutine needs to know what part of dialplan the channel came from I recommend 
sending the information as an ARG in the nested set of parenthesis when executing the 
GoSub() application.


exten => _7XXX,1,GoSub(subDialer,begin,1(${CONTEXT}))




[subDialer]
exten => begin,1,Verbose(0, This subroutine was executed from the ${ARG1} context.)




 
Quote:

Kind regards
Bastian

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
              http://www.asterisk.org/hello

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




--
Justin Hester
Digium, Inc. · Technical Trainer
445 Jan Davis Drive NW · Huntsville, AL 35806 · USA
ph: +1 256 428 6238
Check us out at: https://www.digium.com · http://asterisk.org
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services