I have a problem with AMI Originate

I have a problem with AMI Originate, when I make a call to Local / XXXXX @ internal context IVR2 s extension, and ringing in the executing context, I need to perform the Originate, the answer is context fence and not before.

My PHP AMI Originate

$asm->send_request('Originate', array('Channel'=>'Local/9XXXXXXXX@internal', 'Context'=>'IVR2', 'Exten'=>'s', 'Timeout' => '50000', 'Async'=>'1', 'variable' => 'id=' . $id . '|callTo=' . $ddi . '|callFrom=' . $cli . '|transferTo=' . $transfer, 'MaxRetries' => '0', 'RetryTime' => '0', 'Priority'=>'1', 'Callerid'=>$cli));

My Outbound Context

[internal]
exten => _9[56789]XXXXXXX,1,Answer()
exten => _9[56789]XXXXXXX,n,Set(VOLUME(TX)=3)
exten => _9[56789]XXXXXXX,n,Set(VOLUME(RX)=3)
exten => _9[56789]XXXXXXX,n,Dial(SIP/SipProvider/${EXTEN},30)
exten => _9[56789]XXXXXXX,n,Hangup

My IVR Context

[IVR2] exten => s,1,Answer() exten => s,n,Playback(aware/IVRRetiroCAC) exten => h,1,NoOp(------- Hangup My IVR ----------) exten => h,n,Hangup()

Please Help

Both calls to Answer are redundant.

Sorry, i don’t understand!!!

You have two calls to answer in the dialplan. One is causing your problem and the other serves no real useful purpose.

David55
if I understand, my dialplan should be

[internal]
exten => _9[56789]XXXXXXX,1,Answer()
exten => _9[56789]XXXXXXX,n,Set(VOLUME(TX)=3)
exten => _9[56789]XXXXXXX,n,Set(VOLUME(RX)=3)
exten => _9[56789]XXXXXXX,n,Dial(SIP/SipProvider/${EXTEN},30)
exten => _9[56789]XXXXXXX,n,Hangup

and my IVR context

[IVR2]
exten => s,1,Playback(aware/IVRRetiroCAC)
exten => h,1,NoOp(------- Hangup My IVR ----------)
exten => h,n,Hangup()

this right?

No.

so sorry
i don’t understand
i mean i have a php dialer that make a originate using Local channel, but when make the call, immediatly play the record, before the answer the call on the phone

So sorry again!!

biguitarman

That’s because you have already answered the call in the dialplan.

Why did you include Answer in either dialplan fragment?

Thank you very much David55, I understood your answer, I did it and it worked.

appreciate your help

biguitarman

biguitarman

Will you share the code you used to generate the outbound call and play the message using the local channel?

Disregard… I didn’t see what you had posted originally. Thanks