# Using call file to call multiple extensions

**URL:** <https://community.asterisk.org/t/using-call-file-to-call-multiple-extensions/76923>\
**Category:** Asterisk Support\
**Created:** [October 31, 2018, 1:52pm UTC](https://community.asterisk.org/t/using-call-file-to-call-multiple-extensions/76923 "2018-10-31T13:52:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kamil\_optime](https://avatars.discourse-cdn.com/v4/letter/k/54ee81/32.png) [@kamil\_optime](https://community.asterisk.org/u/kamil_optime)\
**Post date:** [October 31, 2018, 1:52pm UTC](https://community.asterisk.org/t/using-call-file-to-call-multiple-extensions/76923/1 "2018-10-31T13:52:35Z")

</div>

Hey,

At the beginning I would like to say that I’m not big expert in asterisk so I can confuse some names 🙂 I’m trying to make such functionality using call file:

1. Create call file which has defined multiple extensions (or channels?)
2. When call file is loaded, call them at the same time
3. When someone answer, play recording
4. After recording call external number, which is also defined in call file

For the moment call file looks like this:

> Channel: PJSIP/10101010  
> MaxRetries: 2  
> RetryTime: 60  
> WaitTime: 30  
> Context: test-context  
> Callerid: test-context  
> Extension: 100  
> Setvar: waitingTime=2  
> Setvar: clientNumber=+48XXXXXXX

And this is my context defined in extensions\_custom.conf:

> [test-context]  
> exten =\> 100,1,Answer()  
> exten =\> 100,2,Wait(${waitingTime})  
> exten =\> 100,3,Playback(test-recording)  
> exten =\> 100,4,Wait(${waitingTime})  
> exten =\> 100,5,Set(CALLERID(num)=+4822XXXXXXX)  
> exten =\> 100,6,Dial(PJSIP/${clientNumber}@dTest,300,Tt)

It works properly but it calls only to one extension which is defined as channel in call file.

It would be wonderful if someone can give me any clue about two issues:

1. How to call at the same time multiple channels/extensions
2. How to properly set callerid with value which is defined in extension which answered the call

---

<div class="post-metadata">

**Author:** ![ambiorixg12](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/ambiorixg12/32/1887_2.png) [@ambiorixg12](https://community.asterisk.org/u/ambiorixg12)\
**Post date:** [October 31, 2018, 1:55pm UTC](https://community.asterisk.org/t/using-call-file-to-call-multiple-extensions/76923/2 "2018-10-31T13:55:00Z")

</div>

I dont use call file, but I know a method is uslng local channels

---

<div class="post-metadata">

**Author:** ![david551](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@david551](https://community.asterisk.org/u/david551)\
**Post date:** [October 31, 2018, 2:19pm UTC](https://community.asterisk.org/t/using-call-file-to-call-multiple-extensions/76923/3 "2018-10-31T14:19:35Z")

</div>

Use local channels (Google will return a page if you give call files and local channels). Encode the external number into the extension called.

Research connected line update for the callee ID.
