[Home]

Summary:ASTERISK-26343: ASTERISK-25951 causes issues for callerid manipulation through agi
Reporter:Morten Tryfoss (mtryfoss)Labels:
Date Opened:2016-09-07 04:54:20Date Closed:2016-11-08 07:58:50.000-0600
Priority:MajorRegression?
Status:Closed/CompleteComponents:Resources/res_agi
Versions:13.11.0 Frequency of
Occurrence
Constant
Related
Issues:
is caused byASTERISK-25951 res_agi: run_agi eats frames it shouldn't
Environment:Attachments:
Description:ASTERISK-25951 seems to change behaviour for agi scripts. Tested with the old version, and everything seems to work as before. Setting callerid through dialplan works ok.

Consider this configuration:
[test2]
exten => 1,1,agi(test.agi)
exten => 1,n,Hangup
[test1]
exten => 1,1,agi(test.agi)
exten => 1,n,Dial(Local/1@test2/n)
exten => 1,n,Hangup
[default]
exten => 94013213,1,set(__TRANSFER_CONTEXT=test1)
exten => 94013213,n,Dial(SIP/bnsip3/person_1_6_fixed,,t)
exten => 94013213,n,Hangup

Call enters default context and user does attended transfer to extension 1 in [test1].

Now see the agi debug and my comments:
first channel:
read: agi_request: test.agi
read: agi_channel: Local/1@test1-00000006;2
read: agi_language: no
read: agi_type: Local
read: agi_uniqueid: 1473239189.21
read: agi_version: 13.11.0
read: agi_callerid: 94013213
read: agi_calleridname: unknown
read: agi_callingpres: 0
read: agi_callingani2: 0
read: agi_callington: 0
read: agi_callingtns: 0
read: agi_dnid: unknown
read: agi_rdnis: unknown
read: agi_context: test1
read: agi_extension: 1
read: agi_priority: 1
read: agi_enhanced: 0.0
read: agi_accountcode:
read: agi_threadid: 139664920155904
read:
write: GET VARIABLE CALLERID(number)
read: 200 result=1 (94013213)
write: SET VARIABLE "CALLERID(number)" "44444444" <---- Callerid is changed here
read: 200 result=1
write: GET VARIABLE CALLERID(number) <------- New value
read: 200 result=1 (44444444)
write: GET VARIABLE TESTVAR
read: 200 result=0
write: SET VARIABLE "__TESTVAR" "12346789"
read: 200 result=1
write: GET VARIABLE TESTVAR
read: 200 result=1 (12346789)

Second channel:
read: agi_request: test.agi
read: agi_channel: Local/1@test2-00000007;2
read: agi_language: no
read: agi_type: Local
read: agi_uniqueid: 1473239189.23
read: agi_version: 13.11.0
read: agi_callerid: 44444444 <-- Has the correct new value on script start.
read: agi_calleridname: unknown
read: agi_callingpres: 0
read: agi_callingani2: 0
read: agi_callington: 0
read: agi_callingtns: 0
read: agi_dnid: unknown
read: agi_rdnis: unknown
read: agi_context: test2
read: agi_extension: 1
read: agi_priority: 1
read: agi_enhanced: 0.0
read: agi_accountcode:
read: agi_threadid: 139664915076864
read:
write: GET VARIABLE CALLERID(number) <---- This still contrains the OLD value. It is not changed from script starts to here.
read: 200 result=1 (94013213)
write: SET VARIABLE "CALLERID(number)" "44444444"
read: 200 result=1
write: GET VARIABLE CALLERID(number)
read: 200 result=1 (44444444)
write: GET VARIABLE TESTVAR
read: 200 result=1 (12346789)
write: SET VARIABLE "__TESTVAR" "12346789"
read: 200 result=1
write: GET VARIABLE TESTVAR
read: 200 result=1 (12346789)

Comments:By: Asterisk Team (asteriskteam) 2016-09-07 04:54:21.577-0500

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.

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].

By: Mark Michelson (mmichelson) 2016-11-02 12:40:59.710-0500

Based on the change that introduced the problem, I think the issue is that a connected line frame is being deferred until after the AGI completes. That connected line frame is overwriting the caller ID change you made on the channel.

I'll try to devise some way to fix this.

By: Friendly Automation (friendly-automation) 2016-11-08 07:58:51.833-0600

Change 4297 merged by zuul:
Add API for channel frame deferral.

[https://gerrit.asterisk.org/4297|https://gerrit.asterisk.org/4297]

By: Friendly Automation (friendly-automation) 2016-11-08 13:27:14.733-0600

Change 4341 merged by Joshua Colp:
Add API for channel frame deferral.

[https://gerrit.asterisk.org/4341|https://gerrit.asterisk.org/4341]

By: Friendly Automation (friendly-automation) 2016-11-08 13:27:15.953-0600

Change 4343 merged by Joshua Colp:
AGI: Only defer frames when in an interception routine.

[https://gerrit.asterisk.org/4343|https://gerrit.asterisk.org/4343]

By: Friendly Automation (friendly-automation) 2016-11-08 13:27:17.374-0600

Change 4346 merged by Joshua Colp:
autoservice: Use frame deferral API

[https://gerrit.asterisk.org/4346|https://gerrit.asterisk.org/4346]

By: Friendly Automation (friendly-automation) 2016-11-08 13:27:47.171-0600

Change 4340 merged by Joshua Colp:
Add API for channel frame deferral.

[https://gerrit.asterisk.org/4340|https://gerrit.asterisk.org/4340]

By: Friendly Automation (friendly-automation) 2016-11-08 13:27:48.967-0600

Change 4342 merged by Joshua Colp:
AGI: Only defer frames when in an interception routine.

[https://gerrit.asterisk.org/4342|https://gerrit.asterisk.org/4342]

By: Friendly Automation (friendly-automation) 2016-11-08 13:27:50.707-0600

Change 4344 merged by Joshua Colp:
autoservice: Use frame deferral API

[https://gerrit.asterisk.org/4344|https://gerrit.asterisk.org/4344]

By: Friendly Automation (friendly-automation) 2016-11-08 13:28:00.820-0600

Change 4298 merged by Joshua Colp:
AGI: Only defer frames when in an interception routine.

[https://gerrit.asterisk.org/4298|https://gerrit.asterisk.org/4298]

By: Friendly Automation (friendly-automation) 2016-11-08 13:28:02.681-0600

Change 4299 merged by Joshua Colp:
autoservice: Use frame deferral API

[https://gerrit.asterisk.org/4299|https://gerrit.asterisk.org/4299]

By: Friendly Automation (friendly-automation) 2016-11-16 16:56:08.641-0600

Change 4427 merged by Joshua Colp:
channel:  Fix issues in hangup scenarios caused by frame deferral

[https://gerrit.asterisk.org/4427|https://gerrit.asterisk.org/4427]

By: Friendly Automation (friendly-automation) 2016-11-16 17:42:45.614-0600

Change 4422 merged by George Joseph:
channel:  Fix issues in hangup scenarios caused by frame deferral

[https://gerrit.asterisk.org/4422|https://gerrit.asterisk.org/4422]

By: Friendly Automation (friendly-automation) 2016-11-16 17:45:44.969-0600

Change 4417 merged by George Joseph:
channel:  Fix issues in hangup scenarios caused by frame deferral

[https://gerrit.asterisk.org/4417|https://gerrit.asterisk.org/4417]

By: Friendly Automation (friendly-automation) 2017-02-02 17:30:58.016-0600

Change 4881 merged by zuul:
Frame deferral: Revert API refactoring.

[https://gerrit.asterisk.org/4881|https://gerrit.asterisk.org/4881]

By: Friendly Automation (friendly-automation) 2017-02-02 17:56:52.243-0600

Change 4856 merged by zuul:
Frame deferral: Revert API refactoring.

[https://gerrit.asterisk.org/4856|https://gerrit.asterisk.org/4856]

By: Friendly Automation (friendly-automation) 2017-02-02 18:09:39.836-0600

Change 4878 merged by Joshua Colp:
Frame deferral: Revert API refactoring.

[https://gerrit.asterisk.org/4878|https://gerrit.asterisk.org/4878]

By: Friendly Automation (friendly-automation) 2017-02-02 18:09:54.342-0600

Change 4875 merged by Joshua Colp:
Frame deferral: Revert API refactoring.

[https://gerrit.asterisk.org/4875|https://gerrit.asterisk.org/4875]

By: Friendly Automation (friendly-automation) 2017-02-02 22:12:06.884-0600

Change 4857 merged by zuul:
res_agi: Prevent an AGI from eating frames it should not. (Re-do)

[https://gerrit.asterisk.org/4857|https://gerrit.asterisk.org/4857]

By: Friendly Automation (friendly-automation) 2017-02-02 23:22:34.580-0600

Change 4882 merged by zuul:
res_agi: Prevent an AGI from eating frames it should not. (Re-do)

[https://gerrit.asterisk.org/4882|https://gerrit.asterisk.org/4882]

By: Friendly Automation (friendly-automation) 2017-02-02 23:55:10.861-0600

Change 4876 merged by zuul:
res_agi: Prevent an AGI from eating frames it should not. (Re-do)

[https://gerrit.asterisk.org/4876|https://gerrit.asterisk.org/4876]

By: Friendly Automation (friendly-automation) 2017-02-03 05:33:12.204-0600

Change 4879 merged by Joshua Colp:
res_agi: Prevent an AGI from eating frames it should not. (Re-do)

[https://gerrit.asterisk.org/4879|https://gerrit.asterisk.org/4879]