[asterisk-dev] [Code Review] Prevent caller ID set on channel from getting discarded when originate used with local channel (small patch - review quickly, earn rewards!)

Jeff Peeler jpeeler at digium.com
Fri Aug 6 17:43:42 CDT 2010


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/847/
-----------------------------------------------------------

(Updated 2010-08-06 17:43:42.448671)


Review request for Asterisk Developers.


Changes
-------

This change is localized to chan_local instead of changing any masquerade code. I did investigate trying to force the masquerade to occur before the PBX was started, but that proved to be very problematic. The main problem being that check_bridge is not even run for non-outbound channels. There is similar code trying to preserve other data as well directly above, so I'd really like to continue the trend here.


Summary
-------

The scenario here is that the channel that caller ID is set on is getting swapped with the zombie channel which is hung up and then lost. I am weary of the this change though as I am unsure if the clone channel would ever have valuable caller ID that needs to be swapped.

(Proof that this is not a trap)
To demonstrate the issue put the snippet below in your dialplan, changing the endpoints sip/5001 and sip/5002:

[default]
exten => 5001, 1, dial(sip/5001,,tTkK)

[kobaz3]
exten => s, 1, noop("dialnumber")
exten => s, n, set(CALLERID(name)=FooBarInc)
exten => s, n, set(CALLERID(num)=8005551120)
exten => s, n, set(CHANNEL(callgroup)=3)
exten => s, n, noop("about to wait")
exten => s, n, wait(1) ; delay so that masquerade completes
exten => s, n, noop("done waiting callerid name ${CALLERID(name)}") ; callerid will not have original values
exten => s, n, dial(sip/5002)

And then do an originate:
originate local/5001 extension s at kobaz3


This addresses bug 17138.
    https://issues.asterisk.org/view.php?id=17138


Diffs (updated)
-----

  /branches/1.4/channels/chan_local.c 281221 

Diff: https://reviewboard.asterisk.org/r/847/diff


Testing
-------

Fixes the problematic scenario.


Thanks,

Jeff




More information about the asterisk-dev mailing list