# Problem with .call files and extensions

**URL:** <https://community.asterisk.org/t/problem-with-call-files-and-extensions/74009>\
**Category:** Asterisk Support\
**Created:** [March 22, 2018, 3:46pm UTC](https://community.asterisk.org/t/problem-with-call-files-and-extensions/74009 "2018-03-22T15:46:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mirelasato](https://avatars.discourse-cdn.com/v4/letter/m/838e76/32.png) [@mirelasato](https://community.asterisk.org/u/mirelasato)\
**Post date:** [March 22, 2018, 3:46pm UTC](https://community.asterisk.org/t/problem-with-call-files-and-extensions/74009/1 "2018-03-22T15:46:20Z")

</div>

Hi, I’m trying to make some calls with the .call file, but I don’t know what i’m doing wrong, what I want to do is:

1. SIP 181 dial to 182
2. 182 automatic answer the call
3. Wait 3 seconds
4. 182 send the busy tone and hangup

This is the .call file

```auto
Channel: SIP/182
MaxRetries: 2
RetryTime: 60
WaitTime: 30
Context: phones
Extension: 181

```

And the extensions.conf

```auto
[phones]
exten => 181,1,NoOp(Call for Linux-Zoiper)
same => n,Dial(SIP/181)
same => n,Wait(15)
same => n,Hangup

exten => 182,1,NoOp(Call for Windows-Zoiper)
same => n,Answer
same => n,Playtones(busy)
same => n,Busy(10)
same => n,Hangup

```

---

<div class="post-metadata">

**Author:** ![meightee](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/meightee/32/2794_2.png) [@meightee](https://community.asterisk.org/u/meightee)\
**Post date:** [March 22, 2018, 4:00pm UTC](https://community.asterisk.org/t/problem-with-call-files-and-extensions/74009/2 "2018-03-22T16:00:29Z")

</div>

If you want sip 181 to call 182 you should call 181, as soon as that extension answers it will be dropped in to the context phones, and call extensions 182.

So your call file should be:

Channel: SIP/181  
MaxRetries: 2  
RetryTime: 60  
WaitTime: 30  
Context: phones  
Extension: 182  
Priority: 1

And your dialplan should be:

[phones]

exten =\> 182,1,NoOp(Call to extension 182)  
same =\> n,Dial(SIP/182)  
same =\> n,Hangup

This should work.

---

<div class="post-metadata">

**Author:** ![mirelasato](https://avatars.discourse-cdn.com/v4/letter/m/838e76/32.png) [@mirelasato](https://community.asterisk.org/u/mirelasato)\
**Post date:** [March 22, 2018, 6:22pm UTC](https://community.asterisk.org/t/problem-with-call-files-and-extensions/74009/3 "2018-03-22T18:22:10Z")

</div>

It worked, thanks you very much!

But as I said before, there is some way to do it automatically?  
Just copying the .call file in the outgoing asterisk folder and the other side answer the call automatically?

---

<div class="post-metadata">

**Author:** ![johnkiniston](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/johnkiniston/32/28_2.png) [@johnkiniston](https://community.asterisk.org/u/johnkiniston)\
**Post date:** [March 22, 2018, 7:49pm UTC](https://community.asterisk.org/t/problem-with-call-files-and-extensions/74009/4 "2018-03-22T19:49:11Z")

</div>

If your endpoint supports an auto-answer header you could try adding one to your dialplan.

Something like  
`Set(PJSIP_HEADER(add,Call-Info)=answer-after=0)`  
Or  
`Set(PJSIP_HEADER(add,Alert-Info)=info=AutoAnswer)`

You’ll need to consult the documentation for your endpoint as to what method it may use for answering.

---

<div class="post-metadata">

**Author:** ![mirelasato](https://avatars.discourse-cdn.com/v4/letter/m/838e76/32.png) [@mirelasato](https://community.asterisk.org/u/mirelasato)\
**Post date:** [March 22, 2018, 8:37pm UTC](https://community.asterisk.org/t/problem-with-call-files-and-extensions/74009/5 "2018-03-22T20:37:15Z")

</div>

> [@johnkiniston](#):
>
> Set(PJSIP\_HEADER(add,Alert-Info)=info=AutoAnswer)

Just what i needed, thank you!
