<?php
	require_once('call_flow_functions.php');

    header('Content-Type: application/xml; charset=UTF-8');
	$call_id = isset($_REQUEST['call_id']) ? (int)$_REQUEST['call_id'] : 0;
	$base_url = base_url();
	$call_sid = $_POST['CallSid'];
	update_call($call_id, 'second_sip_sid', $call_sid);
	header('Content-Type: application/xml; charset=UTF-8');
	echo '<?xml version="1.0" encoding="UTF-8"?>';
	echo "<Response>
			<Dial>
				<Conference startConferenceOnEnter='false'
					endConferenceOnExit='true' beep='false' statusCallback='" . $base_url . "/signalwire_call/conference_connect.php?call_id=$call_id' statusCallbackEvent='start end join leave'>
					MyConference_$call_id
				</Conference>
			</Dial>
		</Response>";
?>
