# Parallel dialplan execution

**URL:** <https://community.asterisk.org/t/parallel-dialplan-execution/41794>\
**Category:** Asterisk Support\
**Created:** [February 6, 2013, 1:23am UTC](https://community.asterisk.org/t/parallel-dialplan-execution/41794 "2013-02-06T01:23:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tanveer](https://avatars.discourse-cdn.com/v4/letter/t/22d042/32.png) [@tanveer](https://community.asterisk.org/u/tanveer)\
**Post date:** [February 6, 2013, 1:23am UTC](https://community.asterisk.org/t/parallel-dialplan-execution/41794/1 "2013-02-06T01:23:53Z")

</div>

can we do the parallel dialplan execution. i.e while playing some file to user do some background processing. and then play this processing results to user/caller.

---

<div class="post-metadata">

**Author:** ![david55](https://avatars.discourse-cdn.com/v4/letter/d/e19adc/32.png) [@david55](https://community.asterisk.org/u/david55)\
**Post date:** [February 6, 2013, 8:20am UTC](https://community.asterisk.org/t/parallel-dialplan-execution/41794/2 "2013-02-06T08:20:56Z")

</div>

Whilst there are tricks, using & in Dial() combined with local channels, for getting parallel execution of diaplans, I think your case woul best be done with AGI using a language that supports multi-threading.

---

<div class="post-metadata">

**Author:** ![tanveer](https://avatars.discourse-cdn.com/v4/letter/t/22d042/32.png) [@tanveer](https://community.asterisk.org/u/tanveer)\
**Post date:** [February 6, 2013, 9:35am UTC](https://community.asterisk.org/t/parallel-dialplan-execution/41794/3 "2013-02-06T09:35:52Z")

</div>

Dear David,

can you team me that trick. i dont want to use AGI. i dont have much agi/programming experience and multitasking is the most difficult. it would be great if we can trick Dial plan. here is my case

1. accept incomming call.
2. get input from user.
3. play music
4. launch agi script to query database.
5. stop music and play agi script query results.

if you think agi is the only way then can you give me some sample agi with multitasking.

Regards,

Tanveer
