gsm_04_80: Send a Release Complete otherwise the USSD unit stays BUSY

We need to release the USSD unit, otherwise it is staying blocked
and will stop to function (even across LUs on my a1200). This code
should encode the transaction and the direction depending on the
network state but this is omitted right now.
This commit is contained in:
Holger Hans Peter Freyther 2010-07-27 03:31:50 +08:00
parent e6373b7f63
commit 68d26796ca
3 changed files with 18 additions and 0 deletions

View File

@ -30,5 +30,6 @@ int gsm0480_wrap_invoke(struct msgb *msg, int op, int link_id);
int gsm0480_wrap_facility(struct msgb *msg);
int gsm0480_send_ussdNotify(struct gsm_subscriber_connection *conn, const char *text);
int gsm0480_send_releaseComplete(struct gsm_subscriber_connection *conn);
#endif

View File

@ -469,3 +469,19 @@ int gsm0480_send_ussdNotify(struct gsm_subscriber_connection *conn, const char *
return gsm0808_submit_dtap(conn, msg, 0);
}
int gsm0480_send_releaseComplete(struct gsm_subscriber_connection *conn)
{
struct gsm48_hdr *gh;
struct msgb *msg;
msg = gsm48_msgb_alloc();
if (!msg)
return -1;
gh = (struct gsm48_hdr *) msgb_push(msg, sizeof(*gh));
gh->proto_discr = GSM48_PDISC_NC_SS;
gh->msg_type = GSM0480_MTYPE_RELEASE_COMPLETE;
return gsm0808_submit_dtap(conn, msg, 0);
}

View File

@ -408,6 +408,7 @@ DEFUN(subscriber_ussd_notify,
}
gsm0480_send_ussdNotify(conn, text);
gsm0480_send_releaseComplete(conn);
subscr_put(subscr);
talloc_free(text);