esl/escalus — pull request #16 by pzel (2014-04-15 10:08:42+00:00)
Title: make escalus_bosh stop on terminate msg, even w/keepalive

Before this commit, if an `escalus_bosh` connection in keepalive mode received a terminate reply from the server, it would send an empty keepalive response back to the server, instead of just stopping.

The server would have destroyed the session by this time, and would print a warning message:
``` erlang
{xmlel,<<"body">>,
[{<<"xmlns">>,<<"http://jabber.org/protocol/httpbind">>},
{<<"type">>,<<"terminate">>},
{<<"sid">>,<<" {{ SOME_SID }} ">>},
{<<"rid">>,<<" {{ SOME_RID }} ">>}],
[{xmlel,<<"presence">>,[{<<"type">>,<<"unavailable">>}],[]}]}
```

This commit fixes `escalus_bosh` to stop sending keepalives upon receiving a terminate response.