diff options
author | Sergey Kostanbaev <sergey.kostanbaev@gmail.com> | 2015-10-28 14:49:42 +0300 |
---|---|---|
committer | Ivan Kluchnikov <kluchnikovi@gmail.com> | 2017-02-07 18:59:54 +0300 |
commit | a8f56961beefa3442b97795d369837704a51d3c3 (patch) | |
tree | 2663ae3b02f39f4a335813195b1f0303321fbbfa /openbsc | |
parent | b2679b822ecf87dd17f4455e1383d037040402e5 (diff) |
ussd_proxy: handle reject from sup and send BYE to sip
Diffstat (limited to 'openbsc')
-rw-r--r-- | openbsc/src/reg-proxy/ussd_proxy.c | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/openbsc/src/reg-proxy/ussd_proxy.c b/openbsc/src/reg-proxy/ussd_proxy.c index 62df27eeb..e8fcab0e6 100644 --- a/openbsc/src/reg-proxy/ussd_proxy.c +++ b/openbsc/src/reg-proxy/ussd_proxy.c @@ -392,7 +392,7 @@ void proxy_r_invite(int status, } } -void proxy_r_bye(int status, +void proxy_i_bye(int status, char const *phrase, nua_t *nua, nua_magic_t *magic, @@ -445,6 +445,19 @@ void proxy_r_bye(int status, operation_destroy(hmagic); } +void proxy_r_bye(int status, + char const *phrase, + nua_t *nua, + nua_magic_t *magic, + nua_handle_t *nh, + nua_hmagic_t *hmagic, + sip_t const *sip, + tagi_t tags[]) +{ + fprintf(stderr, "*** Got reply %d for BUY\n", status); + operation_destroy(hmagic); +} + void proxy_i_error(int status, char const *phrase, nua_t *nua, @@ -692,7 +705,7 @@ void context_callback(nua_event_t event, break; case nua_i_bye: - proxy_r_bye(status, phrase, nua, magic, nh, hmagic, sip, tags); + proxy_i_bye(status, phrase, nua, magic, nh, hmagic, sip, tags); break; case nua_i_invite: @@ -703,6 +716,10 @@ void context_callback(nua_event_t event, proxy_r_invite(status, phrase, nua, magic, nh, hmagic, sip, tags); break; + case nua_r_bye: + proxy_r_bye(status, phrase, nua, magic, nh, hmagic, sip, tags); + break; + default: /* unknown event -> print out error message */ if (status > 100) { @@ -773,7 +790,14 @@ static int rx_sup_uss_message(isup_connection_t *sup_conn, const uint8_t* data, break; case GSM0480_MTYPE_RELEASE_COMPLETE: - // TODO handle this + op = operation_find_by_tid(ctx, ss.invoke_id); + if (op == NULL) { + LOGP(DLCTRL, LOGL_ERROR, "No active session with tid=%d were found for RELEASE_COMPLETE\n", + ss.invoke_id); + return; + } + + nua_bye(op->handle, TAG_END()); break; default: |