You should be able to use basic authentication with setting the "headers" in your url or you need to alter the code in get2post.php and add curl options "CURLOPT_HTTPAUTH" and "CURLOPT_USERPWD".
Solution 1 (without any changes in code):
1. First you need to base64 encode the username and password in this format: username:password
e.g. try
https://www.base64encode.org/ --> user1:pass1 would be "dXNlcjE6cGFzczE=" base64 encoded
2. Then your header should be like this: "Authorization: Basic dXNlcjE6cGFzczE="
3. Set you push event url (replace "dXNlcjE6cGFzczE=" with your base64 encoded string):
- Code: Select all
get2post.php?uniqueid=--A--epoch--B--.--A--agent_log_id--B--&type=event&&headers=Authorization---Basic dXNlcjE6cGFzczE=&HTTPURLTOPOST=192.168.1.3/agc/vdc_call_url_test.php?user=--A--user--B--&lead_id=--A--lead_id--B--&event=--A--event--B--&message=--A--message--B--
Solution 2:
1. Change get2post.php (curl part starting at line 158 in revision from 2017-05-31):
- Code: Select all
curl_setopt_array($curl, array(
// add next 2 lines and change user and pass with your real user credentials
CURLOPT_HTTPAUTH => CURLAUTH_BASIC,
CURLOPT_USERPWD => 'user:pass',
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_POST => 1,
CURLOPT_URL => $post_page,
CURLOPT_POSTFIELDS => $post_vars,
CURLOPT_HTTPHEADER => $HTTPheader,
CURLOPT_USERAGENT => 'VICIdial get2post'
))
Vicibox 6.0.2 from Vicibox_v.6.0.x86_64-6.0.2.iso | Vicidial 2.12-560a build: 160617-1427 | Asterisk 1.8.32.3