[Home]

Summary:ASTERISK-15915: [patch] CallerID not properly set when using Originate and AGI
Reporter:Mark Murawski (kobaz)Labels:
Date Opened:2010-04-05 16:03:43Date Closed:2010-08-09 15:46:53
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_iax2
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) bug17138.patch
Description:Dialplan:

context Dialer_DialPhone {
 s => {
   if ("${PhoneAutoAnswer}" == "1") {
     SIPAddHeader(Call-Info: answer-after=0');
     SIPAddHeader(alert-info: alert-autoanswer');
   }

   Set(CALLERID(name)=${DstCallerIdName});
   Set(CALLERID(num)=${DstCallerIdNum});
   Dial(${PhoneDevice},10);
   Hangup();
 }
}

context Dialer_DialNumber {
 s => {
   Set(CALLERID(name)=${SrcCallerIdName});
   Set(CALLERID(num)=${SrcCallerIdNum});

//   Dial(IAX2/out-tipton-local/${DstNumber},120,r); // this works
   goto ${PhoneClassOfService}, ${DstNumber}, 1; // this doesn't
   
   Hangup();
 }
}

You should be able to override the callerid even if the call will be sent to an agi script.

Note that agi_callerid and agi_calleridname are actually correct as set in the dialplan.. but when the agi executes the Dial... callerid gets sent out as "s <s>" as shown in the iax debug.

Note that callerid is not changed by the agi script.

If you replace the goto, with the Dial() straight from dialplan, CALLING NUMBER and CALLING NAME will be correct in the iax call.

****** ADDITIONAL INFORMATION ******

Exten: s
CallerID: FooBarInc <8005551120>,
Async: true
Channel: Local/s@Dialer_DialPhone
Context: Dialer_DialNumber
Action: Originate
Priority: 1
Timeout: 10000
Variable: DstCallerIdName=Company,DstCallerIdNum=1164,DstNumber=3007,PhoneAutoAnswer=1,PhoneDevice=SIP/201,PhoneClassOfService=cos_internal+local+ld+intl,SrcCallerIdName=FooBarInc,SrcCallerIdNum=8005551120


   -- Executing [s@Dialer_DialPhone:1] GotoIf("Local/s@Dialer_DialPhone-951d;2", "1?2:4") in new stack
   -- Goto (Dialer_DialPhone,s,2)
   -- Executing [s@Dialer_DialPhone:2] SIPAddHeader("Local/s@Dialer_DialPhone-951d;2", "Call-Info: answer-after=0'") in new stack
   -- Executing [s@Dialer_DialPhone:3] SIPAddHeader("Local/s@Dialer_DialPhone-951d;2", "alert-info: alert-autoanswer'") in new stack
   -- Executing [s@Dialer_DialPhone:4] NoOp("Local/s@Dialer_DialPhone-951d;2", "Finish if-Dialer_DialPhone-854") in new stack
   -- Executing [s@Dialer_DialPhone:5] Set("Local/s@Dialer_DialPhone-951d;2", "CALLERID(name)=Company") in new stack
   -- Executing [s@Dialer_DialPhone:6] Setc("Local/s@Dialer_DialPhone-951d;2", "CALLERID(num)=1164") in new stack
   -- Executing [s@Dialer_DialPhone:7] Dial("Local/s@Dialer_DialPhone-951d;2", "SIP/201,10") in new stack
 == Using SIP RTP CoS mark 5
   -- Called 201*CLI>
   -- SIP/201-0000073f is ringing
   -- SIP/201-0000073f answered Local/s@Dialer_DialPhone-951d;2
      > Channel Local/s@Dialer_DialPhone-951d;1 was answered.
   -- Executing [s@Dialer_DialNumber:1] Set("Local/s@Dialer_DialPhone-951d;1", "CALLERID(name)=FooBarInc") in new stack
   -- Executing [s@Dialer_DialNumber:2] Set("Local/s@Dialer_DialPhone-951d;1", "CALLERID(num)=8005551120") in new stack
   -- Executing [s@Dialer_DialNumber:3] Goto("Local/s@Dialer_DialPhone-951d;1", "cos_internal+local+ld+intl,3007,1") in new stack
   -- Goto (cos_internal+local+ld+intl,3007,1)
   -- Executing [3007@cos_internal+local+ld+intl:1] Goto("Local/s@Dialer_DialPhone-951d;1", "_cos_internal+local+ld+intl,3007,1") in new stack
   -- Goto (_cos_internal+local+ld+intl,3007,1)
   -- Executing [3007@_cos_internal+local+ld+intl:1] Gosub("Local/s@Dialer_DialPhone-951d;1", "dialOut,s,1(out-tipton,out,3007)") in new stack
   -- Executing [s@dialOut:1] Set("Local/s@Dialer_DialPhone-951d;1", "LOCAL(route)=out-tipton") in new stack
   -- Executing [s@dialOut:2] Set("Local/s@Dialer_DialPhone-951d;1", "LOCAL(trunkGroup)=out") in new stack
   -- Executing [s@dialOut:3] Set("Local/s@Dialer_DialPhone-951d;1", "LOCAL(number)=3007") in new stack
   -- Executing [s@dialOut:4] Set("Local/s@Dialer_DialPhone-951d;1", "__DeviceState=IN_DIALPLAN") in new stack
   -- Executing [s@dialOut:5] Ringing("Local/s@Dialer_DialPhone-951d;1", "") in new stack
   -- Executing [s@dialOut:6] Set("Local/s@Dialer_DialPhone-951d;1", "ARGS="action=DialOut, route=out-tipton, trunkGroup=out, number=3007"") in new stack
   -- Executing [s@dialOut:7] AGI("Local/s@Dialer_DialPhone-951d;1", "callRouter.pl") in new stack
   -- Launched AGI Script /var/lib/asterisk/agi-bin/callRouter.pl
<Local/s@Dialer_DialPhone-951d;1>AGI Tx >> agi_request: callRouter.pl
<Local/s@Dialer_DialPhone-951d;1>AGI Tx >> agi_channel: Local/s@Dialer_DialPhone-951d;1
<Local/s@Dialer_DialPhone-951d;1>AGI Tx >> agi_language: en
<Local/s@Dialer_DialPhone-951d;1>AGI Tx >> agi_type: Local
<Local/s@Dialer_DialPhone-951d;1>AGI Tx >> agi_uniqueid: 1270501099.3324
<Local/s@Dialer_DialPhone-951d;1>AGI Tx >> agi_version: 1.6.0.26
<Local/s@Dialer_DialPhone-951d;1>AGI Tx >> agi_callerid: 8005551120
<Local/s@Dialer_DialPhone-951d;1>AGI Tx >> agi_calleridname: FooBarInc
<Local/s@Dialer_DialPhone-951d;1>AGI Tx >> agi_callingpres: 0
<Local/s@Dialer_DialPhone-951d;1>AGI Tx >> agi_callingani2: 0
<Local/s@Dialer_DialPhone-951d;1>AGI Tx >> agi_callington: 0
<Local/s@Dialer_DialPhone-951d;1>AGI Tx >> agi_callingtns: 0
<Local/s@Dialer_DialPhone-951d;1>AGI Tx >> agi_dnid: unknown
<Local/s@Dialer_DialPhone-951d;1>AGI Tx >> agi_rdnis: unknown
<Local/s@Dialer_DialPhone-951d;1>AGI Tx >> agi_context: dialOut
<Local/s@Dialer_DialPhone-951d;1>AGI Tx >> agi_extension: s
<Local/s@Dialer_DialPhone-951d;1>AGI Tx >> agi_priority: 7
<Local/s@Dialer_DialPhone-951d;1>AGI Tx >> agi_enhanced: 0.0
<Local/s@Dialer_DialPhone-951d;1>AGI Tx >> agi_accountcode:
<Local/s@Dialer_DialPhone-951d;1>AGI Tx >> agi_threadid: -1228530832
<Local/s@Dialer_DialPhone-951d;1>AGI Tx >>
 == Spawn extension (Dialer_DialPhone, s, 7) exited non-zero on 'Local/s@Dialer_DialPhone-951d;2'
<SIP/201-0000073f>AGI Rx << GET FULL VARIABLE ${ARGS}
<SIP/201-0000073f>AGI Tx >> 200 result=1 (action=DialOut, route=out-tipton, trunkGroup=out, number=3007)
<SIP/201-0000073f>AGI Rx << SET VARIABLE __DeviceState "DIALING"
<SIP/201-0000073f>AGI Tx >> 200 result=1
<SIP/201-0000073f>AGI Rx << GET FULL VARIABLE ${NoCallerId}
<SIP/201-0000073f>AGI Tx >> 200 result=1 ()
<SIP/201-0000073f>AGI Rx << GET FULL VARIABLE ${ExtenPhoneNum}
<SIP/201-0000073f>AGI Tx >> 200 result=1 ()
<SIP/201-0000073f>AGI Rx << GET FULL VARIABLE ${ExtenPhoneGroup}
<SIP/201-0000073f>AGI Tx >> 200 result=1 ()
<SIP/201-0000073f>AGI Rx << EXEC Dial "IAX2/out-tipton-local/3007"|"120"|"r"
   -- AGI Script Executing Application: (Dial) Options: (IAX2/out-tipton-local/3007|120|r)
   -- Called out-tipton-local/3007
Tx-Frame Retry[000] -- OSeqno: 000 ISeqno: 000 Type: IAX     Subclass: NEW
  Timestamp: 00016ms  SCall: 05740  DCall: 00000 [192.168.15.1:4569]
  VERSION         : 2
  CALLED NUMBER   : 3007
  CODEC_PREFS     : (ulaw|alaw|gsm|g726|ilbc)
  CALLING NUMBER  : s
  CALLING PRESNTN : 0
  CALLING TYPEOFN : 0
  CALLING TRANSIT : 0
  CALLING NAME    :
  LANGUAGE        : en
  USERNAME        : branch
  FORMAT          : 4
  CAPABILITY      : 35854
  ADSICPE         : 0
  DATE TIME       : 2010-04-05  16:58:22

Rx-Frame Retry[Yes] -- OSeqno: 000 ISeqno: 001 Type: IAX     Subclass: CTOKEN
  Timestamp: 00016ms  SCall: 00001  DCall: 05740 [192.168.15.1:4569]
  Unknown IE 054  : Present

Tx-Frame Retry[000] -- OSeqno: 000 ISeqno: 000 Type: IAX     Subclass: NEW
  Timestamp: 00021ms  SCall: 05740  DCall: 00000 [192.168.15.1:4569]
  VERSION         : 2
  CALLED NUMBER   : 3007
  CODEC_PREFS     : (ulaw|alaw|gsm|g726|ilbc)
  CALLING NUMBER  : s
  CALLING PRESNTN : 0
  CALLING TYPEOFN : 0
  CALLING TRANSIT : 0
  CALLING NAME    :
  LANGUAGE        : en
  USERNAME        : branch
  FORMAT          : 4
  CAPABILITY      : 35854
  ADSICPE         : 0
  DATE TIME       : 2010-04-05  16:58:22
  Unknown IE 054  : Present

Rx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 001 Type: IAX     Subclass: AUTHREQ
  Timestamp: 00019ms  SCall: 00212  DCall: 05740 [192.168.15.1:4569]
  AUTHMETHODS     : 2
  CHALLENGE       : 208879596
  USERNAME        : branch

Tx-Frame Retry[000] -- OSeqno: 001 ISeqno: 001 Type: IAX     Subclass: AUTHREP
  Timestamp: 00030ms  SCall: 05740  DCall: 00212 [192.168.15.1:4569]
  MD5 RESULT      : 5242c4c0c9a9ba648168b1c9b99ee28a

Rx-Frame Retry[ No] -- OSeqno: 001 ISeqno: 002 Type: IAX     Subclass: ACCEPT
  Timestamp: 00027ms  SCall: 00212  DCall: 05740 [192.168.15.1:4569]
  FORMAT          : 4

   -- Call accepted by 192.168.15.1 (format ulaw)
   -- Format for call is ulaw
Tx-Frame Retry[-01] -- OSeqno: 002 ISeqno: 002 Type: IAX     Subclass: ACK
  Timestamp: 00027ms  SCall: 05740  DCall: 00212 [192.168.15.1:4569]
Rx-Frame Retry[ No] -- OSeqno: 002 ISeqno: 002 Type: CONTROL Subclass: RINGING
  Timestamp: 00030ms  SCall: 00212  DCall: 05740 [192.168.15.1:4569]
Tx-Frame Retry[-01] -- OSeqno: 002 ISeqno: 003 Type: IAX     Subclass: ACK
  Timestamp: 00030ms  SCall: 05740  DCall: 00212 [192.168.15.1:4569]
   -- IAX2/out-tipton-local-5740 is ringing
Rx-Frame Retry[ No] -- OSeqno: 003 ISeqno: 002 Type: CONTROL Subclass: RINGING
  Timestamp: 00343ms  SCall: 00212  DCall: 05740 [192.168.15.1:4569]
Tx-Frame Retry[-01] -- OSeqno: 002 ISeqno: 004 Type: IAX     Subclass: ACK
  Timestamp: 00343ms  SCall: 05740  DCall: 00212 [192.168.15.1:4569]
   -- IAX2/out-tipton-local-5740 is ringing
Rx-Frame Retry[ No] -- OSeqno: 004 ISeqno: 002 Type: CONTROL Subclass: ANSWER
  Timestamp: 01731ms  SCall: 00212  DCall: 05740 [192.168.15.1:4569]
Tx-Frame Retry[-01] -- OSeqno: 002 ISeqno: 005 Type: IAX     Subclass: ACK
  Timestamp: 01731ms  SCall: 05740  DCall: 00212 [192.168.15.1:4569]
Rx-Frame Retry[ No] -- OSeqno: 005 ISeqno: 002 Type: CONTROL Subclass: (255?)
  Timestamp: 01734ms  SCall: 00212  DCall: 05740 [192.168.15.1:4569]
Tx-Frame Retry[-01] -- OSeqno: 002 ISeqno: 006 Type: IAX     Subclass: ACK
  Timestamp: 01734ms  SCall: 05740  DCall: 00212 [192.168.15.1:4569]
Rx-Frame Retry[ No] -- OSeqno: 006 ISeqno: 002 Type: CONTROL Subclass: (20?)
  Timestamp: 01737ms  SCall: 00212  DCall: 05740 [192.168.15.1:4569]
Tx-Frame Retry[-01] -- OSeqno: 002 ISeqno: 007 Type: IAX     Subclass: ACK
  Timestamp: 01737ms  SCall: 05740  DCall: 00212 [192.168.15.1:4569]
   -- IAX2/out-tipton-local-5740 answered SIP/201-0000073f
Tx-Frame Retry[000] -- OSeqno: 002 ISeqno: 007 Type: CONTROL Subclass: (20?)
  Timestamp: 01775ms  SCall: 05740  DCall: 00212 [192.168.15.1:4569]
Rx-Frame Retry[ No] -- OSeqno: 007 ISeqno: 003 Type: IAX     Subclass: ACK
  Timestamp: 01775ms  SCall: 00212  DCall: 05740 [192.168.15.1:4569]
Tx-Frame Retry[000] -- OSeqno: 003 ISeqno: 007 Type: CONTROL Subclass: (20?)
  Timestamp: 01778ms  SCall: 05740  DCall: 00212 [192.168.15.1:4569]
Tx-Frame Retry[000] -- OSeqno: 004 ISeqno: 007 Type: CONTROL Subclass: (20?)
  Timestamp: 01781ms  SCall: 05740  DCall: 00212 [192.168.15.1:4569]
Rx-Frame Retry[ No] -- OSeqno: 007 ISeqno: 004 Type: IAX     Subclass: ACK
  Timestamp: 01778ms  SCall: 00212  DCall: 05740 [192.168.15.1:4569]
Rx-Frame Retry[ No] -- OSeqno: 007 ISeqno: 005 Type: IAX     Subclass: ACK
  Timestamp: 01781ms  SCall: 00212  DCall: 05740 [192.168.15.1:4569]
Tx-Frame Retry[000] -- OSeqno: 005 ISeqno: 007 Type: VOICE   Subclass: 4
  Timestamp: 01779ms  SCall: 05740  DCall: 00212 [192.168.15.1:4569]
Rx-Frame Retry[ No] -- OSeqno: 007 ISeqno: 006 Type: IAX     Subclass: ACK
  Timestamp: 01779ms  SCall: 00212  DCall: 05740 [192.168.15.1:4569]
Rx-Frame Retry[ No] -- OSeqno: 007 ISeqno: 006 Type: VOICE   Subclass: 4
  Timestamp: 01830ms  SCall: 00212  DCall: 05740 [192.168.15.1:4569]
Tx-Frame Retry[-01] -- OSeqno: 006 ISeqno: 008 Type: IAX     Subclass: ACK
  Timestamp: 01830ms  SCall: 05740  DCall: 00212 [192.168.15.1:4569]
Rx-Frame Retry[ No] -- OSeqno: 008 ISeqno: 006 Type: CONTROL Subclass: (20?)
  Timestamp: 02473ms  SCall: 00212  DCall: 05740 [192.168.15.1:4569]
Tx-Frame Retry[-01] -- OSeqno: 006 ISeqno: 009 Type: IAX     Subclass: ACK
  Timestamp: 02473ms  SCall: 05740  DCall: 00212 [192.168.15.1:4569]
Rx-Frame Retry[ No] -- OSeqno: 009 ISeqno: 006 Type: IAX     Subclass: HANGUP
  Timestamp: 02478ms  SCall: 00212  DCall: 05740 [192.168.15.1:4569]
  CAUSE CODE      : 16

Tx-Frame Retry[-01] -- OSeqno: 006 ISeqno: 010 Type: IAX     Subclass: ACK
  Timestamp: 02478ms  SCall: 05740  DCall: 00212 [192.168.15.1:4569]
   -- Hungup 'IAX2/out-tipton-local-5740'
<SIP/201-0000073f>AGI Tx >> 200 result=-1
<SIP/201-0000073f>AGI Rx << GET FULL VARIABLE ${DIALSTATUS}
<SIP/201-0000073f>AGI Tx >> 200 result=1 (ANSWER)
<SIP/201-0000073f>AGI Rx << EXEC Hangup
   -- AGI Script Executing Application: (Hangup) Options: ()
<SIP/201-0000073f>AGI Tx >> 200 result=-1
   -- <SIP/201-0000073f>AGI Script callRouter.pl completed, returning 0
   -- Executing [s@dialOut:8] Return("SIP/201-0000073f", "") in new stack
   -- Auto fallthrough, channel 'SIP/201-0000073f' status is 'ANSWER'
Comments:By: Leif Madsen (lmadsen) 2010-04-06 13:31:11

Based on the information you've provided, I don't see anything wrong with what is happening.

Can you elaborate and point out what is wrong in the console output you've provided? Things seem to be working correctly from what I see.

By: Mark Murawski (kobaz) 2010-04-06 13:36:30

CALLERID(name) and CALLERID(num) are being set
an agi is then called

the iax driver now sends out
CALLING NUMBER : s
CALLING PRESNTN : 0
CALLING TYPEOFN : 0
CALLING TRANSIT : 0

which is incorrect.. since CALLERID(name) is FooBarInc and CALLERID(num) is 8005551120 before the agi... when the call is passed to agi, the successive Dial does not respect the CALLERID values.

By: Paul Belanger (pabelanger) 2010-05-12 12:45:27

Have you tried:

Set(__CALLERID(name)=${SrcCallerIdName});
Set(__CALLERID(num)=${SrcCallerIdNum});

By: Paul Belanger (pabelanger) 2010-05-25 15:21:38

Suspended due to lack of activity. Please request a bug marshal in #asterisk-bugs on the IRC network irc.freenode.net to reopen the issue should you have the additional information requested.

Further information can be found at http://www.asterisk.org/developers/bug-guidelines

By: Mark Murawski (kobaz) 2010-05-25 15:41:42

CALLERID is a function and not a variable, so __CALLERID will not work...

By: Mark Murawski (kobaz) 2010-05-25 15:50:03

16:45 <Kobaz> pabelanger: what's happening is that when agi is executed, the callerid gets set to 's'
16:45 <Kobaz> there's something that's like... locked when you fork to agi
16:46 <Kobaz> <Local/s@Dialer_DialPhone-951d;1>AGI Tx >> agi_calleridname: FooBarInc
16:46 <Kobaz> but yet, iax is sending out 's' for callerid name
16:46 <Kobaz> and it's the same with sip and dahdi and etc... it seems to be happening before the channel driver kicks in

By: Jeff Peeler (jpeeler) 2010-07-22 15:12:21

Kobaz: I must be missing something in reproducing this. You had mentioned in asterisk-dev making a small AGI test script, but I think I just need the actual commands you are using.

By: Mark Murawski (kobaz) 2010-07-22 15:17:09

The commands are at the top of the "additional information" section... But let me do a small test script before I forget again.

By: Mark Murawski (kobaz) 2010-07-22 16:23:38

Here's the scenerio:
I want to call Phone A: SIP/201 (PhoneDevice), and have the callerid of "Company <1164>" show up on this phone (DstCallerIdName/Num)
I want the other leg to call IAX/tipton-local/3007 (DstNumber), and have the callerid of "FooBarInc <8005551120>" (SrcCallerIdName/Num) show up on the other end

----------------------
Dialplan
----------------------

context Dialer_DialPhone {
 s => {
   Set(CALLERID(name)=${DstCallerIdName});
   Set(CALLERID(num)=${DstCallerIdNum});
   Dial(${PhoneDevice},10);
   Hangup();
 }
}

context Dialer_DialNumber {
 s => {
   Set(CALLERID(name)=${SrcCallerIdName});
   Set(CALLERID(num)=${SrcCallerIdNum});

   Dial(IAX2/tipton-local/${DstNumber});
   Hangup();
 }
}

----------------------
AMI
----------------------

Username: admin
Secret: admin
Events: off
Action: Login


Exten: s
CallerID: FooBarInc <8005551120>
Async: true
Channel: Local/s@Dialer_DialPhone
Context: Dialer_DialNumber
Action: Originate
Priority: 1
Timeout: 10000
Variable: DstCallerIdName=Company,DstCallerIdNum=1164,DstNumber=3007,PhoneAutoAnswer=1,PhoneDevice=SIP/201,SrcCallerIdName=FooBarInc,SrcCallerIdNum=8005551120


The above works fine... appropriate devices are dialed, callerids are set right..

===========================
===========================
===========================


Replace Dialer_DialNumber with:

context Dialer_DialNumber {
 s => {
   Set(CALLERID(name)=${SrcCallerIdName});
   Set(CALLERID(num)=${SrcCallerIdNum});

   AGI(agiTest.pl);
   Hangup();
 }
}

And you have a simple agi script:
agiTest.pl
----------
#!/usr/bin/perl

$| = 1;
my $agi;

sub getVar {
 my ($var) = @_;
 print STDOUT "GET FULL VARIABLE \${$var}\n";
 my $val = <STDIN>; chomp($val); $val =~ (/\((.*)\)/); $val = $1;
 return $val;
}

sub setVar {
 my ($var, $val) = @_;
 print STDOUT "SET VARIABLE $var \"$val\"\n";
 my $val = <STDIN>;
 return $val;
}

while (<STDIN>) {
 chomp();
 last if (!length($_));
 if (/^agi_(\w+)\:\s+(.*)$/) { $agi->{$1} = $2; }
}

sleep(5); # <--- delay until local channel is cleaned up... comment this out and callerid will be sent

my $dstNumber = getVar('DstNumber');

#my $srcCallerIdName = getVar('SrcCallerIdName');  # <--- uncomment these, and callerid will always be correct
#setVar('CALLERID(name)', $srcCallerIdName);
#my $srcCallerIdNum = getVar('SrcCallerIdNum');
#setVar('CALLERID(num)', $srcCallerIdNum);

print STDOUT "EXEC Dial IAX2/tipton-local/$dstNumber\n";



--------------------------

I've figured out what's happening... the local channel that the agi is running on, goes away and gets converted to SIP/201... and now you've lost callerid information that was originally set.

By: Jeff Peeler (jpeeler) 2010-07-27 12:36:33

The attached patch should solve the problem, please confirm.

By: Mark Murawski (kobaz) 2010-08-09 12:58:23

Tested and working.  Thanks.

By: Jeff Peeler (jpeeler) 2010-08-09 12:59:29

The patch has changed since requested testing, but it achieves the same result.

By: Digium Subversion (svnbot) 2010-08-09 15:04:28

Repository: asterisk
Revision: 281390

U   branches/1.4/channels/chan_local.c

------------------------------------------------------------------------
r281390 | jpeeler | 2010-08-09 15:04:28 -0500 (Mon, 09 Aug 2010) | 13 lines

Prevent loss of Caller ID information set on local channel after masquerade.

Caller ID set on the channel before a masquerade occurs when using a local
channel would cause the information to be lost. The problem was that the
information was set on a channel destined to be hung up. The somewhat confusing
fix is to detect if any Caller ID has been set on the channel and if so
preswap the Caller ID data so that basically the masquerade puts the data back.

(closes issue ASTERISK-15915)
Reported by: kobaz

Review: https://reviewboard.asterisk.org/r/847/

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=281390

By: Digium Subversion (svnbot) 2010-08-09 15:07:27

Repository: asterisk
Revision: 281391

_U  branches/1.6.2/
U   branches/1.6.2/channels/chan_local.c

------------------------------------------------------------------------
r281391 | jpeeler | 2010-08-09 15:07:27 -0500 (Mon, 09 Aug 2010) | 20 lines

Merged revisions 281390 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
 r281390 | jpeeler | 2010-08-09 15:04:30 -0500 (Mon, 09 Aug 2010) | 13 lines
 
 Prevent loss of Caller ID information set on local channel after masquerade.
 
 Caller ID set on the channel before a masquerade occurs when using a local
 channel would cause the information to be lost. The problem was that the
 information was set on a channel destined to be hung up. The somewhat confusing
 fix is to detect if any Caller ID has been set on the channel and if so
 preswap the Caller ID data so that basically the masquerade puts the data back.
 
 (closes issue ASTERISK-15915)
 Reported by: kobaz
 
 Review: https://reviewboard.asterisk.org/r/847/
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=281391

By: Digium Subversion (svnbot) 2010-08-09 15:43:52

Repository: asterisk
Revision: 281429

_U  branches/1.8/
U   branches/1.8/channels/chan_local.c

------------------------------------------------------------------------
r281429 | jpeeler | 2010-08-09 15:43:52 -0500 (Mon, 09 Aug 2010) | 27 lines

Merged revisions 281391 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
 r281391 | jpeeler | 2010-08-09 15:07:29 -0500 (Mon, 09 Aug 2010) | 20 lines
 
 Merged revisions 281390 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r281390 | jpeeler | 2010-08-09 15:04:30 -0500 (Mon, 09 Aug 2010) | 13 lines
   
   Prevent loss of Caller ID information set on local channel after masquerade.
   
   Caller ID set on the channel before a masquerade occurs when using a local
   channel would cause the information to be lost. The problem was that the
   information was set on a channel destined to be hung up. The somewhat confusing
   fix is to detect if any Caller ID has been set on the channel and if so
   preswap the Caller ID data so that basically the masquerade puts the data back.
   
   (closes issue ASTERISK-15915)
   Reported by: kobaz
   
   Review: https://reviewboard.asterisk.org/r/847/
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=281429

By: Digium Subversion (svnbot) 2010-08-09 15:46:52

Repository: asterisk
Revision: 281431

_U  trunk/
U   trunk/channels/chan_local.c

------------------------------------------------------------------------
r281431 | jpeeler | 2010-08-09 15:46:52 -0500 (Mon, 09 Aug 2010) | 34 lines

Merged revisions 281429 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
 r281429 | jpeeler | 2010-08-09 15:43:54 -0500 (Mon, 09 Aug 2010) | 27 lines
 
 Merged revisions 281391 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.6.2
 
 ................
   r281391 | jpeeler | 2010-08-09 15:07:29 -0500 (Mon, 09 Aug 2010) | 20 lines
   
   Merged revisions 281390 via svnmerge from
   https://origsvn.digium.com/svn/asterisk/branches/1.4
   
   ........
     r281390 | jpeeler | 2010-08-09 15:04:30 -0500 (Mon, 09 Aug 2010) | 13 lines
     
     Prevent loss of Caller ID information set on local channel after masquerade.
     
     Caller ID set on the channel before a masquerade occurs when using a local
     channel would cause the information to be lost. The problem was that the
     information was set on a channel destined to be hung up. The somewhat confusing
     fix is to detect if any Caller ID has been set on the channel and if so
     preswap the Caller ID data so that basically the masquerade puts the data back.
     
     (closes issue ASTERISK-15915)
     Reported by: kobaz
     
     Review: https://reviewboard.asterisk.org/r/847/
   ........
 ................
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=281431