Parse native PJSIP endpoint names with caller display

This commit is contained in:
2026-10-07 16:30:51 +08:00
parent c130041b6c
commit 46c8d92c19
2 changed files with 12 additions and 2 deletions
+3 -1
View File
@@ -41,7 +41,9 @@ type appliedState struct {
Trunks []loadedTrunk `json:"trunks"`
}
var endpointLine = regexp.MustCompile(`(?m)^\s*Endpoint:\s+(\S+)`)
// Asterisk prints Endpoint: <name>/<caller-id>; the slash and caller ID are
// display metadata, not part of the configured endpoint name.
var endpointLine = regexp.MustCompile(`(?m)^[ \t]*Endpoint:[ \t]+([^/< \t\r\n]+)(?:/[^ \t\r\n]+)?`)
func endpointOption(output []byte, name string) string {
for line := range strings.SplitSeq(string(output), "\n") {