Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

Version 1 Next »

Converting Macro to Gosub

Macros are deprecated in Asterisk and will be removed completely in Asterisk version 21. It is therefore necessary to prepare the migration of all Macros to Gosub().

To do this smoothly, the following is proposed:

  • Keep the part of code with the macro and copy the content into the subcontext.

  • Keep the original macro context name, but replace 'macro' with 'sub'. In the following example we are converting macro-get-vmcontext to sub-get-vmcontext.

  • Edit the now deprecated macro context to include a priority (1) gosub to show the deprecated alert in the asterisk full log.

The alert called is :

After that, it's easy to know what we need to change in the dial plan to migrate marco to gosub like this:

Above we can see that the from-pms context includes a call to *98 in line 13 cailling a macro that needs to be migrated to Gosub()

Side PHP code:

You must use ext_gosub() like this:

So: ext_gosub( Prioroty, Ext, Context, Args ) ;

In our example about get-vmcontext, it will be changed to sub-get-vmcontext with a pritority 1 and the extension s :

List of modules that need to be converted:

Module Name

Open Source

Issue Link

Status(Open, Completed)

Fixed Version 15

Fixed Version 16

accountcodepreserve

(tick)

areminder

(error)

blacklist

(tick)

callerid

(error)

callforward

(tick)

calllimit

(error)

callrecording

(tick)

callwaiting

(tick)

campon

(tick)

conferences

(tick)

contactmanager

(tick)

core

(tick)

FREEPBX-19656 - Change user Macro hooks to Gosub RESOLVED

In Progress

cos

(error)

dashboard

(tick)

daynight

(tick)

dictate

(tick)

directory

(tick)

donotdisturb

(tick)

endpoint

(error)

extensionroutes

(error)

fax

(tick)

findmefollow

(tick)

framework

(tick)

hotelwakeup

(tick)

infoservices

(tick)

ivr

(tick)

languages

(tick)

miscapps

(tick)

outroutemsg

(tick)

paging

(tick)

pagingpro

(error)

parking

(tick)

parkpro

(error)

pbdirectory

(tick)

pinsets

(tick)

queues

(tick)

recordings

(tick)

ringgroups

(tick)

sangomacrm

(error)

speeddial

(tick)

timeconditions

(tick)

vmblast

(tick)

vmnotify

(error)

voicemail

(tick)

vqplus

(error)

webcallback

(error)

xmpp

(tick)

zulu

(error)

  • No labels