...
server_args = -s /tftpboot -v
...
<device> <fullConfig>true</fullConfig> <deviceProtocol>SIP</deviceProtocol> <devicePool> <dateTimeSetting> <dateTemplate>DMY</dateTemplate> <timeZone>Ekaterinburg Standard Time</timeZone> <ntps> <ntp> <name>$ASTERISK</name> <ntpMode>Unicast</ntpMode> </ntp> </ntps> </dateTimeSetting> <callManagerGroup> <tftpDefault>true</tftpDefault> <members> <member priority="0"> <callManager> <name>$ASTERISK</name> <description>CallManager 5.0</description> <ports> <ethernetPhonePort>2000</ethernetPhonePort> <sipPort>5060</sipPort> <securedSipPort>5061</securedSipPort> </ports> <processNodeName>$ASTERISK</processNodeName> </callManager> </member> </members> </callManagerGroup> </devicePool> <commonProfile> <phonePassword></phonePassword> <backgroundImageAccess>true</backgroundImageAccess> <callLogBlfEnabled>0</callLogBlfEnabled> </commonProfile> <loadInformation>SIP42.8-5-4S</loadInformation> <loadInformation434 model="Cisco 7942">SIP42.8-5-4S</loadInformation434> <vendorConfig> <disableSpeaker>false</disableSpeaker> <disableSpeakerAndHeadset>false</disableSpeakerAndHeadset> <pcPort>0</pcPort> <settingsAccess>1</settingsAccess> <garp>0</garp> <voiceVlanAccess>0</voiceVlanAccess> <videoCapability>0</videoCapability> <autoSelectLineEnable>0</autoSelectLineEnable> <daysDisplayNotActive>1,7</daysDisplayNotActive> <displayOnTime>10:30</displayOnTime> <displayOnDuration>06:05</displayOnDuration> <displayIdleTimeout>00:05</displayIdleTimeout> <webAccess>1</webAccess> <spanToPCPort>1</spanToPCPort> <loggingDisplay>1</loggingDisplay> <loadServer></loadServer> </vendorConfig> <userLocale> <name>Russian_Russian_Federation</name> <uid></uid> <langCode>ru_RU</langCode> <version>8.4.3.1000-1</version> <winCharSet>utf-8</winCharSet> </userLocale> <networkLocale>Russian_Federation</networkLocale> <networkLocaleInfo> <name>Russian_Federation</name> <uid></uid> <version>8.4.3.1000-1</version> </networkLocaleInfo> <deviceSecurityMode>1</deviceSecurityMode> <idleTimeout>0</idleTimeout> <directoryURL></directoryURL> <servicesURL>$SERVICESURL</servicesURL> <idleURL></idleURL> <messagesURL></messagesURL> <proxyServerURL></proxyServerURL> <dscpForSCCPPhoneConfig>96</dscpForSCCPPhoneConfig> <dscpForSCCPPhoneServices>0</dscpForSCCPPhoneServices> <dscpForCm2Dvce>96</dscpForCm2Dvce> <transportLayerProtocol>2</transportLayerProtocol> <capfAuthMode>0</capfAuthMode> <capfList> <capf> <phonePort>3804</phonePort> </capf> </capfList> <certHash></certHash> <encrConfig>false</encrConfig> <sipProfile> <sipProxies> <backupProxy>$ASTERISK</backupProxy> <backupProxyPort>5060</backupProxyPort> <emergencyProxy>$ASTERISK</emergencyProxy> <emergencyProxyPort>5060</emergencyProxyPort> <outboundProxy>$ASTERISK</outboundProxy> <outboundProxyPort>5060</outboundProxyPort> <registerWithProxy>true</registerWithProxy> </sipProxies> <sipCallFeatures> <cnfJoinEnabled>true</cnfJoinEnabled> <callForwardURI>x--serviceuri-cfwdall</callForwardURI> <callPickupURI>x-cisco-serviceuri-pickup</callPickupURI> <callPickupListURI>x-cisco-serviceuri-opickup</callPickupListURI> <callPickupGroupURI>x-cisco-serviceuri-gpickup</callPickupGroupURI> <meetMeServiceURI>x-cisco-serviceuri-meetme</meetMeServiceURI> <abbreviatedDialURI>x-cisco-serviceuri-abbrdial</abbreviatedDialURI> <rfc2543Hold>false</rfc2543Hold> <callHoldRingback>2</callHoldRingback> <localCfwdEnable>true</localCfwdEnable> <semiAttendedTransfer>true</semiAttendedTransfer> <anonymousCallBlock>2</anonymousCallBlock> <callerIdBlocking>2</callerIdBlocking> <dndControl>0</dndControl> <remoteCcEnable>true</remoteCcEnable> </sipCallFeatures> <sipStack> <sipInviteRetx>6</sipInviteRetx> <sipRetx>10</sipRetx> <timerInviteExpires>180</timerInviteExpires> <timerRegisterExpires>3600</timerRegisterExpires> <timerRegisterDelta>5</timerRegisterDelta> <timerKeepAliveExpires>120</timerKeepAliveExpires> <timerSubscribeExpires>120</timerSubscribeExpires> <timerSubscribeDelta>5</timerSubscribeDelta> <timerT1>500</timerT1> <timerT2>4000</timerT2> <maxRedirects>70</maxRedirects> <remotePartyID>false</remotePartyID> <userInfo>None</userInfo> </sipStack> <autoAnswerTimer>1</autoAnswerTimer> <autoAnswerAltBehavior>false</autoAnswerAltBehavior> <autoAnswerOverride>true</autoAnswerOverride> <transferOnhookEnabled>false</transferOnhookEnabled> <enableVad>false</enableVad> <preferredCodec>g711alaw</preferredCodec> <dtmfAvtPayload>101</dtmfAvtPayload> <dtmfDbLevel>3</dtmfDbLevel> <dtmfOutofBand>avt</dtmfOutofBand> <alwaysUsePrimeLine>false</alwaysUsePrimeLine> <alwaysUsePrimeLineVoiceMail>false</alwaysUsePrimeLineVoiceMail> <kpml>3</kpml> <stutterMsgWaiting>1</stutterMsgWaiting> <callStats>true</callStats> <silentPeriodBetweenCallWaitingBursts>10</silentPeriodBetweenCallWaitingBursts> <disableLocalSpeedDialConfig>true</disableLocalSpeedDialConfig> <startMediaPort>10100</startMediaPort> <stopMediaPort>10300</stopMediaPort> <voipControlPort>5060</voipControlPort> <dscpForAudio>184</dscpForAudio> <ringSettingBusyStationPolicy>0</ringSettingBusyStationPolicy> <dialTemplate>dialplan.xml</dialTemplate> <phoneLabel>Cisco</phoneLabel> <natReceivedProcessing>false</natReceivedProcessing> <natEnabled>false</natEnabled> <natAddress></natAddress> <sipLines> <line button="1"> <featureID>9</featureID> <featureLabel>$ACCOUNT</featureLabel> <proxy>$ASTERISK</proxy> <port>5060</port> <name>$ACCOUNT</name> <displayName>$ACCOUNT</displayName> <autoAnswer> <autoAnswerEnabled>2</autoAnswerEnabled> </autoAnswer> <callWaiting>3</callWaiting> <authName>$ACCOUNT</authName> <authPassword>$ACCOUNT_PASS</authPassword> <sharedLine>false</sharedLine> <messageWaitingLampPolicy>3</messageWaitingLampPolicy> <messagesNumber></messagesNumber> <ringSettingIdle>4</ringSettingIdle> <ringSettingActive>5</ringSettingActive> <contact>$ACCOUNT</contact> <forwardCallInfoDisplay> <callerName>true</callerName> <callerNumber>false</callerNumber> <redirectedNumber>false</redirectedNumber> <dialedNumber>true</dialedNumber> </forwardCallInfoDisplay> </line> <line button="2"> <featureID></featureID> <featureLabel></featureLabel> <speedDialNumber></speedDialNumber> </line> </sipLines> </sipProfile> </device>
<timeZone>Ekaterinburg Standard Time</timeZone> - , NTP- ( ).
<loadInformation>SIP42.8-5-4S</loadInformation> - ,
<userLocale> <name>Russian_Russian_Federation</name> <uid></uid> <langCode>ru_RU</langCode> <version>8.4.3.1000-1</version> <winCharSet>utf-8</winCharSet> </userLocale> <networkLocale>Russian_Federation</networkLocale> <networkLocaleInfo> <name>Russian_Federation</name> <uid></uid> <version>8.4.3.1000-1</version> </networkLocaleInfo>
<servicesURL>$SERVICESURL</servicesURL> - XML ( ).
<dialTemplate>dialplan.xml</dialTemplate> - , .
<line button="2"> - , .. SIP-.
<preferredCodec>g711alaw</preferredCodec> - G711 alaw .
... [$ACCOUNT] deny=0.0.0.0/0.0.0.0 permit=192.168.0.0/255.255.255.0 type=friend host=dynamic context=_ dtmfmode=rfc2833 disallow=all allow=alaw allow=ulaw allow=gsm username=$ACCOUNT secret=$ACCOUNT_PASS call-limit=2 ...
<DIALTEMPLATE> <TEMPLATE MATCH="*" Timeout="3"/> <!-- Anything else --> </DIALTEMPLATE>
<? header("Content-type: text/xml"); header("Connection: close"); header("Expires: -1"); $page=1; if(isset($_GET['page'])) { $page = $_GET['page']; if(settype($page,"integer") == false) die("<b>BAD REQUEST (invalid type)</b>"); } echo '<?xml version="1.0" encoding="UTF-8"?>'."\n"; $ldapconfig['host'] = '192.168.0.8'; $ldapconfig['port'] = NULL; $ldapconfig['basedn'] = 'ou=users,dc=MyCompany,dc=ru'; $ldapconfig['filter'] = "(&(uid=*)(objectClass=sambaSamAccount)(objectClass=inetOrgPerson))"; print("<CiscoIPPhoneDirectory>\n"); print("\t<Title> </Title>\n"); print("\t<Prompt> </Prompt>\n"); $DS = @ldap_connect($ldapconfig['host'], $ldapconfig['port']); if ( $DS === false ) exit("ldap_connect problem: ".ldap_error($DS)); $SRes = @ldap_search($DS, $ldapconfig['basedn'], $ldapconfig['filter']); if ( $SRes === false ) exit("ldap_search problem: ".ldap_error($DS)); $res = @ldap_get_entries($DS, $SRes); if ( $res === false ) exit("ldap_get_entries problem: ".ldap_error($DS)); $results = array(); for ($i = 0; $i < $res["count"]; $i++) { if (!isset($res[$i]["telephonenumber"])) continue; if (!isset($res[$i]["displayname"])) continue; $r_ar = array(); $r_ar['displayname']=$res[$i]["displayname"][0]; $r_ar['telephonenumber']=$res[$i]["telephonenumber"][0]; array_push($results, $r_ar); } for ($i = 0; $i < (count($results)-1); $i++) for ($k = $i+1; $k < count($results); $k++) { if (strcmp($results[$i]['displayname'],$results[$k]['displayname']) > 0) { $r_tmp = array(); $r_tmp = $results[$i]; $results[$i] = $results[$k]; $results[$k] = $r_tmp; } } for ($i = (32*($page-1)); $i < (32*$page); $i++) { if ($i == count($results)) break; print("\t<DirectoryEntry>\n"); print("\t\t<Name>"); print($results[$i]['displayname']); print("</Name>\n"); print("\t\t<Telephone>"); print($results[$i]['telephonenumber']); print("</Telephone>\n"); print("\t</DirectoryEntry>\n"); } print("<SoftKeyItem>"); print("<Name>Dial</Name>"); print("<URL>SoftKey:Dial</URL>"); print("<Position>1</Position>"); print("</SoftKeyItem>"); if ($page > 1) { print("<SoftKeyItem>"); print("<Name>Prev</Name>"); print("<URL>http://".$_SERVER['SERVER_NAME']."/asterisk/directory.php?page=".($page-1)."</URL>"); print("<Position>2</Position>"); print("</SoftKeyItem>"); } $count_pages = (int) (count($results) / 32); if ((count($results) % 32) !=0) $count_pages++; if ($page < $count_pages) { print("<SoftKeyItem>"); print("<Name>Next</Name>"); print("<URL>http://".$_SERVER['SERVER_NAME']."/asterisk/directory.php?page=".($page+1)."</URL>"); print("<Position>3</Position>"); print("</SoftKeyItem>"); } print("<SoftKeyItem>"); print("<Name>Exit</Name>"); print("<URL>SoftKey:Exit</URL>"); print("<Position>4</Position>"); print("</SoftKeyItem>"); print("</CiscoIPPhoneDirectory>\n"); ?>
<CiscoIPPhoneImageList> <ImageItem Image="TFTP:Desktops/320x196x4/Logo-TN.png" URL="TFTP:Desktops/320x196x4/Logo.png"/> </CiscoIPPhoneImageList>
Source: https://habr.com/ru/post/121140/
All Articles