Summary: | ASTERISK-30352: pbx_lua: Set callerid number when attended transfer | ||
Reporter: | Ilia Gvozdev (igvozd) | Labels: | |
Date Opened: | 2022-12-13 09:52:38.000-0600 | Date Closed: | |
Priority: | Minor | Regression? | |
Status: | Open/New | Components: | Applications/app_dial PBX/pbx_lua |
Versions: | 18.14.0 | Frequency of Occurrence | |
Related Issues: | |||
Environment: | CentOS Linux release 7.9.2009 (Core), Linux 3.10.0-1160.76.1.el7.x86_64 x86_64 | Attachments: | ( 0) full ( 1) full_config ( 2) full_lua_1 ( 3) INVITE_config.txt ( 4) INVITE_lua_1.txt ( 5) INVITE.txt |
Description: | Caller ID number that was presented on the calling channel does not saved when attended transfer with pbx_lua.
{code:title=extensions.lua|borderStyle=solid} function from-pstn(context,exten) app.Set("__ORIG_CIDNUM="..channel['CALLERID(num)']:get()) app.Answer() app.Queue("tech","tr","","",60) app.Hangup() end function phones (context,exten) app.Log("VERBOSE","ORIG_CIDNUM: ",channel['ORIG_CIDNUM']:get() or '') app.Set("CALLERID(num)="..channel['ORIG_CIDNUM']:get()) app.Dumpchan() app.Dial("PJSIP/"..exten,60,"o("..channel['ORIG_CIDNUM']:get()..")") end {code} full log and INVITE message in attach | ||
Comments: | By: Asterisk Team (asteriskteam) 2022-12-13 09:52:42.569-0600 Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed. A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report. Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process]. Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur. Please note that by submitting data, code, or documentation to Sangoma through JIRA, you accept the Terms of Use present at [https://www.asterisk.org/terms-of-use/|https://www.asterisk.org/terms-of-use/]. By: Ilia Gvozdev (igvozd) 2022-12-13 09:55:47.091-0600 same call scenario successfully work with pbx_config By: Joshua C. Colp (jcolp) 2022-12-13 09:59:57.703-0600 Please also attach a working case with pbx_config. I'm also confused a bit over your issue - are you saying that some of the LUA code doesn't execute when it should? I should also add that pbx_lua is community supported. There is no active maintainer, and no guarantee or timeframe on when this would get looked into if it is accepted. By: Ilia Gvozdev (igvozd) 2022-12-14 04:03:44.100-0600 {code:title=extensions.lua|borderStyle=solid} [phones] include => local include => incoming [from-pstn] exten => 9876543210,1,Log(NOTICE, "from PSTN") same => n,Set(__ORIG_CIDNUM=${CALLERID(num)}) same => n,Answer() same => n,Queue(tech,tr,60) [local] exten => _1XXX,1,Log(NOTICE, "Enter into [local] context") same => n,Set(CALLERID(num)=${ORIG_CIDNUM}) same => n,Dumpchan() same => n,Dial(PJSIP/${EXTEN},60,o) same => n,Hangup() {code} Check please both log files with INVITE message. In this case (with pbx_config) the "From" header field contains correct original caller's Caller ID while attended transfer By: Joshua C. Colp (jcolp) 2022-12-14 04:12:48.480-0600 Your pbx_config configuration is not equivalent to your pbx_lua configuration. In the pbx_config configuration you have specified the 'o' option to Dial but without a value, so it won't have any effect. If you remove the 'o' option from Dial in pbx_lua what happens? By: Ilia Gvozdev (igvozd) 2022-12-14 04:29:31.105-0600 No result. {code:title=extension.lua|borderStyle=solid} function from-pstn(context,exten) app.Set("__ORIG_CIDNUM="..channel['CALLERID(num)']:get()) app.Answer() app.Queue("tech","tr","","",60) app.Hangup() end function phones (context,exten) app.Log("VERBOSE","ORIG_CIDNUM: ",channel['ORIG_CIDNUM']:get() or '') app.Set("CALLERID(num)="..channel['ORIG_CIDNUM']:get()) app.Dumpchan() app.Dial("PJSIP/"..exten,60) end {code} Wiki: note that o(${CALLERID(all)}) is similar to option o without the parameter. By: Joshua C. Colp (jcolp) 2022-12-14 04:33:07.673-0600 Okay, I've accepted this issue. Like I said it's community supported with no maintainer, so there's no timeframe on when or even if it will get looked at by anyone. By: Ilia Gvozdev (igvozd) 2022-12-14 04:37:18.533-0600 Noted, appreciate for feedback. In your opinion it's a bug or my mistake? By: Joshua C. Colp (jcolp) 2022-12-14 04:39:52.227-0600 I'm not that familiar with pbx_lua. I would expect things to work the same as pbx_config does, so probably a bug. If not then something I can't see. By: Ilia Gvozdev (igvozd) 2022-12-14 04:41:17.305-0600 Thanks for answer. Have a nice day |