[asterisk-bugs] [JIRA] (ASTERISK-26728) Unique channel names per server

Asterisk Team (JIRA) noreply at issues.asterisk.org
Wed Jan 18 08:43:10 CST 2017


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

Asterisk Team commented on ASTERISK-26728:
------------------------------------------

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

> Unique channel names per server
> -------------------------------
>
>                 Key: ASTERISK-26728
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-26728
>             Project: Asterisk
>          Issue Type: Improvement
>      Security Level: None
>          Components: Channels/chan_pjsip
>    Affects Versions: 13.13.1, 14.2.1
>            Reporter: Andreas Krüger
>            Severity: Critical
>
> We ran into a interesting issue today. We have two servers who both share the same mysql database as backend and are working as a gateway between external calls and internal calls. When people ring, a ODBC write event adds the channel to our database so we can see which active channels / calls there is.
> Suddenly our data seemed corrupted and the system misbehaved a lot.
> Tracking down the issue is that the same SIP trunk is shared on both servers due to the servers sharing the database. As we restarted both servers at the same time, the channel names was made of the sip/endpoint name and a channel counter. But as the have the same name and the counter was reset on the same time (due to restart), both servers actually made the same channel names and not unique names.
> Our current fix is currently to modify the chan_pjsip.c file before compile and change the 
> {code}
> // Line 71
> static unsigned int chan_idx;
> {code}
> and set a random start number (seeding the server) etc:
> {code}
> // Line 71
> static unsigned int chan_idx = 0x5000;
> {code}
> Ideally you would add something server specific (id, uuid) or something to the channel name.
> My suggestion would be to alter the chan_pjsip_new function in chan_pjsip.c.
> I would suspect the place to alter would be this:
> https://github.com/asterisk/asterisk/blob/master/channels/chan_pjsip.c#L456
> Reference file is: https://github.com/asterisk/asterisk/blob/master/channels/chan_pjsip.c



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list