Summary:ASTERISK-19141: pub_lua Extensions and Execution of CONNECTED_LINE_CALLER_SEND_MACRO
Reporter:andre valentin (avalentin)Labels:
Date Opened:2011-12-30 08:49:31.000-0600Date Closed:
Versions:10.0.0 13.18.4 Frequency of
Environment:Centos 6.2Attachments:
Description:If you set the global variable CONNECTED_LINE_CALLER_SEND_MACRO to a valid macro, you will not be able to execute commands after the execution of the macro (which is called by asterisk itself).
calling lua code:
function std_exten()
       app.Dial(table.concat(channels,"&"),dialtimeout, "tTwWkK");
       if channel.DIALSTATUS:get() == nil or string.len(channel.DIALSTATUS:get()) == 0 then

Asterisk will not reach the if line. See the log:
   -- Executing [0@inbound:1] Dial("SIP/siptest-0000000d", "SIP/ta24,15,tTwWkK")
 == Using UDPTL TOS bits 184
 == Using UDPTL CoS mark 5
 == Using SIP RTP TOS bits 184
 == Using SIP RTP CoS mark 5
   -- Called SIP/ta24
colpCaller SIP/siptest-0000000d ConnectedLine: "24 XX" <24>
   -- Executing [s@macro-colpCaller:1] log("SIP/siptest-0000000d", "VERBOSE,Checking for callee subaddr")
Checking for callee subaddr
   -- Executing [s@macro-colpCaller:1] log("SIP/siptest-0000000d", "VERBOSE,Checking for callee name lookup")
Checking for callee name lookup
   -- SIP/ta24-00000010 is ringing
   -- SIP/ta24-00000010 is ringing
   -- Nobody picked up in 15000 ms
   -- Auto fallthrough, channel 'SIP/siptest-0000000d' status is 'NOANSWER'

Of course the Auto fallthrough should not happen. Debug logs show this:
[Dec 30 15:34:52] DEBUG[16162] app_macro.c: Executed application:
[Dec 30 15:34:52] DEBUG[16162] pbx_lua.c: Looking up s@macro-colpCaller:2
[Dec 30 15:34:52] VERBOSE[16162] app_dial.c:     -- SIP/ta24-00000010 is ringing
[Dec 30 15:35:07] VERBOSE[16162] app_dial.c:     -- Nobody picked up in 15000 ms
[Dec 30 15:35:07] DEBUG[16162] pbx_lua.c: Looking up 0@inbound:2
[Dec 30 15:35:07] DEBUG[16162] pbx_lua.c: Looking up 0@inbound:1
[Dec 30 15:35:07] VERBOSE[16162] pbx.c:     -- Auto fallthrough, channel 'SIP/siptest-0000000d' status is 'NOANSWER'
[Dec 30 15:35:07] DEBUG[16162] channel.c: Soft-Hanging up channel 'SIP/siptest-0000000d'
[Dec 30 15:35:07] DEBUG[16162] pbx_lua.c: Looking up h@inbound:1
[Dec 30 15:35:07] DEBUG[16162] pbx_lua.c: Looking up h@voip_extensions:1
[Dec 30 15:35:07] DEBUG[16162] pbx_lua.c: Looking up h@other_extensions:1
[Dec 30 15:35:07] DEBUG[16162] channel.c: Hanging up channel 'SIP/siptest-0000000d'

I need to use the CONNECTED_LINE_CALLER_SEND_MACRO. Perhaps there is a way to fix this or an alternative for the macro call.

Comments:By: Matt Jordan (mjordan) 2011-12-30 16:39:15.397-0600

Thank you for taking the time to report this issue. Please note that pbx_lua is a community supported module and thus the support level may reflect that. More information about the various module support levels can be found at https://wiki.asterisk.org/wiki/display/AST/Asterisk+Module+Support+States

By: andre valentin (avalentin) 2017-12-19 11:17:06.684-0600

Because of this problem I created a 2nd lua instance which serves all "background" macros and subroutines. I can offer this as a patch, if interested.

If not, you may close this ticket.

By: Joshua C. Colp (jcolp) 2017-12-19 11:20:24.542-0600

[~avalentin] You can offer it if you wish. Submitting it to Gerrit would see it included faster.