diff --git a/rose.c b/rose.c index 22e8ef7..c453d07 100644 --- a/rose.c +++ b/rose.c @@ -761,6 +761,21 @@ static const struct rose_convert_error rose_etsi_errors[] = { /* ------------------------------------------------------------------- */ +/* + * Note the first value in oid.values[] is really the first two + * OID subidentifiers. They are compressed using this formula: + * First_Value = (First_Subidentifier * 40) + Second_Subidentifier + */ + +/*! \brief ECMA private-isdn-signalling-domain prefix. */ +static const struct asn1_oid rose_qsig_isdn_domain = { +/* *INDENT-OFF* */ + /* {iso(1) identified-organization(3) icd-ecma(12) private-isdn-signalling-domain(9)} */ + 3, { 43, 12, 9 } +/* *INDENT-ON* */ +}; + + /*! \brief Q.SIG specific invoke/result encode/decode message table */ static const struct rose_convert_msg rose_qsig_msgs[] = { /* *INDENT-OFF* */ @@ -770,7 +785,7 @@ static const struct rose_convert_msg rose_qsig_msgs[] = { * decode_invoke_args, decode_result_args */ /* - * localValue's from Q.SIG Name-Operations + * localValue's from Q.SIG Name-Operations 4th edition * { iso(1) standard(0) pss1-name(13868) name-operations(0) } */ { @@ -794,6 +809,34 @@ static const struct rose_convert_msg rose_qsig_msgs[] = { rose_dec_qsig_BusyName_ARG, NULL }, + /* + * globalValue's (OIDs) from Q.SIG Name-Operations 2nd edition + * { iso(1) identified-organization(3) icd-ecma(12) standard(0) qsig-name(164) name-operations(0) } + * + * This older version of the Q.SIG switch is not supported. + * However, we will accept receiving these messages anyway. + */ + { + ROSE_QSIG_CallingName, &rose_qsig_isdn_domain, 0, + rose_enc_qsig_CallingName_ARG, NULL, + rose_dec_qsig_CallingName_ARG, NULL + }, + { + ROSE_QSIG_CalledName, &rose_qsig_isdn_domain, 1, + rose_enc_qsig_CalledName_ARG, NULL, + rose_dec_qsig_CalledName_ARG, NULL + }, + { + ROSE_QSIG_ConnectedName, &rose_qsig_isdn_domain, 2, + rose_enc_qsig_ConnectedName_ARG, NULL, + rose_dec_qsig_ConnectedName_ARG, NULL + }, + { + ROSE_QSIG_BusyName, &rose_qsig_isdn_domain, 3, + rose_enc_qsig_BusyName_ARG, NULL, + rose_dec_qsig_BusyName_ARG, NULL + }, + /* * localValue's from Q.SIG SS-AOC-Operations * { iso(1) standard(0) pss1-advice-of-charge(15050) advice-of-charge-operations(0) } diff --git a/rosetest.c b/rosetest.c index 8723c53..cba4521 100644 --- a/rosetest.c +++ b/rosetest.c @@ -2837,6 +2837,42 @@ static unsigned char rose_qsig_name_alt_encode_msg[] = { /* *INDENT-ON* */ }; +static unsigned char rose_qsig_name_2nd_encode_msg[] = { +/* *INDENT-OFF* */ +/* + * Context Specific/C [10 0x0A] Len:6 <06> + * Context Specific [0 0x00] <80> Len:1 <01> + * <00> - "~" + * Context Specific [2 0x02] <82> Len:1 <01> + * <00> - "~" + * Context Specific [11 0x0B] <8B> Len:1 <01> + * <00> - "~" + * Context Specific/C [1 0x01] Len:26 <1A> + * Integer(2 0x02) <02> Len:1 <01> + * <40> - "@" + * OID(6 0x06) <06> Len:4 <04> + * <2B 0C 09 00> - "+~~~" + * Context Specific [0 0x00] <80> Len:15 <0F> + * <4D 6F 64 65 6D 20 44 69-73 63 6F 42 61 6C 6C> - "Modem DiscoBall" + */ + 0x91, + 0xaa, 0x06, + 0x80, 0x01, + 0x00, + 0x82, 0x01, + 0x00, + 0x8b, 0x01, + 0x00, + 0xa1, 0x1a, + 0x02, 0x01, + 0x40, + 0x06, 0x04, + 0x2b, 0x0c, 0x09, 0x00, + 0x80, 0x0f, + 0x4d, 0x6f, 0x64, 0x65, 0x6d, 0x20, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x42, 0x61, 0x6c, 0x6c +/* *INDENT-ON* */ +}; + static const struct rose_message rose_dms100_msgs[] = { /* *INDENT-OFF* */ @@ -3132,6 +3168,9 @@ int main(int argc, char *argv[]) rose_test_exception(&dummy_ctrl, "Alternate name encoded messages", rose_qsig_name_alt_encode_msg, sizeof(rose_qsig_name_alt_encode_msg)); + rose_test_exception(&dummy_ctrl, "2nd edition name encoded messages", + rose_qsig_name_2nd_encode_msg, sizeof(rose_qsig_name_2nd_encode_msg)); + /* ------------------------------------------------------------------- */ pri_message(&dummy_ctrl, "\n\n"