Yate Community Forum

General Category => Yate users hangout place => Topic started by: ganapathi on September 28, 2018, 12:53:04 AM

Title: Audio files as Loop Instead of call ringing
Post by: ganapathi on September 28, 2018, 12:53:04 AM
Hi

How do  i play audio files (file1,file2..) to customer who called in inbound as a loop until sip user answered.

Scenario :
In these both cases how do i play audio instead of ringing/silent as a loop until call answered by sip user.

As i seen mail list to play audio to the caller like mentioned below.
m = new Message("chan.masquerade")
m->addparam("message","chan.attach");
m->addparam("id",peerid of call.execute);
m->addparam("source","wave/play/fullpath/audio.au");

But as i guess it won't work as loop/instead of ringing.

Kindly help me on this.
Title: Re: Audio files as Loop Instead of call ringing
Post by: jamie on October 01, 2018, 02:19:58 PM
Hi Ganapathi,

To indefinitely repeat an audio file you can include the parameter autorepeat = true :

but I've only used this in PHP


Title: Re: Audio files as Loop Instead of call ringing
Post by: ganapathi on October 01, 2018, 10:48:14 PM
Thanks .

But for me chan.attach is not working. Only call.execute is working for me. will u pls help me if there any parameters which I missed there ?.

Also I seen some necessary parameters in doc as consumer and sniffer. Don't know what would be the value for this call.
Title: Re: Audio files as Loop Instead of call ringing
Post by: marian on October 02, 2018, 12:07:17 AM
When a call leg is connected to another one data endpoints are connected to each other.

You have 2 solutions:
- track chan.connected and re-attach the play data source when call leg is connected
- make 2 separate calls and connect to each other when appropriate (you may use chan.connect message for this. See docs.yate.ro)