[asterisk-bugs] [JIRA] Commented: (ASTERISK-20318) We are using AMI and during load testing we occasionally see two calls with the same channelname. We decided to use the UniqueId for identification purposes, but discovered the channel's uniqueid is not included in the "AsyncAGI" and "AGIExec" events

Richard Mudgett (JIRA) noreply at issues.asterisk.org
Fri Aug 24 15:04:07 CDT 2012


    [ https://issues.asterisk.org/jira/browse/ASTERISK-20318?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=196210#comment-196210 ] 

Richard Mudgett commented on ASTERISK-20318:
--------------------------------------------

I can see why chan_local could conceivably get duplicate channel names:

{code:title=local_new()}
int randnum = ast_random() & 0xffff, fmt = 0;

...

if (!(tmp = ast_channel_alloc(1, state, 0, 0, t, p->exten, p->context, linkedid, ama, "Local/%s@%s-%04x;1", p->exten, p->context, randnum)) 
	|| !(tmp2 = ast_channel_alloc(1, AST_STATE_RING, 0, 0, t, p->exten, p->context, tmp->linkedid, ama, "Local/%s@%s-%04x;2", p->exten, p->context, randnum))) {
{code}

The random number generator can return the same number for different channels.

A similar problem happened with chan_sip before a sequence number was used.  The chan_sip channel names used to use the pointer address of the private structure in its channel name, but on 64 bit systems only the lower 32 bits got used.

> We are using AMI and during load testing we occasionally see two calls with the same channelname.  We decided to use the UniqueId for identification purposes, but discovered the channel's uniqueid is not included in the "AsyncAGI" and "AGIExec" events
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: ASTERISK-20318
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-20318
>             Project: Asterisk
>          Issue Type: Improvement
>      Security Level: None
>          Components: Resources/res_agi
>    Affects Versions: 10.3.1, 10.7.0
>         Environment: Debian 64 bit, virtual machine, SIP.
>            Reporter: Dan Cropp
>            Assignee: Dan Cropp
>            Severity: Minor
>         Attachments: res_agi patch.txt
>
>
> We are using AMI and during load testing we occasionally see two calls with the same channelname.  
> For the load test, we originate calls to ourselves.  Basically a loop back.  We go through a few thousand calls before encountering a case where the channel name matches another channel name.
> We decided to use the UniqueId for identification purposes.  This works great for the calls.  However, since we are using AsyncAGI, we rely on the AsyncAGI related events to also have the UniqueId.
> The channel's uniqueid is not included in the "AsyncAGI" and "AGIExec" events.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list