Ami

Hi, i want to send a msg from ami to read on IVR but i don’t know how to do it.

i have this code to initialize a call :
$astman->action({Action => ‘Originate’,
Channel => ‘SIP/1009’,
Context => ‘MYIVR’,
Exten => 1000,
Priority => 1});
it works well the phone rings, but my problem, i have to put a text which will be readed by asterisk

on extensions.conf this my context [MYIVR]
exten => 1000,1,Answer()
exten => 1000,n,Wait()
exten => 1000,n,agi(googletts.agi,“Hello”,en)
exten => 1000,n,Hangup()

i want to send a msg to say inside of " Hello" every time when i generate a outgoing call.
Please help me and thanks

Refering to https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+ManagerAction_Originate:

Use a Variable -Line in Your Originate-Command, this can be used within Asterisk afterwards, e.g.

$astman->action({Action => 'Originate', Channel => 'SIP/1009', Context => 'MYIVR', Exten => 1000, Priority => 1, MyMsg => 'Hello world'});

[MYIVR] exten => 1000,1,Answer() exten => 1000,n,Wait() exten => 1000,n,agi(googletts.agi,${MyMsg},en) exten => 1000,n,Hangup()

Thank you :smiley:
It works well now Thank you

:frowning:
I have another question. I want to retrieve a value from asterisk to it I put this code in Asterisk:
in extensions.conf
[MYIVR]
exten => 1000,n,agi(googletts.agi,“Please your number”,en)
exten => 1000,n,Read(nb,4,)

on the perl script
my rsp => $astman->action({Action => ‘Getvar’,
Channel => ‘SIP/1009’,
Variable => ‘nb’});
print " The value of user is $rsp->{Value} \n";

My problem is that i get an empty value like this :
The value of user

Please any help