Let $X_1, \ldots, X_n, \ldots,$ be a sequence of i.i.d. random variables each with probability mass function \begin{equation} p_X(k) = \begin{cases} 1/6, \quad k = -1,\\ 2/3, \quad k = 0,\\ 1/6, \quad k = 1, \end{cases} \end{equation} and let $N$ be the smallest $n$ such that $X_n = 0$. I wish to determine the characteristic function of $S_N = \sum_{i=1}^N X_i$.
Attempt:
The characteristic function of $S_N$ is
$\varphi_{S_N}(t) = \mathbb{E}[e^{itS_N}] = \mathbb{E}[\mathbb{E}[e^{itS_N}|N]] = \mathbb{E}[h(N)] = \sum_{n=1}^\infty h(n) p_N(n)$,
and $p_N(n) = \frac{2}{3} \left(\frac{1}{3}\right)^{n-1}$ since $\{N = n\} \Leftrightarrow \{X_0 \neq 0, \ldots, X_{n-1} \neq 0, X_n = 0\}$. Furthermore,
$h(n) = \mathbb{E}[e^{itS_N}|N=n] = \mathbb{E}[e^{itS_n}|N=n] = \sum_{x_1 \neq 0}\cdots\sum_{x_{n-1} \neq 0} e^{it \sum_{j=1}^{n-1} X_j} p_{X_1, \ldots, X_n | N=n}(x_1, \ldots, x_{n-1}, 0)$.
We define $X_1$ s.t. $$P(X_1=k)=\begin{cases} p&k=1\\ 1-2p&k=0\\ p&k=-1 \end{cases},\,p\in [0,1/2)$$ We define $N=\inf\{n:X_n=0\}$; so $P(N>k)=(2p)^k$ which implies $P(N=k)=(2p)^{k-1}(1-2p)$. Now if $N=n$ the $X_1,...,X_n$ are conditionally independent; also for $k<n$ $$P(X_k=1|N=n)=P(X_k=-1|N=n)=1/2 $$ and for $k=n$, $P(X_k=0|N=n)=1$. So $$E[e^{i\xi(X_1+...+X_N)}]=\sum_{n\geq 1}\cos(\xi)^{n-1}(2p)^{n-1}(1-2p)=\frac{1-2p}{1-2p\cos(\xi)}$$