char *ext, *end; ext = ast_strdupa(peer->name); ext = strchr(ext, '/'); *ext = ':'; if ((end = strchr(ext, '-'))) { *end++ = ':'; *end = '\0'; }