MNCC: Represent 'keypad' as one-character charstring, not int
The MNCC Unix Domain Socket encoding uses an int here, which is a bit odd, given that it's an ASCII / IA5 char value on the actual GSM L3. Let's convert from/to something useful. Change-Id: Id17ac502ca33f4962214a3d5938d0dc29ca6ec1b
This commit is contained in:
parent
8a3dc925da
commit
d13700dd6c
|
@ -155,8 +155,8 @@ OCTETSTRING enc__MNCC__PDU(const MNCC__PDU& in)
|
||||||
mncc.fields |= MNCC_F_SIGNAL;
|
mncc.fields |= MNCC_F_SIGNAL;
|
||||||
}
|
}
|
||||||
if (in_sig.keypad().is_value()) {
|
if (in_sig.keypad().is_value()) {
|
||||||
const INTEGER &kpd = in_sig.keypad();
|
const CHARSTRING &kpd = in_sig.keypad();
|
||||||
mncc.signal = kpd;
|
mncc.signal = (int) kpd[0].get_char();
|
||||||
mncc.fields |= MNCC_F_KEYPAD;
|
mncc.fields |= MNCC_F_KEYPAD;
|
||||||
}
|
}
|
||||||
mncc.more = in_sig.more();
|
mncc.more = in_sig.more();
|
||||||
|
@ -292,8 +292,10 @@ MNCC__PDU dec__MNCC__PDU(const OCTETSTRING& in)
|
||||||
sign.ssversion() = CHARSTRING(in_mncc->ssversion.info);
|
sign.ssversion() = CHARSTRING(in_mncc->ssversion.info);
|
||||||
if (in_mncc->fields & MNCC_F_CCCAP)
|
if (in_mncc->fields & MNCC_F_CCCAP)
|
||||||
sign.cccap() = MNCC__cccap(in_mncc->cccap.dtmf, in_mncc->cccap.pcp);
|
sign.cccap() = MNCC__cccap(in_mncc->cccap.dtmf, in_mncc->cccap.pcp);
|
||||||
if (in_mncc->fields & MNCC_F_KEYPAD)
|
if (in_mncc->fields & MNCC_F_KEYPAD) {
|
||||||
sign.keypad() = in_mncc->keypad;
|
char kpd[2] = { (char) in_mncc->keypad, 0 };
|
||||||
|
sign.keypad() = CHARSTRING(kpd);
|
||||||
|
}
|
||||||
if (in_mncc->fields & MNCC_F_SIGNAL)
|
if (in_mncc->fields & MNCC_F_SIGNAL)
|
||||||
sign.signal() = in_mncc->signal;
|
sign.signal() = in_mncc->signal;
|
||||||
|
|
||||||
|
|
|
@ -303,7 +303,7 @@ type record MNCC_cccap {
|
||||||
};
|
};
|
||||||
|
|
||||||
type int MNCC_notify (0..127);
|
type int MNCC_notify (0..127);
|
||||||
type int MNCC_keypad (0..127);
|
type charstring MNCC_keypad length (1);
|
||||||
|
|
||||||
type enumerated MNCC_bcap {
|
type enumerated MNCC_bcap {
|
||||||
GSM_MNCC_BCAP_SPEECH (0),
|
GSM_MNCC_BCAP_SPEECH (0),
|
||||||
|
|
Loading…
Reference in New Issue