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

Joshua Colp (JIRA) noreply at issues.asterisk.org
Wed Jan 18 08:54:10 CST 2017


     [ https://issues.asterisk.org/jira/browse/ASTERISK-26728?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joshua Colp closed ASTERISK-26728.
----------------------------------

    Resolution: Not A Bug

This functionality already exists in the form of a channel uniqueid. Its purpose is to be a unique identifier for a channel and when the systemname option is set it is guaranteed to be globally unique across your installations. You can also use the autosystemname option to use the hostname of the system itself automatically.

> 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