Play music file in active conference


#1

Hi,

I am trying to play a music file inside a conference. I came to know that it can be done via local channels.

I am dialing a local channel using an AMI command (I am using php so the command is being executed using a php script)

Send the following AMI command.
$fileNme =“beep”;

					$writeBuffer  = "Action: Originate\r\n";
					$writeBuffer .= "Channel: Local/2000@beep_context\r\n";
					$writeBuffer .= "Application: Playback\r\n";
					$writeBuffer .= "Data: $fileNme\r\n";
					$bytesSent = socket_write($this->socket, $writeBuffer);

And the context beep_context is as follows

[beep_context]
exten => _X!,1,Answer
exten => _X!,n,MeetMe(2000,q1)
exten => _X!,n,Hangup

When I execute the command nothing happens. I also checked the AMI logs and it seems that instruction has not even gone to the AMI.

Note:- I have successfully connected two users a conference and now I am trying to play a musicfile inside the conference.

Please look into the matter and help me.

Regards


#2

Hi,

Try this.

$fileNme =“beep”;

$writeBuffer = “Action: Originate\r\n”;
$writeBuffer .= “Channel: Local/2000@beep_context\r\n”;
$writeBuffer .= "“Setvar:sFILENAME=$filename\r\n”;
$bytesSent = socket_write($this->socket, $writeBuffer);

[beep_context]
exten => 2000,1,Answer
exten => 2000,n,MeetMe(2000,q1)
exten => 2000,n,Playback(${sFILENAME})
exten => 2000,n,Hangup

For Originate through AMI check you have given Originate right in manager.conf file and are you able to successfully logged in with AMI session with asterisk.

Hope this will help to you

Regards

Ketan

[quote=“anilshah”]Hi,

I am trying to play a music file inside a conference. I came to know that it can be done via local channels.

I am dialing a local channel using an AMI command (I am using php so the command is being executed using a php script)

Send the following AMI command.
$fileNme =“beep”;

					$writeBuffer  = "Action: Originate\r\n";
					$writeBuffer .= "Channel: Local/2000@beep_context\r\n";
					$writeBuffer .= "Application: Playback\r\n";
					$writeBuffer .= "Data: $fileNme\r\n";
					$bytesSent = socket_write($this->socket, $writeBuffer);

And the context beep_context is as follows

[beep_context]
exten => _X!,1,Answer
exten => _X!,n,MeetMe(2000,q1)
exten => _X!,n,Hangup

When I execute the command nothing happens. I also checked the AMI logs and it seems that instruction has not even gone to the AMI.

Note:- I have successfully connected two users a conference and now I am trying to play a musicfile inside the conference.

Please look into the matter and help me.

Regards[/quote]