ussd_proxy: handle reject from sup and send BYE to sip

This commit is contained in:
Sergey Kostanbaev 2015-10-28 14:49:42 +03:00 committed by Ivan Kluchnikov
parent b2679b822e
commit a8f56961be
1 changed files with 27 additions and 3 deletions

View File

@ -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: