Hi, I’m a newbie with Asterisk.
I’m developing a Delphi application for interact with Asterisk.
I’ve made a component that work with the manager, It intercept all messages from it.
All ok, but I need to tell Manager to play a sound, and I don’t know how to.
I’ve made (under Asterisk) a macro to play sound, and works well, but I don’t know wich command to run on Manager to play a sound, or run a macro that play a sound or every other thing that can do this.
First you need to authenticate with the * server, using the credential defined in /etc/asterisk/manager.conf, so let’s suppose you defined a user xxx with secret yyy, you connect to the * manager interface via telnet , wait for the * welcome message, then input this:
Action: login
Username: xxx
Secret: yyy
if you receive a successful response we can go on and try to stream a file, otherwise check manager.conf and retry.
Seems you are confusing the two interfaces, AGI interface and manager interface are differents, with agi you can play a file directly, through the manager interface you can’t do a direct play, you have to Originate or Redirect a call to a dialplan extension and there you can play a file (or even launch an AGI script ).
[from-internal]
;allow phones to use applications
include => app-userlogonoff
include => app-directory
include => app-dnd
include => app-callforward
include => app-callwaiting
include => app-messagecenter
include => app-calltrace
include => parkedcalls
include => from-internal-custom
;allow phones to dial other extensions
include => ext-fax
include => ext-zapbarge
include => ext-record
include => ext-test
;allow phones to access generated contexts
include => from-internal-additional
;ADDED THIS LINE
exten => 702,1,Macro(macrotest)
Now, if i open a call between 700 and 701 and from manager I type:
Action: Redirect
Channel: SIP/700-xxxx
ExtraChannel: SIP/701-xxxx
Exten: 702
Context: from-internal
Priority: 1
It happen this:
in the two phones I hear the sound but after hearing it, the
call hang up automatically.
You’re doing nothing wrong, you’ve only one priority in your macro so after the execution of Playback * just ends the call, this is the normal behaviour; try put other priorities after Playback(), they will get executed.
I think you need to understand better how the * dial plan works, I suggest you to read the free book you can download here: asteriskdocs.org/modules/tin … .php?id=11.