Got it:
extensions = {
["macro-test"] = {
["s"] = function(c, e)
app.verbose("This is my macro")
end;
};
default = {
["_X"] = function(c, e)
app.dial("SIP/00", nil, "mM(test)")
end;
};
};
---
Dennis Guse
On Fri, Jun 6, 2014 at 6:49 PM, George Joseph <[email protected]>
wrote:
> On Fri, Jun 6, 2014 at 1:48 AM, Dennis Guse <
> [email protected]> wrote:
>
>> Hi,
>>
>> I have defined a dialplan in lua and now would like to use "dial" with
>> the macro M to implement some logic, when the callee-channel gets created.
>>
>> Working old style would be (extensions.conf)
>>
>> [default]
>> exten => _X,1,dial(SIP/1,,M(mymacro^parameter))
>>
>> [macro-mymacro]
>> exten => s,1,verbose(${ARG1})
>>
>> How to implement the same functionality using pbx_lua?
>>
>> Details: Asterisk 11.7 on Ubuntu 14.04
>>
>> Kind regards
>>
>> Dennis Guse
>>
>> Here's how I do it for pre-dial handlers...
>
> extensions.handlers = {
> ["addheader"] = function(c,e)
> channel.PJSIP_HEADER('add', "Alert-Info"):set(";info=custom1")
> end;
> }
>
> extensions.local_default = {
> ["9999"] = function(c,e)
> app.dial('PJSIP/'..e,nil,'b(handlers^addheader^1)')
> end;
> }
>
>
> --
> _____________________________________________________________________
> -- 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
>
--
_____________________________________________________________________
-- 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