Postes Cisco SPA502G RESOLU
Bonjour,
J'ai une install à faire avec que des postes Cisco SPA502G
et après la conf du premier, je me rend compte que ce style de poste
tout comme tout le matos Cisco, n'est pas fait pour être configuré de cette façon
c'est bien trop long et pas du tout friendly.
J'ai donc mis un serv tftp sur l'IPBX
Avec déjà le fichier xml langue car ces grosses daubes sont livrés en Anglais only, le dernier firmware car sinon il prend pas le fichier langue
et la j'en suis au moteur d'autoprov qui vas me générer le fichier $mac.xml
Je compte récup les mac avec nmap faire un truc en PHP qui
présente tous les postes trouvés on indique login/password/nom
A la validation
on vas modif les lignes qui vont bien dans le fichier xml de chaque poste
et on génère l'extention sur * ou freepbx ou cyberhotel suivant le choix.
Bon j'en viens a la question:
Quelqu'un aurais le xml d'autoprov pour le SPA502G francisé de préférence?
ensuite
Connaissez vous peut être un outil existant qui fait déja ce job ?
Provisioning, upgrade et chagement de langue SPA502G
Bon pas de Cisco-maso sur le forum :-)
J'ai finalement fait une partie du taf moi même après grosses galères:
J'ai choisis l'option http plutôt que tftp donc pas de serveur tftp à installer
ou si vous préférez le tftp
éditez votre inetd.conf et changez
------------------------------------------------------------
tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /var/www/tftpboot
------------------------------------------------------------
ensuite remplacez tout ce qui est http dans le script php par l'adresse tftp
-1 création d'un répertoire tftpboot dans /var/www/
-2 dans ce rep création d'un fichier spa502G.cfg avec:
------------------------------------------------------------
<flat-profile>
<Resync_On_Reset>Yes</Resync_On_Reset>
<Resync_Periodic>86400</Resync_Periodic>
<Profile_Rule>http://192.168.1.5/tftpboot/spa$MA.xml</Profile_Rule>
</flat-profile>
------------------------------------------------------------
mon serveur est en 192.168.1.5 donc changer pour adapter suivant l'adresse
3- création d'un sous rep /var/www/tftpboot/502 ou j'ai mis:
spa50x-30x-7-4-8a.bin (le firmware)
et trois fichiers de langues enS_v101.xml, frS_v101.xml, esS_v101.xml
4- On chmod le tout repertoires et fichiers en 777
5- Finalement à la racine j'ai créé la page cisco.php avec:
------------------------------------------------------------
<?
echo'
<form method="get" action="'.$_SERVER['PHP_SELF'].'">
<input type="text" name="proxy" /> SIP Server<br/>
<input type="text" name="number" /> Number<br/>
<input type="text" name="password" /> Password<br/>
<input type="text" name="display" /> Name<br/>
<input type="text" name="ip" /> IP<br/>
<input type="text" name="netmask" /> Netmask<br/>
<input type="text" name="gw" /> Gateway<br/>
Warning you have now to select Actual IP method if you work with online phone and whant to apply change on phone in realtime.<br/>
<input type="text" name="now" /> Actual IP<br/>
select Mac-address method if you just whant create conf file and make change on phone GUI.<br/>
<input type="text" name="mac" /> Mac-address<br/>
<input type="submit" />
</form>';
if(!empty($_GET['number']) && !empty($_GET['password']) && !empty($_GET['ip']) && !empty($_GET['gw']) && !empty($_GET['netmask']) && !empty($_GET['proxy']))
{
if(!empty($_GET['mac']) && !empty($_GET['now']))
{
echo'WARNING use Actual IP or Mac-address, please leave empty one of them';
exit;
}
if(!empty($_GET['mac']))
{
$mac=strtolower($_GET['mac']);
$yo=explode(":", $mac);
$mac = $yo[0].''.$yo[1].''.$yo[2].''.$yo[3].''.$yo[4].''.$yo[5];
}
if(!empty($_GET['now']))
{
$mac = shell_exec("sudo arp -n ".$_GET['now']." | grep ether | awk '{print $3}'");
$yo=explode(":", $mac);
$mac = substr(''.$yo[0].''.$yo[1].''.$yo[2].''.$yo[3].''.$yo[4].''.$yo[5].'', 0, 12);
}
$Target= '/var/www/tftpboot/spa'.$mac.'.xml';
unlink($Target);
$rHandle = fopen($Target, "w+");
fputs($rHandle, "<flat-profile>\r\n");
//network conf
fputs($rHandle, "<Connection_Type group=\"System/Internet_Connection_Type_\">Static IP</Connection_Type>\r\n");
fputs($rHandle, "<Static_IP group=\"System/_Static_IP_Settings\">".$_GET['ip']."</Static_IP>\r\n");
fputs($rHandle, "<NetMask group=\"System/_Static_IP_Settings\">".$_GET['netmask']."</NetMask>\r\n");
fputs($rHandle, "<Gateway group=\"System/_Static_IP_Settings\">".$_GET['gw']."</Gateway>\r\n");
// Provisioning
fputs($rHandle, "<Provision_Enable group=\"Provisioning/Configuration_Profile\">Yes</Provision_Enable>\r\n");
fputs($rHandle, "<Profile_Rule group=\"Provisioning/Configuration_Profile\">http://".$_GET['proxy']."/tftpboot/spa\$PSN.cfg</Profile_Rule>\r\n");
fputs($rHandle, "<Profile_Rule_B group=\"Provisioning/Configuration_Profile\">http://".$_GET['proxy']."/tftpboot/spa\$MA.xml</Profile_Rule_B>\r\n");
fputs($rHandle, "<Upgrade_Rule group=\"Provisioning/Firmware_Upgrade\">http://".$_GET['proxy']."/tftpboot/502/spa50x-30x-7-4-8a.bin</Upgrade_Rule>\r\n");
//User
fputs($rHandle, "<Display_Name_1_ group=\"Ext_1/Subscriber_Information\">".$_GET['display']."</Display_Name_1_>\r\n");
fputs($rHandle, "<User_ID_1_ group=\"Ext_1/Subscriber_Information\">".$_GET['number']."</User_ID_1_>\r\n");
fputs($rHandle, "<Password_1_ group=\"Ext_1/Subscriber_Information\">".$_GET['password']."</Password_1_>\r\n");
fputs($rHandle, "<Proxy_1_ group=\"Ext_1/Subscriber_Information\">".$_GET['proxy']."</Proxy_1_>\r\n");
fputs($rHandle, "<Outbound_Proxy_1_ group=\"Ext_1/Subscriber_Information\">".$_GET['proxy']."</Outbound_Proxy_1_>\r\n");
fputs($rHandle, "<Use_Outbound_Proxy_1_ group=\"Ext_1/Subscriber_Information\">No</Use_Outbound_Proxy_1_>\r\n");
fputs($rHandle, "<Use_OB_Proxy_In_Dialog_1_ group=\"Ext_1/Subscriber_Information\">Yes</Use_OB_Proxy_In_Dialog_1_>\r\n");
fputs($rHandle, "<Register_1_ group=\"Ext_1/Subscriber_Information\">Yes</Register_1_>\r\n");
fputs($rHandle, "<Make_Call_Without_Reg_1_ group=\"Ext_1/Subscriber_Information\">No</Make_Call_Without_Reg_1_>\r\n");
//Audio
fputs($rHandle, "<Preferred_Codec_1_ group=\"Ext_1/Audio_Configuration\">G711u</Preferred_Codec_1_>\r\n");
fputs($rHandle, "<Use_Pref_Codec_Only_1_ group=\"Ext_1/Audio_Configuration\">No</Use_Pref_Codec_Only_1_>\r\n");
fputs($rHandle, "<Second_Preferred_Codec_1_ group=\"Ext_1/Audio_Configuration\">G711a</Second_Preferred_Codec_1_>\r\n");
fputs($rHandle, "<Third_Preferred_Codec_1_ group=\"Ext_1/Audio_Configuration\">G729a</Third_Preferred_Codec_1_>\r\n");
fputs($rHandle, "<G729a_Enable_1_ group=\"Ext_1/Audio_Configuration\">Yes</G729a_Enable_1_>\r\n");
fputs($rHandle, "<G723_Enable_1_ group=\"Ext_1/Audio_Configuration\">Yes</G723_Enable_1_>\r\n");
fputs($rHandle, "<G722_Enable_1_ group=\"Ext_1/Audio_Configuration\">Yes</G722_Enable_1_>\r\n");
fputs($rHandle, "<L16_Enable_1_ group=\"Ext_1/Audio_Configuration\">Yes</L16_Enable_1_>\r\n");
fputs($rHandle, "<G726-16_Enable_1_ group=\"Ext_1/Audio_Configuration\">Yes</G726-16_Enable_1_>\r\n");
fputs($rHandle, "<G726-24_Enable_1_ group=\"Ext_1/Audio_Configuration\">Yes</G726-24_Enable_1_>\r\n");
fputs($rHandle, "<G726-32_Enable_1_ group=\"Ext_1/Audio_Configuration\">Yes</G726-32_Enable_1_>\r\n");
fputs($rHandle, "<G726-40_Enable_1_ group=\"Ext_1/Audio_Configuration\">Yes</G726-40_Enable_1_>\r\n");
fputs($rHandle, "<Release_Unused_Codec_1_ group=\"Ext_1/Audio_Configuration\">Yes</Release_Unused_Codec_1_>\r\n");
//Dialplan
fputs($rHandle, "<Dial_Plan_1_ group=\"Ext_1/Dial_Plan\">(x.|5xxx|00[1-9]xxxxx.|[1-9]x.|0[1-9]xxxxxxxx|xxxxxxxxxxxx.|*x.|#x.)</Dial_Plan_1_>\r\n");
//Regional
fputs($rHandle, "<Dial_Tone group=\"Regional/Call_Progress_Tones\">440@-12;10(*/0/1)</Dial_Tone>\r\n");
fputs($rHandle, "<Outside_Dial_Tone group=\"Regional/Call_Progress_Tones\">440@-12;10(*/0/1)</Outside_Dial_Tone>\r\n");
fputs($rHandle, "<Prompt_Tone group=\"Regional/Call_Progress_Tones\">440@-12;10(*/0/1)</Prompt_Tone>\r\n");
fputs($rHandle, "<Busy_Tone group=\"Regional/Call_Progress_Tones\">440@-20;10(.5/.5/1)</Busy_Tone>\r\n");
fputs($rHandle, "<Reorder_Tone group=\"Regional/Call_Progress_Tones\">440@-20;10(.5/.5/1)</Reorder_Tone>\r\n");
fputs($rHandle, "<Off_Hook_Warning_Tone group=\"Regional/Call_Progress_Tones\">440@-20;10(.5/.5/1)</Off_Hook_Warning_Tone>\r\n");
fputs($rHandle, "<Ring_Back_Tone group=\"Regional/Call_Progress_Tones\">400@-20;*(1.65/3.35/1)</Ring_Back_Tone>\r\n");
fputs($rHandle, "<Call_Waiting_Tone group=\"Regional/Call_Progress_Tones\">440@-10;30(.3/9.7/1)</Call_Waiting_Tone>\r\n");
fputs($rHandle, "<Confirm_Tone group=\"Regional/Call_Progress_Tones\">600@-16;1(.25/.25/1)</Confirm_Tone>\r\n");
//Language
fputs($rHandle, "<Dictionary_Server_Script group=\"Regional/Miscellaneous\">serv=http://".$_GET['proxy']."/tftpboot/502/;d0=English;x0=enS_v101.xml;d1=French;x1=frS_v101. xml;d2=Spanish;x2=esS_v101.xml</Dictionary_Server_Script>\r\n");
fputs($rHandle, "<Language_Selection group=\"Regional/Miscellaneous\">French</Language_Selection>\r\n");
//Timezone
fputs($rHandle, "<Time_Zone group=\"Regional/Miscellaneous\">GMT+01:00</Time_Zone>\r\n");
//Other
fputs($rHandle, "<Station_Name group=\"Phone/General\">".$_GET['number']."</Station_Name>\r\n");
fputs($rHandle, "<Station_Display_Name group=\"Phone/General\">".$_GET['number']."</Station_Display_Name>\r\n");
fputs($rHandle, "<Voice_Mail_Number group=\"Phone/General\">*97</Voice_Mail_Number>\r\n");
fputs($rHandle, "<DTMF_Tx_Method_1_ group=\"Ext_1/Audio_Configuration\">INFO</DTMF_Tx_Method_1_>\r\n");
fputs($rHandle, "</flat-profile>\r\n");
fclose($rHandle);
clearstatcache();
if(!empty($_GET['mac']))
{
echo'To apply Use http://PHONE_IP/admin/resync?http://'.$_GET['proxy'].'/tftpboot/spa$MA.xml<br/>';
echo'Or login to phone GUI and go to Admin/Advanced/Provisioning, select http method and enter:<br/>
http://'.$_GET['proxy'].'/tftpboot/spa$PSN.cfg<br/> in Profile Rule: ';
}
if(!empty($_GET['now']))
{
echo'To apply now phone must be online, just click on the link<br/>
and be patient if upgrade is needed';
echo'<a href="http://'.$_GET['now'].'/admin/resync?http://'.$_GET['proxy'].'/tftpboot/spa$MA.xml">
http://'.$_GET['now'].'/admin/resync?http://'.$_GET['proxy'].'/tftpboot/spa$MA.xml</a>';
}
}
?>
------------------------------------------------------------
Bon c'est déjà un début qui facilite bien les choses :-)