# When i make a call(click to call), I can't hear early media?

**URL:** <https://community.asterisk.org/t/when-i-make-a-call-click-to-call-i-cant-hear-early-media/92769>\
**Category:** Asterisk Support\
**Created:** [May 25, 2022, 1:15am UTC](https://community.asterisk.org/t/when-i-make-a-call-click-to-call-i-cant-hear-early-media/92769 "2022-05-25T01:15:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hsunryou](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/hsunryou/32/3968_2.png) [@hsunryou](https://community.asterisk.org/u/hsunryou)\
**Post date:** [May 25, 2022, 1:15am UTC](https://community.asterisk.org/t/when-i-make-a-call-click-to-call-i-cant-hear-early-media/92769/1 "2022-05-25T01:15:04Z")

</div>

OS : CentOS 7 + Asterisk 16 + chan\_pjsip (not chan\_sip)

- first Agent, next Customer  
when I make a call by click to call, I can hear early media like this

 ![image](https://global.discourse-cdn.com/asterisk/original/2X/2/24c0cec0928ce4572274dcd4c5861fcf79de9326.png)

- first Customer, next Agent  
if i change order of dial, in this case, asterisk can’t get a early media

 ![image](https://global.discourse-cdn.com/asterisk/original/2X/e/e69b58adaf4fd55777581590054a8a2dcda68d73.png)

How can i solve this ?

---

<div class="post-metadata">

**Author:** ![hsunryou](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/hsunryou/32/3968_2.png) [@hsunryou](https://community.asterisk.org/u/hsunryou)\
**Post date:** [May 25, 2022, 2:06am UTC](https://community.asterisk.org/t/when-i-make-a-call-click-to-call-i-cant-hear-early-media/92769/2 "2022-05-25T02:06:21Z")

</div>

I got new hint - [Asterisk 16 ManagerAction\_Originate - Asterisk Project - Asterisk Project Wiki](https://wiki.asterisk.org/wiki/display/AST/Asterisk+16+ManagerAction_Originate)

Originate command has a new property - “EarlyMedia”  
I make a call using AMI (Originate command with “EarlyMedia”)

if i execute Originate command,  
where caller(Customer) is answer the call, Asterisk use a “Context” of Originate

i set EarlyMedia: true, Codecs: ulaw,alaw at Originate Command.  
when receiver(Customer) is NOT answer the call, asterisk just a receive a SIP 183, But Asterisk use a “Context” of Originate.

---

<div class="post-metadata">

**Author:** ![fsilvestre](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/fsilvestre/32/4271_2.png) [@fsilvestre](https://community.asterisk.org/u/fsilvestre)\
**Post date:** [May 25, 2022, 2:07am UTC](https://community.asterisk.org/t/when-i-make-a-call-click-to-call-i-cant-hear-early-media/92769/3 "2022-05-25T02:07:40Z")

</div>

1 - Looks like your dialplan answers agent call before place call to pstn and generate fake ringtone backward. Disable Answer and Ring to be sure you aren’t with same problem when place call from asterisk.

2 - Have you enabled direct media? Try disable it.

---

<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:** [May 25, 2022, 9:40am UTC](https://community.asterisk.org/t/when-i-make-a-call-click-to-call-i-cant-hear-early-media/92769/5 "2022-05-25T09:40:06Z")

</div>

The OP might not have a dailplan. There is a lot of missing information, including anything that would answer that question.

---

<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:** [May 25, 2022, 10:26am UTC](https://community.asterisk.org/t/when-i-make-a-call-click-to-call-i-cant-hear-early-media/92769/6 "2022-05-25T10:26:03Z")

</div>

Firstly click to call is an abstraction on top of Asterisk, so we need to see how you have implemented that abstraction.

Secondly, looking at the code, EarlyMedia only works if you also specify Async.

Also, wireshark messages sequence diagrams rarely contain enough detail to solve problems; we normally need the full protocol trace, e.g “pjsip set logger on”, from Asterisk, together with verbose level 5, error, warning an notice logging, taken from the full log, after it has been enabled.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [June 24, 2022, 10:26am UTC](https://community.asterisk.org/t/when-i-make-a-call-click-to-call-i-cant-hear-early-media/92769/7 "2022-06-24T10:26:26Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
