-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Endpoints now have a display name which is used to build a proper caller ID to be used when dialing internal users. This information is also provided by the bouncer so Stasis apps know which caller ID to use for calling the other party. Closes #8.
- Loading branch information
1 parent
7708f59
commit d4254f9
Showing
7 changed files
with
156 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package handler | ||
|
||
import "testing" | ||
|
||
func TestDisplayNameFromClid(t *testing.T) { | ||
cases := map[string]struct { | ||
callerID string | ||
displayName string | ||
}{ | ||
"valid": { | ||
`"Kiwi Snow" <kiwi99>`, | ||
"Kiwi Snow", | ||
}, | ||
"empty": { | ||
"", | ||
"", | ||
}, | ||
"single_colon": { | ||
`"`, | ||
"", | ||
}, | ||
"empty_quotes": { | ||
`""`, | ||
"", | ||
}, | ||
"missing_start_quote": { | ||
`John Smith" <john>`, | ||
"", | ||
}, | ||
"missing_end_quote": { | ||
`"John Smith <john>`, | ||
"", | ||
}, | ||
} | ||
|
||
for name, tt := range cases { | ||
t.Run(name, func(t *testing.T) { | ||
got := displayNameFromClid(tt.callerID) | ||
if got != tt.displayName { | ||
t.Errorf("got %q, want %q", got, tt.displayName) | ||
} | ||
}) | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters