Skip to content

Commit

Permalink
sipexer: cli flag to set KDMQ method
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Aug 13, 2024
1 parent d4db05b commit a504846
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sipexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ type CLIOptions struct {
notify bool
cancel bool
ack bool
kdmq bool
ruri string
ruser string
fuser string
Expand Down Expand Up @@ -390,6 +391,7 @@ var cliops = CLIOptions{
notify: false,
cancel: false,
ack: false,
kdmq: false,
registerparty: false,
raw: false,
noparse: false,
Expand Down Expand Up @@ -560,6 +562,7 @@ func init() {
flag.BoolVar(&cliops.notify, "notify", cliops.notify, "set method to NOTIFY")
flag.BoolVar(&cliops.cancel, "cancel", cliops.cancel, "set method to CANCEL")
flag.BoolVar(&cliops.ack, "ack", cliops.ack, "set method to ACK")
flag.BoolVar(&cliops.kdmq, "kdmq", cliops.kdmq, "set method to KDMQ")
flag.BoolVar(&cliops.contactbuild, "contact-build", cliops.contactbuild, "build contact header based on local address")
flag.BoolVar(&cliops.contactbuild, "cb", cliops.contactbuild, "build contact header based on local address")
flag.BoolVar(&cliops.registerparty, "register-party", cliops.registerparty, "register a third party To user")
Expand Down Expand Up @@ -1089,6 +1092,8 @@ func SIPExerPrepareTemplateFields(tplfields map[string]interface{}) int {
tplfields["method"] = "CANCEL"
} else if cliops.ack {
tplfields["method"] = "ACK"
} else if cliops.kdmq {
tplfields["method"] = "KDMQ"
} else if len(cliops.method) > 0 {
tplfields["method"] = strings.ToUpper(cliops.method)
}
Expand Down

0 comments on commit a504846

Please sign in to comment.