[YMCS/YDMP Free Trial Program]Yealink would like to offer Free Trial Program of Yealink device management service for our current eligible customers. You can see the details below.
https://www.yealink.com/ydmp-freetrial-2020


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
XML and posting back to the script
Author Message
lekcomp Offline
Junior Member
**

Posts: 12
Joined: Mar 2014
Reputation: 0
Post: #1
XML and posting back to the script
We are considering switching our install base for new systems from Aastra phones to Yealink phones. I'm converting my scripts from Aastra to Yealink as I try them out to get a feel for functionality. It's similar but different enough to frustrate me. GRRR!

So, what I'm attempting to accomplish is nesting menus. I would like the user to be presented with a menu and then depending on which they choose it moves down to that section. The movement is controlled using the switch($ACTION) and case commands. What I'm unsure of is how to link the keypress to the switching. Here is some code as example:

$ACTION="list" ;


switch($ACTION)
{
case 'list':
echo '<TextMenu>'."\n" ;
echo '<MenuItem>'."\n".'<Prompt>Extension List</Prompt>'."\n"."<URI>$ACTION='extension'</URI>"."\n".'</MenuItem>'."\n" ;
echo '</TextMenu>'."\n" ;
break ;



case 'extension':
//---------- Place Extensions into ARRSTORE ----------#
$AS = new AGI_AsteriskManager();
$RES = $AS->connect();
$RAW=$AS->database_show('AMPUSER');

//---------- Place Mailboxes and Names into ARRSTORE ----------#
$ARRSTORE = array() ;
foreach($RAW as $KEY=>$VALUE)
{
if(strstr($KEY,'cidname'))
{
$NUMBER=preg_replace(array('/\/AMPUSER\//','/\/cidname/'),array('',''),$KEY);
$ARRSTORE[$VALUE] = $NUMBER;
}
}
ksort($ARRSTORE);
//---------- Send To Phone ----------#
echo '<YealinkIPPhoneDirectory'."\n";
echo 'style="radio"'."\n";
echo 'Beep="no"'."\n";
echo 'defaultIndex="1"'."\n";
echo '>'."\n";
echo '<Title wrap="yes">Dial Plus</Title>'."\n";
foreach($ARRSTORE as $KEY=>$VALUE)
{
echo "<MenuItem>\n" ;
echo "<Prompt>$KEY</Prompt>"."\n" ;
echo "<URI>$VALUE</URI>" ;
echo "</MenuItem>\n" ;
}
echo '</YealinkIPPhoneDirectory>'."\n";
break;

}

If I do each case individually they work. I'm just looking for some insight as to how to pass the $ACTION variable to be able to post I guess. Thanks for any help.

Just figured it out.


Change
case 'list':
echo '<TextMenu>'."\n" ;
echo '<MenuItem>'."\n".'<Prompt>Extension List</Prompt>'."\n"."<URI>$ACTION='extension'</URI>"."\n".'</MenuItem>'."\n" ;
echo '</TextMenu>'."\n" ;
break ;

To
case 'list':
echo '<TextMenu>'."\n" ;
echo '<MenuItem>'."\n".'<Prompt>Extension List</Prompt>'."\n"."<URI>http://$PATHTOSCRIPT/$SCRIPTNAME.php?ACTION=extension</URI>"."\n".'</MenuItem>'."\n" ;
echo '</TextMenu>'."\n" ;
break ;

Just FYI.
(This post was last modified: 03-01-2014 01:33 AM by lekcomp.)
03-01-2014 01:16 AM
Find all posts by this user    like0    dislike0 Quote this message in a reply
Post Reply 


Messages In This Thread
XML and posting back to the script - lekcomp - 03-01-2014 01:16 AM

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Possible to have T27P switch back to first page of DSS Keys after a period of time? Bobcat19 2 3,904 11-13-2019 07:37 AM
Last Post: Ajani_Exetel
  "Hold" + going back by "Resume" - audio is muted Babylonia 1 1,309 07-10-2019 08:25 PM
Last Post: Babylonia
  T27G - Fall Back issues - Successive setting [Solved] BobBluePackets 6 3,831 05-28-2019 04:47 AM
Last Post: BobBluePackets
  Screen Default Back to Page 1 Kiwi 0 1,031 04-16-2019 01:22 AM
Last Post: Kiwi
  Transfer with T2XG and call back hercross 7 4,029 09-27-2018 09:21 PM
Last Post: jolouis

Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us   Yealink   Return to Top   Return to Content   Lite (Archive) Mode   RSS Syndication