Dial and using an agi call in the same time

Hi,

I’m on asterisk 1.8, under linux (debian 64 bit).

I would like to have in a dialplan (from extension.conf) the following setting :
[ul][li]dial a phone number[/li]
[li]put a music in background until it answer[/li]
[li]during this process in need to run an agi script[/li][/ul]

So what I have now is this :
[some-context]
exten => s,1,NoOp(-- some coment for debug purpose)
same => n,Dial(SIP/phone@peerprovider,30,m(myMusicOnHold))

I try to use M() flag in dial flags, but it’s only called after the call was picked up.

Because the agi process can take sometime, I don’t want that calling it block the dial.

Do you have any clue how to make dial and agi call running in parallel?

Thanks

Use AMI instead. Note you don’t want to run an AGI script; you want to do whatever that AGI script does. You’ll get help if you say what that is.