| 1 |
|
| 2 |
|
| 3 |
package agimodels |
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
type GosubCommand struct { |
| 9 |
Context string |
| 10 |
Extension string |
| 11 |
Priority int |
| 12 |
OptionalArgument *string |
| 13 |
} |
| 14 |
|
| 15 |
func (cmd GosubCommand) Command() (string, error) { |
| 16 |
s := []interface{}{cmd.CommandString(), cmd.Context, cmd.Extension, cmd.Priority, cmd.OptionalArgument} |
| 17 |
return joinCommand(s), nil |
| 18 |
} |
| 19 |
func (cmd GosubCommand) CommandString() string { |
| 20 |
return "GOSUB" |
| 21 |
} |
| 22 |
|
| 23 |
func (cmd GosubCommand) SetOptionalArgument(v string) GosubCommand { |
| 24 |
cmd.OptionalArgument = &v |
| 25 |
return cmd |
| 26 |
} |
| 27 |
|
| 28 |
func (c *Client) Gosub(context string, extension string, priority int) Response { |
| 29 |
return c.Handler.Command(GosubCommand{ |
| 30 |
Context: context, |
| 31 |
Extension: extension, |
| 32 |
Priority: priority, |
| 33 |
}) |
| 34 |
} |
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
type AnswerCommand struct { |
| 40 |
} |
| 41 |
|
| 42 |
func (cmd AnswerCommand) Command() (string, error) { |
| 43 |
s := []interface{}{cmd.CommandString()} |
| 44 |
return joinCommand(s), nil |
| 45 |
} |
| 46 |
func (cmd AnswerCommand) CommandString() string { |
| 47 |
return "ANSWER" |
| 48 |
} |
| 49 |
|
| 50 |
func (c *Client) Answer() Response { |
| 51 |
return c.Handler.Command(AnswerCommand{}) |
| 52 |
} |
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
type AsyncAGIBreakCommand struct { |
| 58 |
} |
| 59 |
|
| 60 |
func (cmd AsyncAGIBreakCommand) Command() (string, error) { |
| 61 |
s := []interface{}{cmd.CommandString()} |
| 62 |
return joinCommand(s), nil |
| 63 |
} |
| 64 |
func (cmd AsyncAGIBreakCommand) CommandString() string { |
| 65 |
return "ASYNCAGI BREAK" |
| 66 |
} |
| 67 |
|
| 68 |
func (c *Client) AsyncAGIBreak() Response { |
| 69 |
return c.Handler.Command(AsyncAGIBreakCommand{}) |
| 70 |
} |
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
type ChannelStatusCommand struct { |
| 78 |
ChannelName *string |
| 79 |
} |
| 80 |
|
| 81 |
func (cmd ChannelStatusCommand) Command() (string, error) { |
| 82 |
s := []interface{}{cmd.CommandString(), cmd.ChannelName} |
| 83 |
return joinCommand(s), nil |
| 84 |
} |
| 85 |
func (cmd ChannelStatusCommand) CommandString() string { |
| 86 |
return "CHANNEL STATUS" |
| 87 |
} |
| 88 |
|
| 89 |
func (cmd ChannelStatusCommand) SetChannelName(v string) ChannelStatusCommand { |
| 90 |
cmd.ChannelName = &v |
| 91 |
return cmd |
| 92 |
} |
| 93 |
|
| 94 |
func (c *Client) ChannelStatus() Response { |
| 95 |
return c.Handler.Command(ChannelStatusCommand{}) |
| 96 |
} |
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
type ControlStreamFileCommand struct { |
| 104 |
|
| 105 |
FileName string |
| 106 |
EscapeDigits string |
| 107 |
SkipMS *int |
| 108 |
Ffchar *string |
| 109 |
Rewchr *string |
| 110 |
Pausechr *string |
| 111 |
|
| 112 |
OffsetMS *int |
| 113 |
} |
| 114 |
|
| 115 |
func (cmd ControlStreamFileCommand) Command() (string, error) { |
| 116 |
s := []interface{}{cmd.CommandString(), cmd.FileName, cmd.EscapeDigits, cmd.SkipMS, cmd.Ffchar, cmd.Rewchr, cmd.Pausechr, cmd.OffsetMS} |
| 117 |
return joinCommand(s), nil |
| 118 |
} |
| 119 |
func (cmd ControlStreamFileCommand) CommandString() string { |
| 120 |
return "CONTROL STREAM FILE" |
| 121 |
} |
| 122 |
|
| 123 |
func (cmd ControlStreamFileCommand) SetSkipMS(v int) ControlStreamFileCommand { |
| 124 |
cmd.SkipMS = &v |
| 125 |
return cmd |
| 126 |
} |
| 127 |
func (cmd ControlStreamFileCommand) SetFfchar(v string) ControlStreamFileCommand { |
| 128 |
cmd.Ffchar = &v |
| 129 |
return cmd |
| 130 |
} |
| 131 |
func (cmd ControlStreamFileCommand) SetRewchr(v string) ControlStreamFileCommand { |
| 132 |
cmd.Rewchr = &v |
| 133 |
return cmd |
| 134 |
} |
| 135 |
func (cmd ControlStreamFileCommand) SetPausechr(v string) ControlStreamFileCommand { |
| 136 |
cmd.Pausechr = &v |
| 137 |
return cmd |
| 138 |
} |
| 139 |
func (cmd ControlStreamFileCommand) SetOffsetMS(v int) ControlStreamFileCommand { |
| 140 |
cmd.OffsetMS = &v |
| 141 |
return cmd |
| 142 |
} |
| 143 |
|
| 144 |
func (c *Client) ControlStreamFile(fileName string, escapeDigits string) Response { |
| 145 |
return c.Handler.Command(ControlStreamFileCommand{ |
| 146 |
FileName: fileName, |
| 147 |
EscapeDigits: escapeDigits, |
| 148 |
}) |
| 149 |
} |
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
type DatabaseDelCommand struct { |
| 157 |
Family string |
| 158 |
Key string |
| 159 |
} |
| 160 |
|
| 161 |
func (cmd DatabaseDelCommand) Command() (string, error) { |
| 162 |
s := []interface{}{cmd.CommandString(), cmd.Family, cmd.Key} |
| 163 |
return joinCommand(s), nil |
| 164 |
} |
| 165 |
func (cmd DatabaseDelCommand) CommandString() string { |
| 166 |
return "DATABASE DEL" |
| 167 |
} |
| 168 |
|
| 169 |
func (c *Client) DatabaseDel(family string, key string) Response { |
| 170 |
return c.Handler.Command(DatabaseDelCommand{ |
| 171 |
Family: family, |
| 172 |
Key: key, |
| 173 |
}) |
| 174 |
} |
| 175 |
|
| 176 |
|
| 177 |
|
| 178 |
|
| 179 |
|
| 180 |
|
| 181 |
type DatabaseDelTreeCommand struct { |
| 182 |
Family string |
| 183 |
KeyTree *string |
| 184 |
} |
| 185 |
|
| 186 |
func (cmd DatabaseDelTreeCommand) Command() (string, error) { |
| 187 |
s := []interface{}{cmd.CommandString(), cmd.Family, cmd.KeyTree} |
| 188 |
return joinCommand(s), nil |
| 189 |
} |
| 190 |
func (cmd DatabaseDelTreeCommand) CommandString() string { |
| 191 |
return "DATABASE DELTREE" |
| 192 |
} |
| 193 |
|
| 194 |
func (cmd DatabaseDelTreeCommand) SetKeyTree(v string) DatabaseDelTreeCommand { |
| 195 |
cmd.KeyTree = &v |
| 196 |
return cmd |
| 197 |
} |
| 198 |
|
| 199 |
func (c *Client) DatabaseDelTree(family string) Response { |
| 200 |
return c.Handler.Command(DatabaseDelTreeCommand{ |
| 201 |
Family: family, |
| 202 |
}) |
| 203 |
} |
| 204 |
|
| 205 |
|
| 206 |
|
| 207 |
|
| 208 |
|
| 209 |
|
| 210 |
|
| 211 |
|
| 212 |
type DatabaseGetCommand struct { |
| 213 |
Family string |
| 214 |
Key string |
| 215 |
} |
| 216 |
|
| 217 |
func (cmd DatabaseGetCommand) Command() (string, error) { |
| 218 |
s := []interface{}{cmd.CommandString(), cmd.Family, cmd.Key} |
| 219 |
return joinCommand(s), nil |
| 220 |
} |
| 221 |
func (cmd DatabaseGetCommand) CommandString() string { |
| 222 |
return "DATABASE GET" |
| 223 |
} |
| 224 |
|
| 225 |
func (c *Client) DatabaseGet(family string, key string) Response { |
| 226 |
return c.Handler.Command(DatabaseGetCommand{ |
| 227 |
Family: family, |
| 228 |
Key: key, |
| 229 |
}) |
| 230 |
} |
| 231 |
|
| 232 |
|
| 233 |
|
| 234 |
|
| 235 |
|
| 236 |
|
| 237 |
type DatabasePutCommand struct { |
| 238 |
Family string |
| 239 |
Key string |
| 240 |
Value string |
| 241 |
} |
| 242 |
|
| 243 |
func (cmd DatabasePutCommand) Command() (string, error) { |
| 244 |
s := []interface{}{cmd.CommandString(), cmd.Family, cmd.Key, cmd.Value} |
| 245 |
return joinCommand(s), nil |
| 246 |
} |
| 247 |
func (cmd DatabasePutCommand) CommandString() string { |
| 248 |
return "DATABASE PUT" |
| 249 |
} |
| 250 |
|
| 251 |
func (c *Client) DatabasePut(family string, key string, value string) Response { |
| 252 |
return c.Handler.Command(DatabasePutCommand{ |
| 253 |
Family: family, |
| 254 |
Key: key, |
| 255 |
Value: value, |
| 256 |
}) |
| 257 |
} |
| 258 |
|
| 259 |
|
| 260 |
|
| 261 |
|
| 262 |
|
| 263 |
|
| 264 |
type ExecCommand struct { |
| 265 |
Application string |
| 266 |
Options string |
| 267 |
} |
| 268 |
|
| 269 |
func (cmd ExecCommand) Command() (string, error) { |
| 270 |
s := []interface{}{cmd.CommandString(), cmd.Application, cmd.Options} |
| 271 |
return joinCommand(s), nil |
| 272 |
} |
| 273 |
func (cmd ExecCommand) CommandString() string { |
| 274 |
return "EXEC" |
| 275 |
} |
| 276 |
|
| 277 |
func (c *Client) Exec(application string, options string) Response { |
| 278 |
return c.Handler.Command(ExecCommand{ |
| 279 |
Application: application, |
| 280 |
Options: options, |
| 281 |
}) |
| 282 |
} |
| 283 |
|
| 284 |
|
| 285 |
|
| 286 |
|
| 287 |
|
| 288 |
|
| 289 |
type GetDataCommand struct { |
| 290 |
File string |
| 291 |
Timeout *int |
| 292 |
Maxdigits *string |
| 293 |
} |
| 294 |
|
| 295 |
func (cmd GetDataCommand) Command() (string, error) { |
| 296 |
s := []interface{}{cmd.CommandString(), cmd.File, cmd.Timeout, cmd.Maxdigits} |
| 297 |
return joinCommand(s), nil |
| 298 |
} |
| 299 |
func (cmd GetDataCommand) CommandString() string { |
| 300 |
return "GET DATA" |
| 301 |
} |
| 302 |
|
| 303 |
func (cmd GetDataCommand) SetTimeout(v int) GetDataCommand { |
| 304 |
cmd.Timeout = &v |
| 305 |
return cmd |
| 306 |
} |
| 307 |
func (cmd GetDataCommand) SetMaxdigits(v string) GetDataCommand { |
| 308 |
cmd.Maxdigits = &v |
| 309 |
return cmd |
| 310 |
} |
| 311 |
|
| 312 |
func (c *Client) GetData(file string) Response { |
| 313 |
return c.Handler.Command(GetDataCommand{ |
| 314 |
File: file, |
| 315 |
}) |
| 316 |
} |
| 317 |
|
| 318 |
|
| 319 |
|
| 320 |
|
| 321 |
|
| 322 |
|
| 323 |
|
| 324 |
|
| 325 |
|
| 326 |
|
| 327 |
type GetFullVariableCommand struct { |
| 328 |
Expression string |
| 329 |
ChannelName *string |
| 330 |
} |
| 331 |
|
| 332 |
func (cmd GetFullVariableCommand) Command() (string, error) { |
| 333 |
s := []interface{}{cmd.CommandString(), cmd.Expression, cmd.ChannelName} |
| 334 |
return joinCommand(s), nil |
| 335 |
} |
| 336 |
func (cmd GetFullVariableCommand) CommandString() string { |
| 337 |
return "GET FULL VARIABLE" |
| 338 |
} |
| 339 |
|
| 340 |
func (cmd GetFullVariableCommand) SetChannelName(v string) GetFullVariableCommand { |
| 341 |
cmd.ChannelName = &v |
| 342 |
return cmd |
| 343 |
} |
| 344 |
|
| 345 |
func (c *Client) GetFullVariable(expression string) Response { |
| 346 |
return c.Handler.Command(GetFullVariableCommand{ |
| 347 |
Expression: expression, |
| 348 |
}) |
| 349 |
} |
| 350 |
|
| 351 |
|
| 352 |
|
| 353 |
|
| 354 |
type GetOptionCommand struct { |
| 355 |
FileName string |
| 356 |
EscapeDigits string |
| 357 |
Timeout *int |
| 358 |
} |
| 359 |
|
| 360 |
func (cmd GetOptionCommand) Command() (string, error) { |
| 361 |
s := []interface{}{cmd.CommandString(), cmd.FileName, cmd.EscapeDigits, cmd.Timeout} |
| 362 |
return joinCommand(s), nil |
| 363 |
} |
| 364 |
func (cmd GetOptionCommand) CommandString() string { |
| 365 |
return "GET OPTION" |
| 366 |
} |
| 367 |
|
| 368 |
func (cmd GetOptionCommand) SetTimeout(v int) GetOptionCommand { |
| 369 |
cmd.Timeout = &v |
| 370 |
return cmd |
| 371 |
} |
| 372 |
|
| 373 |
func (c *Client) GetOption(fileName string, escapeDigits string) Response { |
| 374 |
return c.Handler.Command(GetOptionCommand{ |
| 375 |
FileName: fileName, |
| 376 |
EscapeDigits: escapeDigits, |
| 377 |
}) |
| 378 |
} |
| 379 |
|
| 380 |
|
| 381 |
|
| 382 |
|
| 383 |
|
| 384 |
|
| 385 |
type GetVariableCommand struct { |
| 386 |
VariableName string |
| 387 |
} |
| 388 |
|
| 389 |
func (cmd GetVariableCommand) Command() (string, error) { |
| 390 |
s := []interface{}{cmd.CommandString(), cmd.VariableName} |
| 391 |
return joinCommand(s), nil |
| 392 |
} |
| 393 |
func (cmd GetVariableCommand) CommandString() string { |
| 394 |
return "GET VARIABLE" |
| 395 |
} |
| 396 |
|
| 397 |
func (c *Client) GetVariable(variableName string) Response { |
| 398 |
return c.Handler.Command(GetVariableCommand{ |
| 399 |
VariableName: variableName, |
| 400 |
}) |
| 401 |
} |
| 402 |
|
| 403 |
|
| 404 |
|
| 405 |
|
| 406 |
type HangupCommand struct { |
| 407 |
ChannelName *string |
| 408 |
} |
| 409 |
|
| 410 |
func (cmd HangupCommand) Command() (string, error) { |
| 411 |
s := []interface{}{cmd.CommandString(), cmd.ChannelName} |
| 412 |
return joinCommand(s), nil |
| 413 |
} |
| 414 |
func (cmd HangupCommand) CommandString() string { |
| 415 |
return "HANGUP" |
| 416 |
} |
| 417 |
|
| 418 |
func (cmd HangupCommand) SetChannelName(v string) HangupCommand { |
| 419 |
cmd.ChannelName = &v |
| 420 |
return cmd |
| 421 |
} |
| 422 |
|
| 423 |
func (c *Client) Hangup() Response { |
| 424 |
return c.Handler.Command(HangupCommand{}) |
| 425 |
} |
| 426 |
|
| 427 |
|
| 428 |
|
| 429 |
|
| 430 |
type NoopCommand struct { |
| 431 |
} |
| 432 |
|
| 433 |
func (cmd NoopCommand) Command() (string, error) { |
| 434 |
s := []interface{}{cmd.CommandString()} |
| 435 |
return joinCommand(s), nil |
| 436 |
} |
| 437 |
func (cmd NoopCommand) CommandString() string { |
| 438 |
return "NOOP" |
| 439 |
} |
| 440 |
|
| 441 |
func (c *Client) Noop() Response { |
| 442 |
return c.Handler.Command(NoopCommand{}) |
| 443 |
} |
| 444 |
|
| 445 |
|
| 446 |
|
| 447 |
|
| 448 |
type ReceiveCharCommand struct { |
| 449 |
|
| 450 |
Timeout int |
| 451 |
} |
| 452 |
|
| 453 |
func (cmd ReceiveCharCommand) Command() (string, error) { |
| 454 |
s := []interface{}{cmd.CommandString(), cmd.Timeout} |
| 455 |
return joinCommand(s), nil |
| 456 |
} |
| 457 |
func (cmd ReceiveCharCommand) CommandString() string { |
| 458 |
return "RECEIVE CHAR" |
| 459 |
} |
| 460 |
|
| 461 |
func (c *Client) ReceiveChar(timeout int) Response { |
| 462 |
return c.Handler.Command(ReceiveCharCommand{ |
| 463 |
Timeout: timeout, |
| 464 |
}) |
| 465 |
} |
| 466 |
|
| 467 |
|
| 468 |
|
| 469 |
|
| 470 |
type ReceiveTextCommand struct { |
| 471 |
|
| 472 |
Timeout int |
| 473 |
} |
| 474 |
|
| 475 |
func (cmd ReceiveTextCommand) Command() (string, error) { |
| 476 |
s := []interface{}{cmd.CommandString(), cmd.Timeout} |
| 477 |
return joinCommand(s), nil |
| 478 |
} |
| 479 |
func (cmd ReceiveTextCommand) CommandString() string { |
| 480 |
return "RECEIVE TEXT" |
| 481 |
} |
| 482 |
|
| 483 |
func (c *Client) ReceiveText(timeout int) Response { |
| 484 |
return c.Handler.Command(ReceiveTextCommand{ |
| 485 |
Timeout: timeout, |
| 486 |
}) |
| 487 |
} |
| 488 |
|
| 489 |
|
| 490 |
|
| 491 |
|
| 492 |
type RecordFileCommand struct { |
| 493 |
|
| 494 |
FileName string |
| 495 |
|
| 496 |
Format string |
| 497 |
|
| 498 |
EscapeDigits string |
| 499 |
|
| 500 |
Timeout int |
| 501 |
|
| 502 |
OffsetSamples *string |
| 503 |
|
| 504 |
Beep *string |
| 505 |
|
| 506 |
SSilence *string |
| 507 |
} |
| 508 |
|
| 509 |
func (cmd RecordFileCommand) Command() (string, error) { |
| 510 |
s := []interface{}{cmd.CommandString(), cmd.FileName, cmd.Format, cmd.EscapeDigits, cmd.Timeout, cmd.OffsetSamples, cmd.Beep, cmd.SSilence} |
| 511 |
return joinCommand(s), nil |
| 512 |
} |
| 513 |
func (cmd RecordFileCommand) CommandString() string { |
| 514 |
return "RECORD FILE" |
| 515 |
} |
| 516 |
|
| 517 |
func (cmd RecordFileCommand) SetOffsetSamples(v string) RecordFileCommand { |
| 518 |
cmd.OffsetSamples = &v |
| 519 |
return cmd |
| 520 |
} |
| 521 |
func (cmd RecordFileCommand) SetBeep(v string) RecordFileCommand { |
| 522 |
cmd.Beep = &v |
| 523 |
return cmd |
| 524 |
} |
| 525 |
func (cmd RecordFileCommand) SetSSilence(v string) RecordFileCommand { |
| 526 |
cmd.SSilence = &v |
| 527 |
return cmd |
| 528 |
} |
| 529 |
|
| 530 |
func (c *Client) RecordFile(fileName string, format string, escapeDigits string, timeout int) Response { |
| 531 |
return c.Handler.Command(RecordFileCommand{ |
| 532 |
FileName: fileName, |
| 533 |
Format: format, |
| 534 |
EscapeDigits: escapeDigits, |
| 535 |
Timeout: timeout, |
| 536 |
}) |
| 537 |
} |
| 538 |
|
| 539 |
|
| 540 |
|
| 541 |
|
| 542 |
type SayAlphaCommand struct { |
| 543 |
Number string |
| 544 |
EscapeDigits string |
| 545 |
} |
| 546 |
|
| 547 |
func (cmd SayAlphaCommand) Command() (string, error) { |
| 548 |
s := []interface{}{cmd.CommandString(), cmd.Number, cmd.EscapeDigits} |
| 549 |
return joinCommand(s), nil |
| 550 |
} |
| 551 |
func (cmd SayAlphaCommand) CommandString() string { |
| 552 |
return "SAY ALPHA" |
| 553 |
} |
| 554 |
|
| 555 |
func (c *Client) SayAlpha(number string, escapeDigits string) Response { |
| 556 |
return c.Handler.Command(SayAlphaCommand{ |
| 557 |
Number: number, |
| 558 |
EscapeDigits: escapeDigits, |
| 559 |
}) |
| 560 |
} |
| 561 |
|
| 562 |
|
| 563 |
|
| 564 |
|
| 565 |
type SayDigitsCommand struct { |
| 566 |
Number string |
| 567 |
EscapeDigits string |
| 568 |
} |
| 569 |
|
| 570 |
func (cmd SayDigitsCommand) Command() (string, error) { |
| 571 |
s := []interface{}{cmd.CommandString(), cmd.Number, cmd.EscapeDigits} |
| 572 |
return joinCommand(s), nil |
| 573 |
} |
| 574 |
func (cmd SayDigitsCommand) CommandString() string { |
| 575 |
return "SAY DIGITS" |
| 576 |
} |
| 577 |
|
| 578 |
func (c *Client) SayDigits(number string, escapeDigits string) Response { |
| 579 |
return c.Handler.Command(SayDigitsCommand{ |
| 580 |
Number: number, |
| 581 |
EscapeDigits: escapeDigits, |
| 582 |
}) |
| 583 |
} |
| 584 |
|
| 585 |
|
| 586 |
|
| 587 |
|
| 588 |
type SayNumberCommand struct { |
| 589 |
Number string |
| 590 |
EscapeDigits string |
| 591 |
Gender *string |
| 592 |
} |
| 593 |
|
| 594 |
func (cmd SayNumberCommand) Command() (string, error) { |
| 595 |
s := []interface{}{cmd.CommandString(), cmd.Number, cmd.EscapeDigits, cmd.Gender} |
| 596 |
return joinCommand(s), nil |
| 597 |
} |
| 598 |
func (cmd SayNumberCommand) CommandString() string { |
| 599 |
return "SAY NUMBER" |
| 600 |
} |
| 601 |
|
| 602 |
func (cmd SayNumberCommand) SetGender(v string) SayNumberCommand { |
| 603 |
cmd.Gender = &v |
| 604 |
return cmd |
| 605 |
} |
| 606 |
|
| 607 |
func (c *Client) SayNumber(number string, escapeDigits string) Response { |
| 608 |
return c.Handler.Command(SayNumberCommand{ |
| 609 |
Number: number, |
| 610 |
EscapeDigits: escapeDigits, |
| 611 |
}) |
| 612 |
} |
| 613 |
|
| 614 |
|
| 615 |
|
| 616 |
|
| 617 |
type SayPhoneticCommand struct { |
| 618 |
String string |
| 619 |
EscapeDigits string |
| 620 |
} |
| 621 |
|
| 622 |
func (cmd SayPhoneticCommand) Command() (string, error) { |
| 623 |
s := []interface{}{cmd.CommandString(), cmd.String, cmd.EscapeDigits} |
| 624 |
return joinCommand(s), nil |
| 625 |
} |
| 626 |
func (cmd SayPhoneticCommand) CommandString() string { |
| 627 |
return "SAY PHONETIC" |
| 628 |
} |
| 629 |
|
| 630 |
func (c *Client) SayPhonetic(string string, escapeDigits string) Response { |
| 631 |
return c.Handler.Command(SayPhoneticCommand{ |
| 632 |
String: string, |
| 633 |
EscapeDigits: escapeDigits, |
| 634 |
}) |
| 635 |
} |
| 636 |
|
| 637 |
|
| 638 |
|
| 639 |
|
| 640 |
type SayDateCommand struct { |
| 641 |
|
| 642 |
Date string |
| 643 |
EscapeDigits string |
| 644 |
} |
| 645 |
|
| 646 |
func (cmd SayDateCommand) Command() (string, error) { |
| 647 |
s := []interface{}{cmd.CommandString(), cmd.Date, cmd.EscapeDigits} |
| 648 |
return joinCommand(s), nil |
| 649 |
} |
| 650 |
func (cmd SayDateCommand) CommandString() string { |
| 651 |
return "SAY DATE" |
| 652 |
} |
| 653 |
|
| 654 |
func (c *Client) SayDate(date string, escapeDigits string) Response { |
| 655 |
return c.Handler.Command(SayDateCommand{ |
| 656 |
Date: date, |
| 657 |
EscapeDigits: escapeDigits, |
| 658 |
}) |
| 659 |
} |
| 660 |
|
| 661 |
|
| 662 |
|
| 663 |
|
| 664 |
type SayTimeCommand struct { |
| 665 |
|
| 666 |
Time float64 |
| 667 |
EscapeDigits string |
| 668 |
} |
| 669 |
|
| 670 |
func (cmd SayTimeCommand) Command() (string, error) { |
| 671 |
s := []interface{}{cmd.CommandString(), cmd.Time, cmd.EscapeDigits} |
| 672 |
return joinCommand(s), nil |
| 673 |
} |
| 674 |
func (cmd SayTimeCommand) CommandString() string { |
| 675 |
return "SAY TIME" |
| 676 |
} |
| 677 |
|
| 678 |
func (c *Client) SayTime(time float64, escapeDigits string) Response { |
| 679 |
return c.Handler.Command(SayTimeCommand{ |
| 680 |
Time: time, |
| 681 |
EscapeDigits: escapeDigits, |
| 682 |
}) |
| 683 |
} |
| 684 |
|
| 685 |
|
| 686 |
|
| 687 |
|
| 688 |
type SayDatetimeCommand struct { |
| 689 |
|
| 690 |
Time float64 |
| 691 |
EscapeDigits string |
| 692 |
|
| 693 |
Format *string |
| 694 |
|
| 695 |
Timezone *string |
| 696 |
} |
| 697 |
|
| 698 |
func (cmd SayDatetimeCommand) Command() (string, error) { |
| 699 |
s := []interface{}{cmd.CommandString(), cmd.Time, cmd.EscapeDigits, cmd.Format, cmd.Timezone} |
| 700 |
return joinCommand(s), nil |
| 701 |
} |
| 702 |
func (cmd SayDatetimeCommand) CommandString() string { |
| 703 |
return "SAY DATETIME" |
| 704 |
} |
| 705 |
|
| 706 |
func (cmd SayDatetimeCommand) SetFormat(v string) SayDatetimeCommand { |
| 707 |
cmd.Format = &v |
| 708 |
return cmd |
| 709 |
} |
| 710 |
func (cmd SayDatetimeCommand) SetTimezone(v string) SayDatetimeCommand { |
| 711 |
cmd.Timezone = &v |
| 712 |
return cmd |
| 713 |
} |
| 714 |
|
| 715 |
func (c *Client) SayDatetime(time float64, escapeDigits string) Response { |
| 716 |
return c.Handler.Command(SayDatetimeCommand{ |
| 717 |
Time: time, |
| 718 |
EscapeDigits: escapeDigits, |
| 719 |
}) |
| 720 |
} |
| 721 |
|
| 722 |
|
| 723 |
|
| 724 |
|
| 725 |
type SendImageCommand struct { |
| 726 |
Image string |
| 727 |
} |
| 728 |
|
| 729 |
func (cmd SendImageCommand) Command() (string, error) { |
| 730 |
s := []interface{}{cmd.CommandString(), cmd.Image} |
| 731 |
return joinCommand(s), nil |
| 732 |
} |
| 733 |
func (cmd SendImageCommand) CommandString() string { |
| 734 |
return "SEND IMAGE" |
| 735 |
} |
| 736 |
|
| 737 |
func (c *Client) SendImage(image string) Response { |
| 738 |
return c.Handler.Command(SendImageCommand{ |
| 739 |
Image: image, |
| 740 |
}) |
| 741 |
} |
| 742 |
|
| 743 |
|
| 744 |
|
| 745 |
|
| 746 |
type SendTextCommand struct { |
| 747 |
|
| 748 |
TextToSend string |
| 749 |
} |
| 750 |
|
| 751 |
func (cmd SendTextCommand) Command() (string, error) { |
| 752 |
s := []interface{}{cmd.CommandString(), cmd.TextToSend} |
| 753 |
return joinCommand(s), nil |
| 754 |
} |
| 755 |
func (cmd SendTextCommand) CommandString() string { |
| 756 |
return "SEND TEXT" |
| 757 |
} |
| 758 |
|
| 759 |
func (c *Client) SendText(textToSend string) Response { |
| 760 |
return c.Handler.Command(SendTextCommand{ |
| 761 |
TextToSend: textToSend, |
| 762 |
}) |
| 763 |
} |
| 764 |
|
| 765 |
|
| 766 |
|
| 767 |
|
| 768 |
type SetAutoHangupCommand struct { |
| 769 |
Time float64 |
| 770 |
} |
| 771 |
|
| 772 |
func (cmd SetAutoHangupCommand) Command() (string, error) { |
| 773 |
s := []interface{}{cmd.CommandString(), cmd.Time} |
| 774 |
return joinCommand(s), nil |
| 775 |
} |
| 776 |
func (cmd SetAutoHangupCommand) CommandString() string { |
| 777 |
return "SET AUTOHANGUP" |
| 778 |
} |
| 779 |
|
| 780 |
func (c *Client) SetAutoHangup(time float64) Response { |
| 781 |
return c.Handler.Command(SetAutoHangupCommand{ |
| 782 |
Time: time, |
| 783 |
}) |
| 784 |
} |
| 785 |
|
| 786 |
|
| 787 |
|
| 788 |
|
| 789 |
type SetCallerIDCommand struct { |
| 790 |
Number string |
| 791 |
} |
| 792 |
|
| 793 |
func (cmd SetCallerIDCommand) Command() (string, error) { |
| 794 |
s := []interface{}{cmd.CommandString(), cmd.Number} |
| 795 |
return joinCommand(s), nil |
| 796 |
} |
| 797 |
func (cmd SetCallerIDCommand) CommandString() string { |
| 798 |
return "SET CALLERID" |
| 799 |
} |
| 800 |
|
| 801 |
func (c *Client) SetCallerID(number string) Response { |
| 802 |
return c.Handler.Command(SetCallerIDCommand{ |
| 803 |
Number: number, |
| 804 |
}) |
| 805 |
} |
| 806 |
|
| 807 |
|
| 808 |
|
| 809 |
|
| 810 |
type SetContextCommand struct { |
| 811 |
DesiredContext string |
| 812 |
} |
| 813 |
|
| 814 |
func (cmd SetContextCommand) Command() (string, error) { |
| 815 |
s := []interface{}{cmd.CommandString(), cmd.DesiredContext} |
| 816 |
return joinCommand(s), nil |
| 817 |
} |
| 818 |
func (cmd SetContextCommand) CommandString() string { |
| 819 |
return "SET CONTEXT" |
| 820 |
} |
| 821 |
|
| 822 |
func (c *Client) SetContext(desiredContext string) Response { |
| 823 |
return c.Handler.Command(SetContextCommand{ |
| 824 |
DesiredContext: desiredContext, |
| 825 |
}) |
| 826 |
} |
| 827 |
|
| 828 |
|
| 829 |
|
| 830 |
|
| 831 |
type SetExtensionCommand struct { |
| 832 |
NewExtension string |
| 833 |
} |
| 834 |
|
| 835 |
func (cmd SetExtensionCommand) Command() (string, error) { |
| 836 |
s := []interface{}{cmd.CommandString(), cmd.NewExtension} |
| 837 |
return joinCommand(s), nil |
| 838 |
} |
| 839 |
func (cmd SetExtensionCommand) CommandString() string { |
| 840 |
return "SET EXTENSION" |
| 841 |
} |
| 842 |
|
| 843 |
func (c *Client) SetExtension(newExtension string) Response { |
| 844 |
return c.Handler.Command(SetExtensionCommand{ |
| 845 |
NewExtension: newExtension, |
| 846 |
}) |
| 847 |
} |
| 848 |
|
| 849 |
|
| 850 |
|
| 851 |
|
| 852 |
|
| 853 |
|
| 854 |
type SetMusicCommand struct { |
| 855 |
Class string |
| 856 |
|
| 857 |
} |
| 858 |
|
| 859 |
func (cmd SetMusicCommand) Command() (string, error) { |
| 860 |
s := []interface{}{cmd.CommandString(), cmd.Class} |
| 861 |
return joinCommand(s), nil |
| 862 |
} |
| 863 |
func (cmd SetMusicCommand) CommandString() string { |
| 864 |
return "SET MUSIC" |
| 865 |
} |
| 866 |
|
| 867 |
func (c *Client) SetMusic(class string) Response { |
| 868 |
return c.Handler.Command(SetMusicCommand{ |
| 869 |
Class: class, |
| 870 |
}) |
| 871 |
} |
| 872 |
|
| 873 |
|
| 874 |
|
| 875 |
|
| 876 |
type SetPriorityCommand struct { |
| 877 |
Priority int |
| 878 |
} |
| 879 |
|
| 880 |
func (cmd SetPriorityCommand) Command() (string, error) { |
| 881 |
s := []interface{}{cmd.CommandString(), cmd.Priority} |
| 882 |
return joinCommand(s), nil |
| 883 |
} |
| 884 |
func (cmd SetPriorityCommand) CommandString() string { |
| 885 |
return "SET PRIORITY" |
| 886 |
} |
| 887 |
|
| 888 |
func (c *Client) SetPriority(priority int) Response { |
| 889 |
return c.Handler.Command(SetPriorityCommand{ |
| 890 |
Priority: priority, |
| 891 |
}) |
| 892 |
} |
| 893 |
|
| 894 |
|
| 895 |
|
| 896 |
|
| 897 |
type SetVariableCommand struct { |
| 898 |
VariableName string |
| 899 |
Value string |
| 900 |
} |
| 901 |
|
| 902 |
func (cmd SetVariableCommand) Command() (string, error) { |
| 903 |
s := []interface{}{cmd.CommandString(), cmd.VariableName, cmd.Value} |
| 904 |
return joinCommand(s), nil |
| 905 |
} |
| 906 |
func (cmd SetVariableCommand) CommandString() string { |
| 907 |
return "SET VARIABLE" |
| 908 |
} |
| 909 |
|
| 910 |
func (c *Client) SetVariable(variableName string, value string) Response { |
| 911 |
return c.Handler.Command(SetVariableCommand{ |
| 912 |
VariableName: variableName, |
| 913 |
Value: value, |
| 914 |
}) |
| 915 |
} |
| 916 |
|
| 917 |
|
| 918 |
|
| 919 |
|
| 920 |
|
| 921 |
|
| 922 |
type StreamFileCommand struct { |
| 923 |
|
| 924 |
FileName string |
| 925 |
|
| 926 |
EscapeDigits string |
| 927 |
|
| 928 |
SampleOffset *int |
| 929 |
} |
| 930 |
|
| 931 |
func (cmd StreamFileCommand) Command() (string, error) { |
| 932 |
s := []interface{}{cmd.CommandString(), cmd.FileName, cmd.EscapeDigits, cmd.SampleOffset} |
| 933 |
return joinCommand(s), nil |
| 934 |
} |
| 935 |
func (cmd StreamFileCommand) CommandString() string { |
| 936 |
return "STREAM FILE" |
| 937 |
} |
| 938 |
|
| 939 |
func (cmd StreamFileCommand) SetSampleOffset(v int) StreamFileCommand { |
| 940 |
cmd.SampleOffset = &v |
| 941 |
return cmd |
| 942 |
} |
| 943 |
|
| 944 |
func (c *Client) StreamFile(fileName string, escapeDigits string) Response { |
| 945 |
return c.Handler.Command(StreamFileCommand{ |
| 946 |
FileName: fileName, |
| 947 |
EscapeDigits: escapeDigits, |
| 948 |
}) |
| 949 |
} |
| 950 |
|
| 951 |
|
| 952 |
|
| 953 |
|
| 954 |
type TddModeCommand struct { |
| 955 |
Boolean string |
| 956 |
} |
| 957 |
|
| 958 |
func (cmd TddModeCommand) Command() (string, error) { |
| 959 |
s := []interface{}{cmd.CommandString(), cmd.Boolean} |
| 960 |
return joinCommand(s), nil |
| 961 |
} |
| 962 |
func (cmd TddModeCommand) CommandString() string { |
| 963 |
return "TDD MODE" |
| 964 |
} |
| 965 |
|
| 966 |
func (c *Client) TddMode(boolean string) Response { |
| 967 |
return c.Handler.Command(TddModeCommand{ |
| 968 |
Boolean: boolean, |
| 969 |
}) |
| 970 |
} |
| 971 |
|
| 972 |
|
| 973 |
|
| 974 |
|
| 975 |
type VerboseCommand struct { |
| 976 |
Message string |
| 977 |
Level string |
| 978 |
} |
| 979 |
|
| 980 |
func (cmd VerboseCommand) Command() (string, error) { |
| 981 |
s := []interface{}{cmd.CommandString(), cmd.Message, cmd.Level} |
| 982 |
return joinCommand(s), nil |
| 983 |
} |
| 984 |
func (cmd VerboseCommand) CommandString() string { |
| 985 |
return "VERBOSE" |
| 986 |
} |
| 987 |
|
| 988 |
func (c *Client) Verbose(message string, level string) Response { |
| 989 |
return c.Handler.Command(VerboseCommand{ |
| 990 |
Message: message, |
| 991 |
Level: level, |
| 992 |
}) |
| 993 |
} |
| 994 |
|
| 995 |
|
| 996 |
|
| 997 |
|
| 998 |
type WaitForDigitCommand struct { |
| 999 |
Timeout int |
| 1000 |
} |
| 1001 |
|
| 1002 |
func (cmd WaitForDigitCommand) Command() (string, error) { |
| 1003 |
s := []interface{}{cmd.CommandString(), cmd.Timeout} |
| 1004 |
return joinCommand(s), nil |
| 1005 |
} |
| 1006 |
func (cmd WaitForDigitCommand) CommandString() string { |
| 1007 |
return "WAIT FOR DIGIT" |
| 1008 |
} |
| 1009 |
|
| 1010 |
func (c *Client) WaitForDigit(timeout int) Response { |
| 1011 |
return c.Handler.Command(WaitForDigitCommand{ |
| 1012 |
Timeout: timeout, |
| 1013 |
}) |
| 1014 |
} |
| 1015 |
|
| 1016 |
|
| 1017 |
|
| 1018 |
|
| 1019 |
type SpeechCreateCommand struct { |
| 1020 |
Engine string |
| 1021 |
} |
| 1022 |
|
| 1023 |
func (cmd SpeechCreateCommand) Command() (string, error) { |
| 1024 |
s := []interface{}{cmd.CommandString(), cmd.Engine} |
| 1025 |
return joinCommand(s), nil |
| 1026 |
} |
| 1027 |
func (cmd SpeechCreateCommand) CommandString() string { |
| 1028 |
return "SPEECH CREATE" |
| 1029 |
} |
| 1030 |
|
| 1031 |
func (c *Client) SpeechCreate(engine string) Response { |
| 1032 |
return c.Handler.Command(SpeechCreateCommand{ |
| 1033 |
Engine: engine, |
| 1034 |
}) |
| 1035 |
} |
| 1036 |
|
| 1037 |
|
| 1038 |
|
| 1039 |
|
| 1040 |
type SpeechSetCommand struct { |
| 1041 |
Name string |
| 1042 |
Value string |
| 1043 |
} |
| 1044 |
|
| 1045 |
func (cmd SpeechSetCommand) Command() (string, error) { |
| 1046 |
s := []interface{}{cmd.CommandString(), cmd.Name, cmd.Value} |
| 1047 |
return joinCommand(s), nil |
| 1048 |
} |
| 1049 |
func (cmd SpeechSetCommand) CommandString() string { |
| 1050 |
return "SPEECH SET" |
| 1051 |
} |
| 1052 |
|
| 1053 |
func (c *Client) SpeechSet(name string, value string) Response { |
| 1054 |
return c.Handler.Command(SpeechSetCommand{ |
| 1055 |
Name: name, |
| 1056 |
Value: value, |
| 1057 |
}) |
| 1058 |
} |
| 1059 |
|
| 1060 |
|
| 1061 |
|
| 1062 |
|
| 1063 |
type SpeechDestroyCommand struct { |
| 1064 |
} |
| 1065 |
|
| 1066 |
func (cmd SpeechDestroyCommand) Command() (string, error) { |
| 1067 |
s := []interface{}{cmd.CommandString()} |
| 1068 |
return joinCommand(s), nil |
| 1069 |
} |
| 1070 |
func (cmd SpeechDestroyCommand) CommandString() string { |
| 1071 |
return "SPEECH DESTROY" |
| 1072 |
} |
| 1073 |
|
| 1074 |
func (c *Client) SpeechDestroy() Response { |
| 1075 |
return c.Handler.Command(SpeechDestroyCommand{}) |
| 1076 |
} |
| 1077 |
|
| 1078 |
|
| 1079 |
|
| 1080 |
|
| 1081 |
type SpeechLoadGrammarCommand struct { |
| 1082 |
GrammarName string |
| 1083 |
PathToGrammar string |
| 1084 |
} |
| 1085 |
|
| 1086 |
func (cmd SpeechLoadGrammarCommand) Command() (string, error) { |
| 1087 |
s := []interface{}{cmd.CommandString(), cmd.GrammarName, cmd.PathToGrammar} |
| 1088 |
return joinCommand(s), nil |
| 1089 |
} |
| 1090 |
func (cmd SpeechLoadGrammarCommand) CommandString() string { |
| 1091 |
return "SPEECH LOAD GRAMMAR" |
| 1092 |
} |
| 1093 |
|
| 1094 |
func (c *Client) SpeechLoadGrammar(grammarName string, pathToGrammar string) Response { |
| 1095 |
return c.Handler.Command(SpeechLoadGrammarCommand{ |
| 1096 |
GrammarName: grammarName, |
| 1097 |
PathToGrammar: pathToGrammar, |
| 1098 |
}) |
| 1099 |
} |
| 1100 |
|
| 1101 |
|
| 1102 |
|
| 1103 |
|
| 1104 |
type SpeechUnloadGrammarCommand struct { |
| 1105 |
GrammarName string |
| 1106 |
} |
| 1107 |
|
| 1108 |
func (cmd SpeechUnloadGrammarCommand) Command() (string, error) { |
| 1109 |
s := []interface{}{cmd.CommandString(), cmd.GrammarName} |
| 1110 |
return joinCommand(s), nil |
| 1111 |
} |
| 1112 |
func (cmd SpeechUnloadGrammarCommand) CommandString() string { |
| 1113 |
return "SPEECH UNLOAD GRAMMAR" |
| 1114 |
} |
| 1115 |
|
| 1116 |
func (c *Client) SpeechUnloadGrammar(grammarName string) Response { |
| 1117 |
return c.Handler.Command(SpeechUnloadGrammarCommand{ |
| 1118 |
GrammarName: grammarName, |
| 1119 |
}) |
| 1120 |
} |
| 1121 |
|
| 1122 |
|
| 1123 |
|
| 1124 |
|
| 1125 |
type SpeechActivateGrammarCommand struct { |
| 1126 |
GrammarName string |
| 1127 |
} |
| 1128 |
|
| 1129 |
func (cmd SpeechActivateGrammarCommand) Command() (string, error) { |
| 1130 |
s := []interface{}{cmd.CommandString(), cmd.GrammarName} |
| 1131 |
return joinCommand(s), nil |
| 1132 |
} |
| 1133 |
func (cmd SpeechActivateGrammarCommand) CommandString() string { |
| 1134 |
return "SPEECH ACTIVATE GRAMMAR" |
| 1135 |
} |
| 1136 |
|
| 1137 |
func (c *Client) SpeechActivateGrammar(grammarName string) Response { |
| 1138 |
return c.Handler.Command(SpeechActivateGrammarCommand{ |
| 1139 |
GrammarName: grammarName, |
| 1140 |
}) |
| 1141 |
} |
| 1142 |
|
| 1143 |
|
| 1144 |
|
| 1145 |
|
| 1146 |
type SpeechDeactivateGrammarCommand struct { |
| 1147 |
GrammarName string |
| 1148 |
} |
| 1149 |
|
| 1150 |
func (cmd SpeechDeactivateGrammarCommand) Command() (string, error) { |
| 1151 |
s := []interface{}{cmd.CommandString(), cmd.GrammarName} |
| 1152 |
return joinCommand(s), nil |
| 1153 |
} |
| 1154 |
func (cmd SpeechDeactivateGrammarCommand) CommandString() string { |
| 1155 |
return "SPEECH DEACTIVATE GRAMMAR" |
| 1156 |
} |
| 1157 |
|
| 1158 |
func (c *Client) SpeechDeactivateGrammar(grammarName string) Response { |
| 1159 |
return c.Handler.Command(SpeechDeactivateGrammarCommand{ |
| 1160 |
GrammarName: grammarName, |
| 1161 |
}) |
| 1162 |
} |
| 1163 |
|
| 1164 |
|
| 1165 |
|
| 1166 |
|
| 1167 |
type SpeechRecognizeCommand struct { |
| 1168 |
Prompt string |
| 1169 |
Timeout int |
| 1170 |
Offset *string |
| 1171 |
} |
| 1172 |
|
| 1173 |
func (cmd SpeechRecognizeCommand) Command() (string, error) { |
| 1174 |
s := []interface{}{cmd.CommandString(), cmd.Prompt, cmd.Timeout, cmd.Offset} |
| 1175 |
return joinCommand(s), nil |
| 1176 |
} |
| 1177 |
func (cmd SpeechRecognizeCommand) CommandString() string { |
| 1178 |
return "SPEECH RECOGNIZE" |
| 1179 |
} |
| 1180 |
|
| 1181 |
func (cmd SpeechRecognizeCommand) SetOffset(v string) SpeechRecognizeCommand { |
| 1182 |
cmd.Offset = &v |
| 1183 |
return cmd |
| 1184 |
} |
| 1185 |
|
| 1186 |
func (c *Client) SpeechRecognize(prompt string, timeout int) Response { |
| 1187 |
return c.Handler.Command(SpeechRecognizeCommand{ |
| 1188 |
Prompt: prompt, |
| 1189 |
Timeout: timeout, |
| 1190 |
}) |
| 1191 |
} |