Suppose $u=\phi_1(x+c_1t)+\psi_1(x-c_1t)$ for $x>0$ and $u=\phi_2(x+c_2t)+\psi_2(x-c_2t)$ for $x<0$.

Also we can solve $\phi_1(x)=\phi(x)-\frac{1}{2}\phi(0)$, $\psi_1(x)=\frac{1}{2}\phi(0)$ for $x>0$.

And $\phi_2=\psi_2=0$ for $x<0$.

It follows that $u=\phi(x+c_1t)$ for $x>c_1t$ and $u=0$ for $x<-c_2t$.

Now we are interested in $\psi_1(x)$ when $x<0$ and $\phi_2(x)$ when $x>0$.

Notice from boundary condition, for $t>0$

$$\phi_1(c_1t)-\psi_1(-c_1t)=\frac{c_1\beta}{c_2}\phi_2(c_2t)$$

$$\phi_1(c_1t)+\psi_1(-c_1t)=a\phi_2(c_2t)$$

Solve for $\psi_1$ and $\phi_2$, we have

$$\psi_1(x)=\frac{c_1\beta-ac_2}{ac_2+c_1\beta}\phi_1(-x) \enspace \text{for } x<0$$

$$\phi_2(x)=\frac{2c_2\phi_1(\frac{c_1x}{c_2})}{ac_2+c_1\beta} \enspace \text{for } x>0$$

Thus, for $-c_2t<x<0$,

$$u=\phi_2(x+c_2t)=\frac{2c_2}{ac_2+c_1\beta}[\phi(\frac{c_1}{c_2}(x+c_2t))-\frac{1}{2}\phi(0)]$$

For $0<x<c_1t$,

$$u=\phi_1(x+c_1t)+\psi_1(x-c_1t)=\phi(x+c_1t)-\frac{1}{2}\phi(0)+\frac{c_1\beta-ac_2}{ac_2+c_1\beta}[\phi(c_1t-x)-\frac{1}{2}\phi(0)]$$