{"action":"created","issue":{"url":"https://api.github.com/repos/jpwalters/OpenVBX-Plugin-SMS-Conversation/issues/3","labels_url":"https://api.github.com/repos/jpwalters/OpenVBX-Plugin-SMS-Conversation/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/jpwalters/OpenVBX-Plugin-SMS-Conversation/issues/3/comments","events_url":"https://api.github.com/repos/jpwalters/OpenVBX-Plugin-SMS-Conversation/issues/3/events","html_url":"https://github.com/jpwalters/OpenVBX-Plugin-SMS-Conversation/pull/3","id":125850097,"number":3,"title":"Find plugin location to correctly link sound file","user":{"login":"gegere","id":468238,"avatar_url":"https://avatars.githubusercontent.com/u/468238?v=3","gravatar_id":"","url":"https://api.github.com/users/gegere","html_url":"https://github.com/gegere","followers_url":"https://api.github.com/users/gegere/followers","following_url":"https://api.github.com/users/gegere/following{/other_user}","gists_url":"https://api.github.com/users/gegere/gists{/gist_id}","starred_url":"https://api.github.com/users/gegere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gegere/subscriptions","organizations_url":"https://api.github.com/users/gegere/orgs","repos_url":"https://api.github.com/users/gegere/repos","events_url":"https://api.github.com/users/gegere/events{/privacy}","received_events_url":"https://api.github.com/users/gegere/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-01-10T22:34:28Z","updated_at":"2016-01-12T03:15:07Z","closed_at":"2016-01-12T01:48:21Z","pull_request":{"url":"https://api.github.com/repos/jpwalters/OpenVBX-Plugin-SMS-Conversation/pulls/3","html_url":"https://github.com/jpwalters/OpenVBX-Plugin-SMS-Conversation/pull/3","diff_url":"https://github.com/jpwalters/OpenVBX-Plugin-SMS-Conversation/pull/3.diff","patch_url":"https://github.com/jpwalters/OpenVBX-Plugin-SMS-Conversation/pull/3.patch"},"body":"Hope you understand what is going on with this pull-request, I updated the code to find the plugins folder based on the location of the plugin which will be dynamic. I have a server hosting many Open-VBX installations for various customers. These installations are not residing in the root path of the system. Many of them are in subfolders.\r\n\r\nAn example for a OpenVBX login might be the following.\r\n`https://usa1.openphon.co/petgrooming`\r\n\r\nBased your quick fix the mp3 would still not be found, this pull request fixes this issue."},"comment":{"url":"https://api.github.com/repos/jpwalters/OpenVBX-Plugin-SMS-Conversation/issues/comments/170771101","html_url":"https://github.com/jpwalters/OpenVBX-Plugin-SMS-Conversation/pull/3#issuecomment-170771101","issue_url":"https://api.github.com/repos/jpwalters/OpenVBX-Plugin-SMS-Conversation/issues/3","id":170771101,"user":{"login":"jpwalters","id":4819310,"avatar_url":"https://avatars.githubusercontent.com/u/4819310?v=3","gravatar_id":"","url":"https://api.github.com/users/jpwalters","html_url":"https://github.com/jpwalters","followers_url":"https://api.github.com/users/jpwalters/followers","following_url":"https://api.github.com/users/jpwalters/following{/other_user}","gists_url":"https://api.github.com/users/jpwalters/gists{/gist_id}","starred_url":"https://api.github.com/users/jpwalters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpwalters/subscriptions","organizations_url":"https://api.github.com/users/jpwalters/orgs","repos_url":"https://api.github.com/users/jpwalters/repos","events_url":"https://api.github.com/users/jpwalters/events{/privacy}","received_events_url":"https://api.github.com/users/jpwalters/received_events","type":"User","site_admin":false},"created_at":"2016-01-12T03:15:06Z","updated_at":"2016-01-12T03:15:06Z","body":"I just hacked together this code and it seems to be working for me.\r\n\r\n```\r\n<audio id=\"notify\">\r\n<?php \r\n\t// Find plugin location to correctly link sound file\r\n\t$file = \"assets/notify.mp3\";\r\n\t$found_plugin_dir = false;\r\n\t$plugin_dir = \"plugins\";\r\n\t\r\n\t$plugin = OpenVBX::$currentPlugin;\r\n\t$info = $plugin->getInfo();\r\n\t$path = $info['plugin_path'] .'/'. $file;\r\n\t$plugin_dir = implode('/', array('plugins', $info['dir_name'], $file));\r\n\t\r\n\t$is_ssl_proto = false;\r\n\tswitch(true) {\r\n\t\tcase !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off':\r\n\t\t\t$is_ssl_proto = true;\r\n\t\t\tbreak;\r\n\t\tcase !empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https':\r\n\t\t\t$is_ssl_proto = true;\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\t$base_url = \"http\".($is_ssl_proto ? 's' : '') . \"://\".$_SERVER['HTTP_HOST']. rtrim(WEB_ROOT, '/') . '/';\r\n\t\t\t\t\t\t  \r\n?>\r\n<source src=\"<?= $base_url.$plugin_dir ?>\"></source>\r\n</audio>\r\n```"}}