[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
Change vlan setting to more than one phone at once
Author Message
cptjack Offline
Member
***

Posts: 97
Joined: Jan 2014
Reputation: 8
Post: #8
RE: Change vlan setting to more than one phone at once
You might be able to do it via SIP Notify or Push XML, but I'm not sure if the T2x supports VLAN configuration via Push XML... I think v72 can do it, but I have only tested the scripts below on a T48G with v73, so please test carefully!

As a starting point, an example of a Push XML is in this thread. Push XML can be delivered by a trusted server (ip) or in a SIP header from the PBX.

A PHP test script to change one parameter on one phone would go like this. It requires however that the server IP is configured in Features -> "Remote Control" -> "Push XML Server IP Address".[/php]
PHP Code:
<?php
$phoneip 
"192.168.0.100";
$serverip "192.168.0.1";

function 
push2phone($server,$phone,$data)
{
$xml "xml=".$data;
$post "POST / HTTP/1.1\r\n";
$post .= "Host: $phone\r\n";
$post .= "Referer: $server\r\n";
$post .= "Connection: Keep-Alive\r\n";
$post .= "Content-Type: text/xml\r\n";
$post .= "Content-Length: ".strlen($xml)."\r\n\r\n";
$fp = @fsockopen $phone80$errno$errstr5);
if(
$fp)
{
fputs($fp$post.$xml);
flush();
fclose($fp);
} else {
    echo 
"error $errno $errstr";
    }
}
##############################

$xml "<YealinkIPPhoneConfiguration Beep='yes'>\n".
     
"<Item>network.vlan.pc_port_vid = 10</Item>\n".
     
"</YealinkIPPhoneConfiguration>\n";
     
push2phone($serverip,$phoneip,$xml);
?>


If you already have asterisk, you can accomplish the same by adding a SIP Notify message in sip_notify.conf:
Code:
[yealink-changevpn]
Event=>yealink-xml
Content-type=>application/xml
Content=><YealinkIPPhoneConfiguration Beep="yes">
Content=><Item>network.vlan.pc_port_vid = 20</Item>
Content=></YealinkIPPhoneConfiguration>

Then from the asterisk console run:
Code:
sip notify yealink-changevpn tel1 tel2 tel3 etc...

The example above will only change the PC VLAN ID, but you can add additional configuration items if needed. Please note that the phone will reboot immediately as the change in VLAN requires reboot.

I hope this helps you on the right track.

Please use the reputation button below if you like this post.
11-18-2014 06:53 AM
Find all posts by this user    like0    dislike0 Quote this message in a reply
Post Reply 


Messages In This Thread

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  2-way paging with no indication on phone nolto 1 1,744 05-11-2023 11:20 PM
Last Post: Yisroel_MongoTEL
  T57W - Using the Phone Directory bill@wesimplifyit.com 0 1,086 04-14-2023 12:41 AM
Last Post: bill@wesimplifyit.com
  W70B - 3CX phone book is not displayed completely ChrisGER 1 4,761 03-19-2023 07:31 PM
Last Post: thomas32
Question 3CX / Yealink passthrough VLAN issue (when phone is rebooted) maindriver 4 11,584 03-24-2022 10:25 PM
Last Post: maindriver
  Directory DSS Key Target Change nolto 1 5,327 01-14-2022 07:05 PM
Last Post: nolto
  Limit maximum of active calls per phone elastalink 5 15,038 09-09-2021 03:52 AM
Last Post: kapetrosyan
  Read specific variable from phone configuration saivo 0 3,472 06-13-2021 05:23 PM
Last Post: saivo
  Change default admin password with config file? PeterSkiles 1 7,507 05-18-2021 01:22 AM
Last Post: complex1
  Change number of rings to get to day voicmail drb@thecatdr.net 4 10,659 06-10-2020 05:44 PM
Last Post: drb@thecatdr.net
  Raw XML for Remote Phone Book rgranholm 1 6,862 03-24-2020 06:14 AM
Last Post: crazyau

Forum Jump:


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

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