func getTrouterSettings()

in sdk/communication/AzureCommunicationChat/Source/Signaling/TrouterSettings.swift [55:74]


func getTrouterSettings(token: String) throws
    -> (trouterHostname: String, registrarHostnameAndBasePath: String)
{
    let jwt = try decode(jwtToken: token)
    if let skypeId = jwt["skypeid"] as? String {
        if isGcch(id: skypeId) {
            return (gcchTrouterHostname, gcchRegistrarHostnameAndBasePath)
        }
        if isDod(id: skypeId) {
            return (dodTrouterHostname, dodRegistrarHostnameAndBasePath)
        }
    }

    if let resourceLocation = jwt["resourceLocation"] as? String,
       eudbCountries.contains(resourceLocation) {
        return (eudbTrouterHostname, defaultRegistrarHostnameAndBasePath)
    }

    return (defaultTrouterHostname, defaultRegistrarHostnameAndBasePath)
}