[asterisk-bugs] [JIRA] (ASTERISK-24844) bridge made with wrong channels using their names
Matt Jordan (JIRA)
noreply at issues.asterisk.org
Tue Mar 10 07:29:35 CDT 2015
[ https://issues.asterisk.org/jira/browse/ASTERISK-24844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=225313#comment-225313 ]
Matt Jordan commented on ASTERISK-24844:
----------------------------------------
[~alberto.mu.es]: You are correct that this issue can occur with {{chan_iax2}} channels. This is due to their channel name construction, which - unlike other channel drivers (such as {{chan_sip}}) - does not use a monotonically increasing integer. Instead, it uses the {{callno}} of the channel, which is an IAX2 specific construct. Because the {{callno}} is not padded in the channel name, a {{callno}} for one channel (such as {{22}}) can be a string prefix for another channel (such as {{22196}}). As such, channel prefix lookups - which is how channels are looked up when provided by AMI and other APIs - can pick the wrong channel.
In this case, I don't think we really want to change the behaviour, for the following reasons:
# Changing this in {{chan_iax2}} would have some rather large ramifications, both for expected behaviour by people using the channel driver as well as for the ripple effect in the channel driver.
# This primarily affects only {{chan_iax2}}.
# Changing the lookup mechanism in {{channel.c}} would *definitely* have a major impact on consumers of the APIs.
# There is a valid workaround by using the channel {{uniqueid}}, as you found. In fact, in some of the newer APIs - such as ARI - using the channel {{uniqueid}} is actually the preferred way to address a channel.
As such, I'm going to close this out as Won't Fix, although I appreciate you filing the issue (which was very detailed as well - thanks!) - as this will definitely be useful for anyone else who runs into this problem.
> bridge made with wrong channels using their names
> -------------------------------------------------
>
> Key: ASTERISK-24844
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-24844
> Project: Asterisk
> Issue Type: Bug
> Security Level: None
> Components: Core/Channels
> Affects Versions: 11.6.1
> Environment: ubuntu 12.04 running certified-asterisk-11.6-cert2
> Reporter: Alberto Sanchez Gonzalez
> Assignee: Alberto Sanchez Gonzalez
> Severity: Minor
> Attachments: asterisk_bridge_channels_wronly_with comments.txt
>
>
> Sometimes happened to me that trying to make bridges, through AMI, some of them are made linking channels wrong that I said.
> For example, in a specific moment, I have next 4 channels to bridge, originate in such order, ch1 before ch2, ch2 before ch3, and so on:
> {noformat}
> ch1: dahdi/i1/123456789-c145
> ch2: iax2/pbx8-19952
> ch3: iax2/pbx8-19
> ch4: iax2/pbx8-28577
> {noformat}
> First, I tried to link ch1 and ch2:
> {noformat}
> action: bridge
> actionid: eee7463b-8897-4b1d-b12d-e82957a4c888
> channel1: dahdi/i1/123456789-c145
> channel2: iax2/pbx8-19952
> {noformat}
> And is done ok:
> {noformat}
> event: bridgeaction
> privilege: call,all
> timestamp: 1414076642.188133
> response: success
> channel1: dahdi/i1/123456789-c145
> channel2: iax2/pbx8-19952
> {noformat}
> Second, I tried to link ch3 and ch4
> {noformat}
> action: bridge
> actionid: eee7463b-8897-4b1d-b12d-e82957a4c888
> channel1: iax2/pbx8-19
> channel2: iax2/pbx8-28577
> {noformat}
> But in this case, instead of receive an ok with above channels, I've received:
> {noformat}
> action: bridge
> actionid: eee7463b-8897-4b1d-b12d-e82957a4c888
> channel1: iax2/pbx8-19952
> channel2: iax2/pbx8-28577
> {noformat}
> Notice that the bridge were done between ch4 and ch2, instead of ch4 and ch3.
> We made a workaround of this issue launching the action bridges with their uniqueid's instead of channel name's. But I wanted to open an issue for your knowledge. I don't know if is known or not, I don't find it in the issue tracker.
> PD: We realized of this issue checking in the code, the function {{ast_channel_by_name_cb}} in main/channel.c, which matches channel names taking only the first part of the name.
> PD2: I'm really sorry because I don't have any AMI traces of this issue, happened time ago.
> PD3: Sorry for my English. I hope to be enough clear.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list