{"id":178467,"date":"2013-04-30T15:58:04","date_gmt":"2013-04-30T11:58:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=178467"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=178467","title":{"rendered":"<span class=\"post_title\">\u0417\u0432\u043e\u043d\u043a\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0441 \u041a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043f\u043e\u0440\u0442\u0430\u043b\u0430<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/e1a\/a7e\/1ba\/e1aa7e1ba8639655595b2457c1071278.png\" align=\"left\"\/><br \/>  \u041c\u043d\u043e\u0433\u0438\u0435 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043c\u0430\u0441\u0441\u0443 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0445 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0438 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u0438 \u043e\u0431\u043b\u0435\u0433\u0447\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b. \u0420\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e \u0432\u0441\u0442\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u043e\u0431 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u044d\u0442\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u0438 \u043d\u0435\u0440\u0435\u0434\u043a\u043e \u0432\u044b\u0431\u043e\u0440 \u00ab\u0441\u0432\u044f\u0437\u0443\u044e\u0449\u0435\u0433\u043e \u0437\u0432\u0435\u043d\u0430\u00bb \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u043e\u043b\u044c\u0437\u0443 \u0432\u0435\u0431-\u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439. \u0412 \u0442\u0430\u043a\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0435\u0440\u0435\u0434 \u0432\u0435\u0431-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u043c \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432\u0441\u0435\u043c\u0438 \u044d\u0442\u0438\u043c\u0438 \u0434\u043e\u0441\u0435\u043b\u0435 \u043d\u0435\u0437\u043d\u0430\u043a\u043e\u043c\u044b\u043c\u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u043c\u0438 \u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438 \u043e\u0432\u043b\u0430\u0434\u0435\u0442\u044c.<\/p>\n<p>  <br clear=\"all\"\/>  \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043e\u043f\u0438\u0448\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438:  <\/p>\n<ul>\n<li><a href=\"http:\/\/ru.wikipedia.org\/wiki\/Active_Directory\">ActiveDirectory<\/a> (\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u0430\u0445 \u0438 \u0438\u0445 \u043d\u043e\u043c\u0435\u0440\u0430\u0445 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043e\u0432)<\/li>\n<li>1\u0421-\u0411\u0438\u0442\u0440\u0438\u043a\u0441: <a href=\"http:\/\/www.1c-bitrix.ru\/products\/intranet\/\">\u041a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043f\u043e\u0440\u0442\u0430\u043b<\/a> (\u0434\u0432\u0438\u0436\u043e\u043a, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438)<\/li>\n<li><a href=\"http:\/\/ru.wikipedia.org\/wiki\/Asterisk\">Asterisk<\/a> (\u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0438\u0435\u0439)<\/li>\n<\/ul>\n<p>  \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0437\u0432\u043e\u043d\u043a\u043e\u0432 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0432\u0435\u0431-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430.<\/p>\n<p>  <a name=\"habracut\"><\/a><br \/>  \u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0443 \u0432\u0430\u0441 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c:  <\/p>\n<ol>\n<li>\u041d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043e\u0432 \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438<\/li>\n<li>\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f Asterisk \u0438 \u0435\u0433\u043e \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440<\/li>\n<li>\u0421\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e \u043d\u043e\u043c\u0435\u0440\u0430\u0445 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043e\u0432<\/li>\n<li>\u041a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043f\u043e\u0440\u0442\u0430\u043b (\u0432\u043f\u0440\u043e\u0447\u0435\u043c, \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043b\u044e\u0431\u043e\u043c \u0434\u0432\u0438\u0436\u043a\u0435 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438)<\/li>\n<\/ol>\n<p>  \u0412 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c, \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u0440\u0430\u043c\u043a\u0438 \u043a\u043e\u043c\u043f\u0435\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u0430 \u043f\u043e \u0432\u0435\u0431-\u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u0435\u0441\u0442\u044c, \u0438 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 \u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0439 \u0447\u0430\u0441\u0442\u044f\u043c.<\/p>\n<p>  \u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b:  <\/p>\n<ol>\n<li>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 MySQL \u0441 \u043b\u043e\u0433\u0438\u043d\u0430\u043c\u0438 \u0438 \u043d\u043e\u043c\u0435\u0440\u0430\u043c\u0438 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432. \u0414\u0430\u043d\u043d\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0433\u0440\u0443\u0436\u0435\u043d\u044b \u0438\u0437 AD \u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0442\u0440\u0443\u0434\u043e\u0437\u0430\u0442\u0440\u0430\u0442\u0430\u043c\u0438. \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0438 \u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u041f\u043e\u0440\u0442\u0430\u043b\u0430, \u043d\u043e \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438 \u0411\u0438\u0442\u0440\u0438\u043a\u0441\u0430, \u0430 \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445 \u2014 \u0432 \u043d\u0430\u0448\u0435\u0439 \u2014 \u043a\u0430\u043a, \u0434\u0443\u043c\u0430\u044e, \u0438 \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u2014 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043d\u044b\u0439 \u043d\u043e\u043c\u0435\u0440 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043d\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0430. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043c\u044b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0438\u0437\u0433\u043e\u0442\u043e\u0432\u0438\u043b\u0438 \u0433\u0430\u0434\u0436\u0435\u0442 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0441\u0442\u043e\u043b\u0430 \u041f\u043e\u0440\u0442\u0430\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u043d\u043e\u043c\u0435\u0440 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0437\u0432\u043e\u043d\u043a\u043e\u0432, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u0430\u043c \u041a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0446\u0435\u043d\u0442\u0440\u0430 \u043b\u0435\u0433\u043a\u043e \u0437\u0432\u043e\u043d\u0438\u0442\u044c \u0438\u0437 \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0440\u043e\u0444\u0438\u043b\u044f \u0441 \u043b\u044e\u0431\u043e\u0433\u043e \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043c\u0435\u0441\u0442\u0430.<br \/>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 `phones`:<br \/> <br \/>\n<table>\n<tr>\n<th>id<\/th>\n<th>user<\/th>\n<th>number<\/th>\n<\/tr>\n<tr>\n<td>238<\/td>\n<td>LutovVO<\/td>\n<td>50512<\/td>\n<\/tr>\n<\/table>\n<p>  <\/li>\n<li>PHP-\u0444\u0430\u0439\u043b, \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0449\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b Asterisk-\u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <a href=\"http:\/\/www.php.net\/curl\/\">CURL<\/a> \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f<br \/> \n<div class=\"spoiler\"><b class=\"spoiler_title\">call.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;? \/\/ \u0417\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u0435\u0437 \u0432\u044b\u0432\u043e\u0434\u0430 require($_SERVER[&quot;DOCUMENT_ROOT&quot;].&quot;\/bitrix\/modules\/main\/include\/prolog_before.php&quot;);  $USER = new CUser; $userlogin = $USER-&gt;GetLogin();  \/\/ \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u043e\u043c\u0435\u0440 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438\u0437 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0431\u0430\u0437\u044b $results = $DB-&gt;Query(&quot;SELECT `number` FROM `phones` WHERE `user`='&quot;.$userlogin.&quot;' LIMIT 1&quot;); $userphone = $results-&gt;Fetch(); \t if (!empty($_POST['call'])) { \t\/\/ \u0423\u0434\u0430\u043b\u044f\u0435\u043c \u043f\u043e\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u044b\u0438\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0438\u0437 \u043d\u043e\u043c\u0435\u0440\u0430 \t$recipient = str_replace(' ', '', $_POST['recipient']); \t$recipient = str_replace('+', '', $recipient); \t$recipient = str_replace('-', '', $recipient); \t$recipient = str_replace('(', '', $recipient); \t$recipient = str_replace(')', '', $recipient); \t \t$answer = '';  \t\/\/ C\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a Asterisk \t$command = array(); \t$command[1] = 'action=login&username=PORTAL&secret=PASSWORD&events=off'; \t$command[2] = 'action=originate&channel=local\/'.$userphone['number'].'@PORTAL&context=redirportal&exten='.$recipient.'&priority=1&CallerID=PORTAL'; \t$command[3] = 'action=logoff'; \t \t\/\/ \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 CURL \t$curl = curl_init(); \t  \tforeach($command as $key =&gt; $data) \t{ \t\t\/\/ \u0425\u0440\u0430\u043d\u0438\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0441\u0435\u0430\u043d\u0441\u0430 \u0441\u0432\u044f\u0437\u0438, \u0431\u0435\u0437 \u043d\u0435\u0435 \u043d\u0430\u0448\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043d\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \t\t$mansession = $_COOKIE['mansession_id']; \t\t$cookie = 'mansession_id=&quot;'.$mansession.'&quot;'; \t \t\t\/\/ \u0417\u0430\u0434\u0430\u0435\u043c \u0430\u0434\u0440\u0435\u0441 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 Asterisk \t\tcurl_setopt($curl, CURLOPT_URL, 'http:\/\/127.0.0.1:8088\/rawman'); \t\t  \t\t\/\/ \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0432\u044b\u0432\u043e\u0434 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u0432 \t\tcurl_setopt($curl, CURLOPT_HEADER, 1); \t\t  \t\t\/\/ \u041f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u043c POST \t\tcurl_setopt($curl, CURLOPT_POST, 1); \t\t \t\t\/\/ \u0410\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u043c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 cookie \t\tcurl_setopt($curl, CURLOPT_COOKIE, $cookie); \t\t  \t\t\/\/ CURL \u0432\u0435\u0440\u043d\u0435\u0442 \u043e\u0442\u0432\u0435\u0442, \u0430 \u043d\u0435 \u0432\u044b\u0432\u0435\u0434\u0435\u0442 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 (\u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c) \t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); \t\t  \t\t\/\/ \u041f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \t\tcurl_setopt($curl, CURLOPT_POSTFIELDS, $data); \t\t  \t\t$res = curl_exec($curl); \t\t  \t\t\/\/ \u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0435\u0435 \u043d\u043e\u043c\u0435\u0440 \u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \t\tif(!$res) \t\t{ \t\t\t$error = curl_error($curl).'('.curl_errno($curl).')'; \t\t\techo $error; \t\t} \t\t\/\/ \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \t\telse \t\t{ \t\t\t\/\/ \u0412\u044b\u0440\u0435\u0436\u0435\u043c \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u0438\u0437 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u0432 \u043e\u0442\u0432\u0435\u0442\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0441\u0435\u0441\u0441\u0438\u0438 \t\t\tpreg_match('\/mansession_id=&quot;(.*)&quot;;\/', $res, $cut); \t\t\t$_COOKIE['mansession_id'] = $cut[1]; \t\t\t \t\t\t\/\/ \u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u044b\u0432\u043e\u0434 \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \t\t\t$tech_answer .= '&lt;h2&gt;\u0417\u0430\u043f\u0440\u043e\u0441 '.$key.': '.$data.'&lt;\/h2&gt;'.'&lt;p&gt;&lt;b&gt;\u041e\u0442\u0432\u0435\u0442:&lt;\/b&gt;&lt;\/p&gt;'.nl2br($res).'&lt;br\/&gt;&lt;hr&gt;&lt;br\/&gt;'; \t\t\t$answer = '&lt;p style=&quot;color:green;&quot;&gt;\u041e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0432\u043e\u043d\u043e\u043a&lt;\/p&gt;'; \t\t}\t\t \t} \t \tcurl_close($curl); \tdie('ok'); } else  { \tdie('not_ok'); } ?&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/li>\n<li>JavaScript-\u0444\u0430\u0439\u043b, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0437\u0432\u043e\u043d\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 <a href=\"http:\/\/ru.wikipedia.org\/wiki\/AJAX\">AJAX<\/a> \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b. \u041d\u0430 90% \u043e\u043d \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u0435\u0431\u0435\u0437\u044b\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <a href=\"http:\/\/xmlhttprequest.ru\/\">XMLHTTPRequest<\/a> \u0438 \u0435\u0433\u043e \u043e\u0431\u0435\u0440\u0442\u043e\u043a, \u0442\u0430\u043a \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u044d\u0442\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438\u0437 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c js-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0432\u0441\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0434\u0430\u0436\u0435 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u0435\u0435<br \/> \n<div class=\"spoiler\"><b class=\"spoiler_title\">script.js<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">function createRequestObject()  {   if (typeof XMLHttpRequest === 'undefined')    {     XMLHttpRequest = function()  \t{       try { return new ActiveXObject(&quot;Msxml2.XMLHTTP.6.0&quot;); }         catch(e) {}       try { return new ActiveXObject(&quot;Msxml2.XMLHTTP.3.0&quot;); }         catch(e) {}       try { return new ActiveXObject(&quot;Msxml2.XMLHTTP&quot;); }         catch(e) {}       try { return new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;); }         catch(e) {}       throw new Error(&quot;This browser does not support XMLHttpRequest.&quot;);     };   }   return new XMLHttpRequest(); }  function ajax_submit(params, path)  { \tvar req;  \treq = createRequestObject(); \t\t \treq.open('POST', path, true);  \t\t \treq.timeout=5000; \t\t \treq.setRequestHeader('Content-Type', 'application\/x-www-form-urlencoded'); \t\t \treq.onreadystatechange = function()  \t{   \t\tif (req.readyState == 4)  \t\t{ \t\t\tif(req.status == 200)  \t\t\t{  \t\t\t\t\/\/ alert(&quot;\u041e\u0442\u0432\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430: &quot;+req.responseText); \t\t\t\tif (req.responseText=='ok') \t\t\t\t{ \t\t\t\t\t\/\/ alert('\u041f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c!'); \t\t\t\t} \t\t\t\telse  \t\t\t\t{ \t\t\t\t\t\/\/ alert('\u041d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c!'); \t\t\t\t} \t\t\t} \t\t\telse  \t\t\t{ \t\t\t\t\/\/ alert('\u041d\u0435\u0442 \u0441\u0432\u044f\u0437\u0438'); \t\t\t} \t\t} \t} \treq.send(params); }  function call_to (number) { \tvar params = 'call=1&recipient='+number; \tvar path = '\/services\/telephony\/call\/'; \tajax_submit(params, path) } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/li>\n<li>\u0412\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u0445 \u0438\u043b\u0438 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u0445 \u0411\u0438\u0442\u0440\u0438\u043a\u0441\u0430<br \/> \n<pre><code class=\"html\">&lt;span class=&quot;link&quot; onclick=&quot;call_to('50512')&quot;&gt;\u041f\u043e\u0437\u0432\u043e\u043d\u0438\u0442\u044c&lt;\/span&gt; \u041b\u044e\u0442\u043e\u0432\u0443 <\/code><\/pre>\n<p>  <\/li>\n<\/ol>\n<p>  \u0412 \u043e\u0431\u0449\u0435\u043c-\u0442\u043e, \u044d\u0442\u043e \u0432\u0441\u0435, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e.<br \/>  \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u0430, \u0436\u0435\u043b\u0430\u044e\u0449\u0435\u0433\u043e \u043f\u043e\u0437\u0432\u043e\u043d\u0438\u0442\u044c, \u0442\u0430\u043a\u043e\u0432:  <\/p>\n<ol>\n<li>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043d\u0430 \u0420\u0430\u0431\u043e\u0447\u0435\u043c \u0441\u0442\u043e\u043b\u0435 \u041f\u043e\u0440\u0442\u0430\u043b\u0430, \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u043b\u0438 \u0435\u0433\u043e \u043d\u043e\u043c\u0435\u0440 \u0432 \u0441\u0435\u0442\u0438 (\u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u043d\u043e\u043c\u0435\u0440 \u0443\u0436\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u043d, \u043f\u0435\u0440\u0435\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u043e\u0432\u044b\u043c \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0435\u0437\u0436\u0430\u044e\u0449\u0438\u043c \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u0430\u043c, \u0442\u0430\u043a \u0447\u0442\u043e, \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c, \u043e\u0431\u044b\u0447\u043d\u043e, \u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0430)<\/li>\n<li>\u041d\u0430\u0439\u0442\u0438 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043d\u043e\u043c\u0435\u0440 \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u0438\u0441\u043a, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0438\u043b\u0438 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043d\u044b\u0439 \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a<\/li>\n<li>\u041a\u043b\u0438\u043a\u043d\u0443\u0442\u044c \u043f\u043e \u043d\u043e\u043c\u0435\u0440\u0443<\/li>\n<\/ol>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0442\u0435\u043b\u0435\u0444\u043e\u043d, \u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u043d\u0430 \u0435\u0433\u043e \u0441\u0442\u043e\u043b\u0435, \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0437\u0432\u043e\u043d\u0438\u0442\u044c. \u0421\u0442\u043e\u0438\u0442 \u0441\u043d\u044f\u0442\u044c \u0442\u0440\u0443\u0431\u043a\u0443, \u043a\u0430\u043a \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 \u0446\u0435\u043b\u0435\u0432\u044b\u043c \u043d\u043e\u043c\u0435\u0440\u043e\u043c.    \t \t\t   \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/178467\/\"> http:\/\/habrahabr.ru\/post\/178467\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/e1a\/a7e\/1ba\/e1aa7e1ba8639655595b2457c1071278.png\" align=\"left\"\/><br \/>  \u041c\u043d\u043e\u0433\u0438\u0435 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043c\u0430\u0441\u0441\u0443 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0445 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0438 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u0438 \u043e\u0431\u043b\u0435\u0433\u0447\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b. \u0420\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e \u0432\u0441\u0442\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u043e\u0431 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u044d\u0442\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u0438 \u043d\u0435\u0440\u0435\u0434\u043a\u043e \u0432\u044b\u0431\u043e\u0440 \u00ab\u0441\u0432\u044f\u0437\u0443\u044e\u0449\u0435\u0433\u043e \u0437\u0432\u0435\u043d\u0430\u00bb \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u043e\u043b\u044c\u0437\u0443 \u0432\u0435\u0431-\u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0439. \u0412 \u0442\u0430\u043a\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0435\u0440\u0435\u0434 \u0432\u0435\u0431-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u043c \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432\u0441\u0435\u043c\u0438 \u044d\u0442\u0438\u043c\u0438 \u0434\u043e\u0441\u0435\u043b\u0435 \u043d\u0435\u0437\u043d\u0430\u043a\u043e\u043c\u044b\u043c\u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u043c\u0438 \u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438 \u043e\u0432\u043b\u0430\u0434\u0435\u0442\u044c.<\/p>\n<p>  <br clear=\"all\"\/>  \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043e\u043f\u0438\u0448\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438:  <\/p>\n<ul>\n<li><a href=\"http:\/\/ru.wikipedia.org\/wiki\/Active_Directory\">ActiveDirectory<\/a> (\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u0430\u0445 \u0438 \u0438\u0445 \u043d\u043e\u043c\u0435\u0440\u0430\u0445 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043e\u0432)<\/li>\n<li>1\u0421-\u0411\u0438\u0442\u0440\u0438\u043a\u0441: <a href=\"http:\/\/www.1c-bitrix.ru\/products\/intranet\/\">\u041a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043f\u043e\u0440\u0442\u0430\u043b<\/a> (\u0434\u0432\u0438\u0436\u043e\u043a, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438)<\/li>\n<li><a href=\"http:\/\/ru.wikipedia.org\/wiki\/Asterisk\">Asterisk<\/a> (\u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0438\u0435\u0439)<\/li>\n<\/ul>\n<p>  \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0437\u0432\u043e\u043d\u043a\u043e\u0432 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0432\u0435\u0431-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-178467","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/178467","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=178467"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/178467\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=178467"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=178467"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=178467"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}