cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
616
Views
0
Helpful
7
Comments
cdnadmin
Level 11
Level 11
This document was generated from CDN thread

Created by: ROBERT KULAGOWSKI on 27-07-2010 02:46:27 PM
To support an "all hands" call, I created the following web page and made it an Enterprise Service:

 
<?php
 
$ip_of_phone = $_SERVER['REMOTE_ADDR'] ;
 
$post_data = "XML=". urlencode('<CiscoIPPhoneExecute>
     <ExecuteItem Priority="1" URL="RTPTx:Stop"/>
     </CiscoIPPhoneExecute>') ;
 
 
$ch = curl_init();
 
curl_setopt($ch, CURLOPT_URL, "http://" . $ip_of_phone . "/CGI/Execute");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_USERPWD, "confsuperuser:password");
curl_exec($ch);
curl_close($ch);
 
sleep(1) ;
 
if ($ip_of_phone == "10.255.23.74" or $ip_of_phone == "10.255.23.75")
{
$post_data = "XML=". urlencode('<CiscoIPPhoneExecute>
     <ExecuteItem Priority="1" URL="RTPMTx:239.168.3.20:20480"/>
     </CiscoIPPhoneExecute>') ;
$ch = curl_init();
 
curl_setopt($ch, CURLOPT_URL, "http://" . $ip_of_phone . "/CGI/Execute");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_USERPWD, "confsuperuser:password");
curl_exec($ch);
curl_close($ch);
 
}
 
$post_data = "XML=". urlencode('<CiscoIPPhoneExecute>
     <ExecuteItem Priority="1" URL="RTPMRx:239.168.3.20:20480"/>
     </CiscoIPPhoneExecute>') ;
 
// echo "Post data is " . $post_data ;
 
$ch = curl_init();
 
curl_setopt($ch, CURLOPT_URL, "http://" . $ip_of_phone . "/CGI/Execute");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_USERPWD, "confsuperuser:password");
curl_exec($ch);
curl_close($ch);
 
?>


This was sufficient to allow two talkers and multiple listeners.  However, the next step would be to also allow 3rd parties to join, either through a Meet-me, or having one device place a call to an audio bridge and simultaneously be in the multicast group. Any ideas on how to either make it work, or is it just not possible to do easily?

Subject: RE: Multicasting and conferencing
Replied by: Umesh Chaurasia on 31-07-2010 01:29:24 PM
Have you checked Cisco CUAE tool to design IP phone applications? Using this tool you can design XML application, voice based applications (IVR, multicast push to talk), recording etc. Yo need to bother about the functionality, load and stress reated things will be taken care by CUAE.
 
Regards,
Umesh
Comments
mpaters
Level 1
Level 1

I use this script and it works great, however, it joins the phone to a multicast group even while the phone is on an active call so you are hearing both the phone conversation and the multicast page. Is there a way to have the script ignore the phone if it is in an active call?

Mark Stover
Cisco Employee
Cisco Employee

Not with this script. IPPhoneExecute always acts immediately (ignores priority) for Internal URIs, which is what is being invoked here.

dstaudt
Cisco Employee
Cisco Employee

Since CiscoIPPhoneExecute items that are URL requests do obey the 'Priority' attribute (which can be set to ignore if on a call), you could make this a two-step sequence:

- POST a CiscoIPPhoneExecute to the phone with an Item that is a unique URL to your webserver, with Priority of 2 (Only if Idle)

- If/when your webserver receives the request to this URL, reply with the CiscoIPPhoneExecute including the multicast receive Item

mpaters
Level 1
Level 1

Thank you dstaudt, I am pretty new to programming and I'm having to do it out of necessity. I have a old Valcom FXO paging adapter that operates traditional overhead speakers and a group of Cisco IP phones. So to make it all work for my operators "on the cheap" they call an Asterisk extension, it records to a wav file, then calls the extension of the Valcom paging adapter and plays the messages and hangs up then executes the above script to make the IP phones join the multicast group, streams the message and then disconnects the phones. 

Of course I always have users that will always find something to complain about, first it was "I can't hear the pages" so I gave them the pages. Now the pages come across their phones while they are on calls.  Could you possibly give me an example of the code you are talking about that would ignore a phone in use.

Thank you!!

dstaudt
Cisco Employee
Cisco Employee

For the first POST, something like this:

<CiscoIPPhoneExecute>

<ExecuteItem Priority="2" URL=”http://a_web_server/join_mc?group=12345”/>

</CiscoIPPhoneExecute>

Priority="2" should ensure that the phone will not actually request the specified URL unless it is Idle (not in a call).  If the phone is Idle, then the URL http://a_web_server/join_mc?group=12345 will be requested, and the app can respond (via 200 OK) with the multicast command:

<CiscoIPPhoneExecute>

<ExecuteItem URL="RTPMRx:239.168.3.20:20480"/>

<ExecuteItem URL="http://a_web_server/joinc_mc/confirmation"/>

</CiscoIPPhoneExecute>

Also note that you should probably return a secondary execute Item that points to a URL that gives an actual displayable XML response (e.g. CiscoIPPhoneText 'Alert: Page announcement playing'), so that the phones is not left in 'Requesting...' status due to the 2nd Execute object not being displayable.

mpaters
Level 1
Level 1

I will give this a try. Thank you very much!

mpaters
Level 1
Level 1

for some reason pri 2 still makes the phone request the multicast join in a call or not.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links