-
Notifications
You must be signed in to change notification settings - Fork 14
/
rose.h
4432 lines (3901 loc) · 120 KB
/
rose.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* libpri: An implementation of Primary Rate ISDN
*
* Copyright (C) 2009 Digium, Inc.
*
* Richard Mudgett <[email protected]>
*
* See http://www.asterisk.org for more information about
* the Asterisk project. Please do not directly contact
* any of the maintainers of this project for assistance;
* the project provides a web site, mailing lists and IRC
* channels for your use.
*
* This program is free software, distributed under the terms of
* the GNU General Public License Version 2 as published by the
* Free Software Foundation. See the LICENSE file included with
* this program for more details.
*
* In addition, when this program is distributed with Asterisk in
* any form that would qualify as a 'combined work' or as a
* 'derivative work' (but not mere aggregation), you can redistribute
* and/or modify the combination under the terms of the license
* provided with that copy of Asterisk, instead of the license
* terms granted here.
*/
/*!
* \file
* \brief ROSE definitions and prototypes
*
* \details
* This file contains all of the data structures and definitions needed
* for ROSE component encoding and decoding.
*
* ROSE - Remote Operations Service Element
* ASN.1 - Abstract Syntax Notation 1
* APDU - Application Protocol Data Unit
*
* \author Richard Mudgett <[email protected]>
*/
#ifndef _LIBPRI_ROSE_H
#define _LIBPRI_ROSE_H
#include <string.h>
#include <sys/types.h>
#ifdef __cplusplus
extern "C" {
#endif
/* ------------------------------------------------------------------- */
/* Northern Telecom DMS-100 RLT related operations */
#define ROSE_DMS100_RLT_SERVICE_ID 0x3e
#define ROSE_DMS100_RLT_OPERATION_IND 0x01
#define ROSE_DMS100_RLT_THIRD_PARTY 0x02
/*! \brief ROSE operation-value function code */
enum rose_operation {
/*! \brief No ROSE operation */
ROSE_None,
/*! \brief Unknown OID/localValue operation-value code */
ROSE_Unknown,
/* *INDENT-OFF* */
/* ETSI Diversion-Operations */
ROSE_ETSI_ActivationDiversion, /*!< Invoke/Result */
ROSE_ETSI_DeactivationDiversion, /*!< Invoke/Result */
ROSE_ETSI_ActivationStatusNotificationDiv,/*!< Invoke only */
ROSE_ETSI_DeactivationStatusNotificationDiv,/*!< Invoke only */
ROSE_ETSI_InterrogationDiversion, /*!< Invoke/Result */
ROSE_ETSI_DiversionInformation, /*!< Invoke only */
ROSE_ETSI_CallDeflection, /*!< Invoke/Result */
ROSE_ETSI_CallRerouting, /*!< Invoke/Result */
ROSE_ETSI_InterrogateServedUserNumbers, /*!< Invoke/Result */
ROSE_ETSI_DivertingLegInformation1, /*!< Invoke only */
ROSE_ETSI_DivertingLegInformation2, /*!< Invoke only */
ROSE_ETSI_DivertingLegInformation3, /*!< Invoke only */
/*
* ETSI Advice-of-Charge-Operations
*
* Advice-Of-Charge-at-call-Setup(AOCS)
* Advice-Of-Charge-During-the-call(AOCD)
* Advice-Of-Charge-at-the-End-of-the-call(AOCE)
*/
ROSE_ETSI_ChargingRequest, /*!< Invoke/Result */
ROSE_ETSI_AOCSCurrency, /*!< Invoke only */
ROSE_ETSI_AOCSSpecialArr, /*!< Invoke only */
ROSE_ETSI_AOCDCurrency, /*!< Invoke only */
ROSE_ETSI_AOCDChargingUnit, /*!< Invoke only */
ROSE_ETSI_AOCECurrency, /*!< Invoke only */
ROSE_ETSI_AOCEChargingUnit, /*!< Invoke only */
/* ETSI Explicit-Call-Transfer-Operations-and-Errors */
ROSE_ETSI_EctExecute, /*!< Invoke/Result */
ROSE_ETSI_ExplicitEctExecute, /*!< Invoke/Result */
ROSE_ETSI_RequestSubaddress, /*!< Invoke only */
ROSE_ETSI_SubaddressTransfer, /*!< Invoke only */
ROSE_ETSI_EctLinkIdRequest, /*!< Invoke/Result */
ROSE_ETSI_EctInform, /*!< Invoke only */
ROSE_ETSI_EctLoopTest, /*!< Invoke/Result */
/* ETSI Status-Request-Procedure */
ROSE_ETSI_StatusRequest, /*!< Invoke/Result */
/* ETSI CCBS-Operations-and-Errors */
ROSE_ETSI_CallInfoRetain, /*!< Invoke only */
ROSE_ETSI_CCBSRequest, /*!< Invoke/Result */
ROSE_ETSI_CCBSDeactivate, /*!< Invoke/Result */
ROSE_ETSI_CCBSInterrogate, /*!< Invoke/Result */
ROSE_ETSI_CCBSErase, /*!< Invoke only */
ROSE_ETSI_CCBSRemoteUserFree, /*!< Invoke only */
ROSE_ETSI_CCBSCall, /*!< Invoke only */
ROSE_ETSI_CCBSStatusRequest, /*!< Invoke/Result */
ROSE_ETSI_CCBSBFree, /*!< Invoke only */
ROSE_ETSI_EraseCallLinkageID, /*!< Invoke only */
ROSE_ETSI_CCBSStopAlerting, /*!< Invoke only */
/* ETSI CCBS-private-networks-Operations-and-Errors */
ROSE_ETSI_CCBS_T_Request, /*!< Invoke/Result */
ROSE_ETSI_CCBS_T_Call, /*!< Invoke only */
ROSE_ETSI_CCBS_T_Suspend, /*!< Invoke only */
ROSE_ETSI_CCBS_T_Resume, /*!< Invoke only */
ROSE_ETSI_CCBS_T_RemoteUserFree, /*!< Invoke only */
ROSE_ETSI_CCBS_T_Available, /*!< Invoke only */
/* ETSI CCNR-Operations-and-Errors */
ROSE_ETSI_CCNRRequest, /*!< Invoke/Result */
ROSE_ETSI_CCNRInterrogate, /*!< Invoke/Result */
/* ETSI CCNR-private-networks-Operations-and-Errors */
ROSE_ETSI_CCNR_T_Request, /*!< Invoke/Result */
/* ETSI MCID-Operations */
ROSE_ETSI_MCIDRequest, /*!< Invoke/Result */
/* ETSI MWI-Operations-and-Errors */
ROSE_ETSI_MWIActivate, /*!< Invoke/Result */
ROSE_ETSI_MWIDeactivate, /*!< Invoke/Result */
ROSE_ETSI_MWIIndicate, /*!< Invoke only */
/* Q.SIG Name-Operations */
ROSE_QSIG_CallingName, /*!< Invoke only */
ROSE_QSIG_CalledName, /*!< Invoke only */
ROSE_QSIG_ConnectedName, /*!< Invoke only */
ROSE_QSIG_BusyName, /*!< Invoke only */
/* Q.SIG SS-AOC-Operations */
ROSE_QSIG_ChargeRequest, /*!< Invoke/Result */
ROSE_QSIG_GetFinalCharge, /*!< Invoke only */
ROSE_QSIG_AocFinal, /*!< Invoke only */
ROSE_QSIG_AocInterim, /*!< Invoke only */
ROSE_QSIG_AocRate, /*!< Invoke only */
ROSE_QSIG_AocComplete, /*!< Invoke/Result */
ROSE_QSIG_AocDivChargeReq, /*!< Invoke only */
/* Q.SIG Call-Transfer-Operations (CT) */
ROSE_QSIG_CallTransferIdentify, /*!< Invoke/Result */
ROSE_QSIG_CallTransferAbandon, /*!< Invoke only */
ROSE_QSIG_CallTransferInitiate, /*!< Invoke/Result */
ROSE_QSIG_CallTransferSetup, /*!< Invoke/Result */
ROSE_QSIG_CallTransferActive, /*!< Invoke only */
ROSE_QSIG_CallTransferComplete, /*!< Invoke only */
ROSE_QSIG_CallTransferUpdate, /*!< Invoke only */
ROSE_QSIG_SubaddressTransfer, /*!< Invoke only */
ROSE_QSIG_PathReplacement, /*!< Invoke only */
/* Q.SIG Call-Diversion-Operations */
ROSE_QSIG_ActivateDiversionQ, /*!< Invoke/Result */
ROSE_QSIG_DeactivateDiversionQ, /*!< Invoke/Result */
ROSE_QSIG_InterrogateDiversionQ, /*!< Invoke/Result */
ROSE_QSIG_CheckRestriction, /*!< Invoke/Result */
ROSE_QSIG_CallRerouting, /*!< Invoke/Result */
ROSE_QSIG_DivertingLegInformation1, /*!< Invoke only */
ROSE_QSIG_DivertingLegInformation2, /*!< Invoke only */
ROSE_QSIG_DivertingLegInformation3, /*!< Invoke only */
ROSE_QSIG_CfnrDivertedLegFailed, /*!< Invoke only */
/* Q.SIG SS-CC-Operations */
ROSE_QSIG_CcbsRequest, /*!< Invoke/Result */
ROSE_QSIG_CcnrRequest, /*!< Invoke/Result */
ROSE_QSIG_CcCancel, /*!< Invoke only */
ROSE_QSIG_CcExecPossible, /*!< Invoke only */
ROSE_QSIG_CcPathReserve, /*!< Invoke/Result */
ROSE_QSIG_CcRingout, /*!< Invoke only */
ROSE_QSIG_CcSuspend, /*!< Invoke only */
ROSE_QSIG_CcResume, /*!< Invoke only */
/* Q.SIG SS-MWI-Operations */
ROSE_QSIG_MWIActivate, /*!< Invoke/Result */
ROSE_QSIG_MWIDeactivate, /*!< Invoke/Result */
ROSE_QSIG_MWIInterrogate, /*!< Invoke/Result */
/* Northern Telecom DMS-100 RLT related operations */
/*! Invoke/Result: Must set invokeId to ROSE_DMS100_RLT_OPERATION_IND */
ROSE_DMS100_RLT_OperationInd,
/*! Invoke/Result: Must set invokeId to ROSE_DMS100_RLT_THIRD_PARTY */
ROSE_DMS100_RLT_ThirdParty,
ROSE_NI2_InformationFollowing, /*!< Invoke only? */
ROSE_NI2_InitiateTransfer, /*!< Invoke only? Is this correct operation name? */
ROSE_Num_Operation_Codes /*!< Must be last in the enumeration */
/* *INDENT-ON* */
};
enum rose_error_code {
/*! \brief No error occurred */
ROSE_ERROR_None,
/*! \brief Unknown OID/localValue error-value code */
ROSE_ERROR_Unknown,
/* General-Errors (ETS 300 196) and General-Error-List(Q.950) */
ROSE_ERROR_Gen_NotSubscribed, /*!< also: UserNotSubscribed */
ROSE_ERROR_Gen_NotAvailable,
ROSE_ERROR_Gen_NotImplemented, /*!< Not in Q.950 */
ROSE_ERROR_Gen_InvalidServedUserNr,
ROSE_ERROR_Gen_InvalidCallState,
ROSE_ERROR_Gen_BasicServiceNotProvided,
ROSE_ERROR_Gen_NotIncomingCall,
ROSE_ERROR_Gen_SupplementaryServiceInteractionNotAllowed,
ROSE_ERROR_Gen_ResourceUnavailable,
/* Additional General-Error-List(Q.950) */
ROSE_ERROR_Gen_RejectedByNetwork,
ROSE_ERROR_Gen_RejectedByUser,
ROSE_ERROR_Gen_InsufficientInformation,
ROSE_ERROR_Gen_CallFailure,
ROSE_ERROR_Gen_ProceduralError,
/* ETSI Diversion-Operations */
ROSE_ERROR_Div_InvalidDivertedToNr,
ROSE_ERROR_Div_SpecialServiceNr,
ROSE_ERROR_Div_DiversionToServedUserNr,
ROSE_ERROR_Div_IncomingCallAccepted,
ROSE_ERROR_Div_NumberOfDiversionsExceeded,
ROSE_ERROR_Div_NotActivated,
ROSE_ERROR_Div_RequestAlreadyAccepted,
/* ETSI Advice-of-Charge-Operations */
ROSE_ERROR_AOC_NoChargingInfoAvailable,
/* ETSI Explicit-Call-Transfer-Operations-and-Errors */
ROSE_ERROR_ECT_LinkIdNotAssignedByNetwork,
/* ETSI CCBS-Operations-and-Errors */
ROSE_ERROR_CCBS_InvalidCallLinkageID,
ROSE_ERROR_CCBS_InvalidCCBSReference,
ROSE_ERROR_CCBS_LongTermDenial,
ROSE_ERROR_CCBS_ShortTermDenial,
ROSE_ERROR_CCBS_IsAlreadyActivated,
ROSE_ERROR_CCBS_AlreadyAccepted,
ROSE_ERROR_CCBS_OutgoingCCBSQueueFull,
ROSE_ERROR_CCBS_CallFailureReasonNotBusy,
ROSE_ERROR_CCBS_NotReadyForCall,
/* ETSI CCBS-private-networks-Operations-and-Errors */
ROSE_ERROR_CCBS_T_LongTermDenial,
ROSE_ERROR_CCBS_T_ShortTermDenial,
/* ETSI MWI-Operations-and-Errors */
ROSE_ERROR_MWI_InvalidReceivingUserNr,
ROSE_ERROR_MWI_ReceivingUserNotSubscribed,
ROSE_ERROR_MWI_ControllingUserNotRegistered,
ROSE_ERROR_MWI_IndicationNotDelivered,
ROSE_ERROR_MWI_MaxNumOfControllingUsersReached,
ROSE_ERROR_MWI_MaxNumOfActiveInstancesReached,
/* Q.SIG from various specifications */
ROSE_ERROR_QSIG_Unspecified,
/* Q.SIG SS-AOC-Operations */
ROSE_ERROR_QSIG_AOC_FreeOfCharge,
/* Q.SIG Call-Transfer-Operations (CT) */
ROSE_ERROR_QSIG_CT_InvalidReroutingNumber,
ROSE_ERROR_QSIG_CT_UnrecognizedCallIdentity,
ROSE_ERROR_QSIG_CT_EstablishmentFailure,
/* Q.SIG Call-Diversion-Operations (Additional Q.SIG specific errors) */
ROSE_ERROR_QSIG_Div_TemporarilyUnavailable,
ROSE_ERROR_QSIG_Div_NotAuthorized,
/* Q.SIG SS-CC-Operations */
ROSE_ERROR_QSIG_ShortTermRejection,
ROSE_ERROR_QSIG_LongTermRejection,
ROSE_ERROR_QSIG_RemoteUserBusyAgain,
ROSE_ERROR_QSIG_FailureToMatch,
ROSE_ERROR_QSIG_FailedDueToInterworking,
/* Q.SIG SS-MWI-Operations */
ROSE_ERROR_QSIG_InvalidMsgCentreId,
/* Northern Telecom DMS-100 RLT related operations */
ROSE_ERROR_DMS100_RLT_BridgeFail,
ROSE_ERROR_DMS100_RLT_CallIDNotFound,
ROSE_ERROR_DMS100_RLT_NotAllowed,
ROSE_ERROR_DMS100_RLT_SwitchEquipCongs,
ROSE_ERROR_Num_Codes /*!< Must be last in the enumeration */
};
#define ROSE_REJECT_BASE(base) ((base) * 0x100)
enum rose_reject_base {
ROSE_REJECT_BASE_General,
ROSE_REJECT_BASE_Invoke,
ROSE_REJECT_BASE_Result,
ROSE_REJECT_BASE_Error,
/*! \brief Must be last in the list */
ROSE_REJECT_BASE_Last
};
/*!
* \brief From Facility-Information-Element-Components
* {itu-t identified-organization etsi(0) 196 facility-information-element-component(3)}
*/
enum rose_reject_code {
/*! \brief Not rejected */
ROSE_REJECT_None = -1,
/*! \brief Unknown reject code */
ROSE_REJECT_Unknown = -2,
/* *INDENT-OFF* */
ROSE_REJECT_Gen_UnrecognizedComponent = ROSE_REJECT_BASE(ROSE_REJECT_BASE_General) + 0,
ROSE_REJECT_Gen_MistypedComponent = ROSE_REJECT_BASE(ROSE_REJECT_BASE_General) + 1,
ROSE_REJECT_Gen_BadlyStructuredComponent = ROSE_REJECT_BASE(ROSE_REJECT_BASE_General) + 2,
ROSE_REJECT_Inv_DuplicateInvocation = ROSE_REJECT_BASE(ROSE_REJECT_BASE_Invoke) + 0,
ROSE_REJECT_Inv_UnrecognizedOperation = ROSE_REJECT_BASE(ROSE_REJECT_BASE_Invoke) + 1,
ROSE_REJECT_Inv_MistypedArgument = ROSE_REJECT_BASE(ROSE_REJECT_BASE_Invoke) + 2,
ROSE_REJECT_Inv_ResourceLimitation = ROSE_REJECT_BASE(ROSE_REJECT_BASE_Invoke) + 3,
ROSE_REJECT_Inv_InitiatorReleasing = ROSE_REJECT_BASE(ROSE_REJECT_BASE_Invoke) + 4,
ROSE_REJECT_Inv_UnrecognizedLinkedID = ROSE_REJECT_BASE(ROSE_REJECT_BASE_Invoke) + 5,
ROSE_REJECT_Inv_LinkedResponseUnexpected = ROSE_REJECT_BASE(ROSE_REJECT_BASE_Invoke) + 6,
ROSE_REJECT_Inv_UnexpectedChildOperation = ROSE_REJECT_BASE(ROSE_REJECT_BASE_Invoke) + 7,
ROSE_REJECT_Res_UnrecognizedInvocation = ROSE_REJECT_BASE(ROSE_REJECT_BASE_Result) + 0,
ROSE_REJECT_Res_ResultResponseUnexpected = ROSE_REJECT_BASE(ROSE_REJECT_BASE_Result) + 1,
ROSE_REJECT_Res_MistypedResult = ROSE_REJECT_BASE(ROSE_REJECT_BASE_Result) + 2,
ROSE_REJECT_Err_UnrecognizedInvocation = ROSE_REJECT_BASE(ROSE_REJECT_BASE_Error) + 0,
ROSE_REJECT_Err_ErrorResponseUnexpected = ROSE_REJECT_BASE(ROSE_REJECT_BASE_Error) + 1,
ROSE_REJECT_Err_UnrecognizedError = ROSE_REJECT_BASE(ROSE_REJECT_BASE_Error) + 2,
ROSE_REJECT_Err_UnexpectedError = ROSE_REJECT_BASE(ROSE_REJECT_BASE_Error) + 3,
ROSE_REJECT_Err_MistypedParameter = ROSE_REJECT_BASE(ROSE_REJECT_BASE_Error) + 4,
/* *INDENT-ON* */
};
/* ------------------------------------------------------------------- */
/*
* Q931InformationElement ::= [APPLICATION 0] IMPLICIT OCTET STRING
*/
struct roseQ931ie {
/*!
* \brief The Q.931 ie is present if length is nonzero.
* (If this field is optional in the message.)
*/
u_int8_t length;
/*!
* \brief We mostly just need to store the contents so we will defer
* decoding/encoding.
*
* \note To reduce the size of the structure, the memory for the
* ie contents is "allocated" after the structure.
* \note Remember the "allocated" memory needs to have room for a
* null terminator.
*/
unsigned char contents[0];
};
enum {
/*! Bearer Capability has a max length of 12. */
ROSE_Q931_MAX_BC = 12,
/*! High Layer Compatibility has a max length of 5. */
ROSE_Q931_MAX_HLC = 5,
/*! Low Layer Compatibility has a max length of 18. */
ROSE_Q931_MAX_LLC = 18,
/*!
* User-User Information has a network dependent maximum.
* The network dependent maximum is either 35 or 131 octets
* in non-USER-INFORMATION messages.
*/
ROSE_Q931_MAX_USER = 131,
/*!
* Progress Indicator has a max length of 4.
* There can be multiple progress indicator ies.
* Q.SIG allows up to 3.
* ITU-T allows up to 2.
*/
ROSE_Q931_MAX_PROGRESS = 3 * 4,
};
/* ------------------------------------------------------------------- */
/*
* Comment obtained from ECMA-242 ASN.1 source.
* a VisibleString containing:
* - the (local) date in 8 digits (YYYYMMDD),
* - followed by (local) time of day in 4 or 6 digits (HHMM[SS]),
* - optionally followed by the letter "Z" or
* by a local time differential in 5 digits ("+"HHMM or "-"HHMM);
* this date and time representation follows ISO 8601
* Examples:
* 1) 19970621194530, meaning 21 June 1997, 19:45:30;
* 2) 19970621194530Z, meaning the same as 1);
* 3) 19970621194530-0500, meaning the same as 1),
* 5 hours retarded in relation to UTC time
*
* GeneralizedTime ::= [UNIVERSAL 24] IMPLICIT VisibleString
*/
struct roseGeneralizedTime {
/*! GeneralizedTime (SIZE (12..19)) */
unsigned char str[19 + 1];
};
/* ------------------------------------------------------------------- */
/*
* PartyNumber ::= CHOICE {
* -- the numbering plan is the default numbering plan of
* -- the network. It is recommended that this value is
* -- used.
* unknownPartyNumber [0] IMPLICIT NumberDigits,
*
* -- the numbering plan is according to
* -- ITU-T Recommendation E.164.
* publicPartyNumber [1] IMPLICIT PublicPartyNumber,
*
* -- ATM endsystem address encoded as an NSAP address.
* nsapEncodedNumber [2] IMPLICIT NsapEncodedNumber,
*
* -- not used, value reserved.
* dataPartyNumber [3] IMPLICIT NumberDigits,
*
* -- not used, value reserved.
* telexPartyNumber [4] IMPLICIT NumberDigits,
* privatePartyNumber [5] IMPLICIT PrivatePartyNumber,
*
* -- not used, value reserved.
* nationalStandardPartyNumber [8] IMPLICIT NumberDigits
* }
*/
struct rosePartyNumber {
/*!
* \brief Party numbering plan
* \details
* unknown(0),
* public(1) - The numbering plan is according to ITU-T E.164,
* nsapEncoded(2),
* data(3) - Reserved,
* telex(4) - Reserved,
* private(5),
* nationalStandard(8) - Reserved
*/
u_int8_t plan;
/*!
* \brief Type-Of-Number valid for public and private party number plans
* \details
* public:
* unknown(0),
* internationalNumber(1),
* nationalNumber(2),
* networkSpecificNumber(3) - Reserved,
* subscriberNumber(4) - Reserved,
* abbreviatedNumber(6)
* \details
* private:
* unknown(0),
* level2RegionalNumber(1),
* level1RegionalNumber(2),
* pTNSpecificNumber/pISNSpecificNumber(3),
* localNumber(4),
* abbreviatedNumber(6)
*/
u_int8_t ton;
/*! \brief Number present if length is nonzero. */
u_int8_t length;
/*! \brief Number string data. */
unsigned char str[20 + 1];
};
/*
* NumberScreened ::= SEQUENCE {
* partyNumber PartyNumber,
* screeningIndicator ScreeningIndicator
* }
*/
struct roseNumberScreened {
struct rosePartyNumber number;
/*!
* \details
* userProvidedNotScreened(0),
* userProvidedVerifiedAndPassed(1),
* userProvidedVerifiedAndFailed(2) (Not used, value reserved),
* networkProvided(3)
*/
u_int8_t screening_indicator;
};
/*
* PartySubaddress ::= CHOICE {
* -- not recommended
* UserSpecifiedSubaddress,
*
* -- according to ITU-T Recommendation X.213
* NSAPSubaddress
* }
*
* UserSpecifiedSubaddress ::= SEQUENCE {
* SubaddressInformation,
*
* -- used when the coding of subaddress is BCD
* oddCountIndicator BOOLEAN OPTIONAL
* }
*
* -- specified according to ITU-T Recommendation X.213. Some
* -- networks may limit the subaddress value to some other
* -- length, e.g. 4 octets
* NSAPSubaddress ::= OCTET STRING (SIZE(1..20))
*
* -- coded according to user requirements. Some networks may
* -- limit the subaddress value to some other length,
* -- e.g. 4 octets
* SubaddressInformation ::= OCTET STRING (SIZE(1..20))
*/
struct rosePartySubaddress {
/*! \brief Subaddress type UserSpecified(0), NSAP(1) */
u_int8_t type;
/*! \brief Subaddress present if length is nonzero */
u_int8_t length;
union {
/*! \brief Specified according to ITU-T Recommendation X.213 */
unsigned char nsap[20 + 1];
/*! \brief Use of this formatting is not recommended */
struct {
/*! \brief TRUE if OddCount present */
u_int8_t odd_count_present;
/*!
* \brief TRUE if odd number of BCD digits (optional)
* \note Used when the coding of subaddress is BCD.
*/
u_int8_t odd_count;
unsigned char information[20 + 1];
} user_specified;
} u;
};
/*
* Address ::= SEQUENCE {
* PartyNumber,
* PartySubaddress OPTIONAL
* }
*/
struct roseAddress {
struct rosePartyNumber number;
/*! \brief Subaddress (Optional) */
struct rosePartySubaddress subaddress;
};
/*
* AddressScreened ::= SEQUENCE {
* PartyNumber,
* ScreeningIndicator,
* PartySubaddress OPTIONAL
* }
*/
struct roseAddressScreened {
struct rosePartyNumber number;
/*! \brief Subaddress (Optional) */
struct rosePartySubaddress subaddress;
/*!
* \details
* userProvidedNotScreened(0),
* userProvidedVerifiedAndPassed(1),
* userProvidedVerifiedAndFailed(2) (Not used, value reserved),
* networkProvided(3)
*/
u_int8_t screening_indicator;
};
/*
* PresentedNumberUnscreened ::= CHOICE {
* presentationAllowedNumber [0] EXPLICIT PartyNumber,
* presentationRestricted [1] IMPLICIT NULL,
* numberNotAvailableDueToInterworking [2] IMPLICIT NULL,
* presentationRestrictedNumber [3] EXPLICIT PartyNumber
* }
*/
struct rosePresentedNumberUnscreened {
struct rosePartyNumber number;
/*!
* \brief Number presentation type
* \details
* presentationAllowedNumber(0),
* presentationRestricted(1),
* numberNotAvailableDueToInterworking(2),
* presentationRestrictedNumber(3)
*/
u_int8_t presentation;
};
/*
* PresentedNumberScreened ::= CHOICE {
* presentationAllowedNumber [0] IMPLICIT NumberScreened,
* presentationRestricted [1] IMPLICIT NULL,
* numberNotAvailableDueToInterworking [2] IMPLICIT NULL,
* presentationRestrictedNumber [3] IMPLICIT NumberScreened
* }
*/
struct rosePresentedNumberScreened {
/*! \brief Screened number */
struct roseNumberScreened screened;
/*!
* \brief Number presentation type
* \details
* presentationAllowedNumber(0),
* presentationRestricted(1),
* numberNotAvailableDueToInterworking(2),
* presentationRestrictedNumber(3)
*/
u_int8_t presentation;
};
/*
* PresentedAddressScreened ::= CHOICE {
* presentationAllowedAddress [0] IMPLICIT AddressScreened,
* presentationRestricted [1] IMPLICIT NULL,
* numberNotAvailableDueToInterworking [2] IMPLICIT NULL,
* presentationRestrictedAddress [3] IMPLICIT AddressScreened
* }
*/
struct rosePresentedAddressScreened {
/*! \breif Screened address */
struct roseAddressScreened screened;
/*!
* \brief Address presentation type
* \details
* presentationAllowedAddress(0),
* presentationRestricted(1),
* numberNotAvailableDueToInterworking(2),
* presentationRestrictedAddress(3)
*/
u_int8_t presentation;
};
/* ------------------------------------------------------------------- */
/*
* Time ::= SEQUENCE {
* lengthOfTimeUnit [1] IMPLICIT LengthOfTimeUnit,
* scale [2] IMPLICIT Scale
* }
*/
struct roseEtsiAOCTime {
/*! LengthOfTimeUnit ::= INTEGER (0..16777215) -- 24 bit number */
u_int32_t length;
/*!
* \details
* oneHundredthSecond(0),
* oneTenthSecond(1),
* oneSecond(2),
* tenSeconds(3),
* oneMinute(4),
* oneHour(5),
* twentyFourHours(6)
*/
u_int8_t scale;
};
/*
* Amount ::= SEQUENCE {
* currencyAmount [1] IMPLICIT CurrencyAmount,
* multiplier [2] IMPLICIT Multiplier
* }
*/
struct roseEtsiAOCAmount {
/*! CurrencyAmount ::= INTEGER (0..16777215) -- 24 bit number */
u_int32_t currency;
/*!
* \details
* oneThousandth(0),
* oneHundredth(1),
* oneTenth(2),
* one(3),
* ten(4),
* hundred(5),
* thousand(6)
*/
u_int8_t multiplier;
};
/*
* DurationCurrency ::= SEQUENCE {
* dCurrency [1] IMPLICIT Currency,
* dAmount [2] IMPLICIT Amount,
* dChargingType [3] IMPLICIT ChargingType,
* dTime [4] IMPLICIT Time,
* dGranularity [5] IMPLICIT Time OPTIONAL
* }
*/
struct roseEtsiAOCDurationCurrency {
struct roseEtsiAOCAmount amount;
struct roseEtsiAOCTime time;
/*! \breif dGranularity (optional) */
struct roseEtsiAOCTime granularity;
/*! Currency ::= IA5String (SIZE (1..10)) -- Name of currency. */
unsigned char currency[10 + 1];
/*!
* \details
* continuousCharging(0),
* stepFunction(1)
*/
u_int8_t charging_type;
/*! TRUE if granularity time is present */
u_int8_t granularity_present;
};
/*
* FlatRateCurrency ::= SEQUENCE {
* fRCurrency [1] IMPLICIT Currency,
* fRAmount [2] IMPLICIT Amount
* }
*/
struct roseEtsiAOCFlatRateCurrency {
struct roseEtsiAOCAmount amount;
/*! Currency ::= IA5String (SIZE (1..10)) -- Name of currency. */
unsigned char currency[10 + 1];
};
/*
* VolumeRateCurrency ::= SEQUENCE {
* vRCurrency [1] IMPLICIT Currency,
* vRAmount [2] IMPLICIT Amount,
* vRVolumeUnit [3] IMPLICIT VolumeUnit
* }
*/
struct roseEtsiAOCVolumeRateCurrency {
struct roseEtsiAOCAmount amount;
/*! Currency ::= IA5String (SIZE (1..10)) -- Name of currency. */
unsigned char currency[10 + 1];
/*!
* \brief Volume rate volume unit
* \details
* octet(0),
* segment(1),
* message(2)
*/
u_int8_t unit;
};
/*
* AOCSCurrencyInfo ::= SEQUENCE {
* chargedItem ChargedItem,
* CHOICE {
* specialChargingCode SpecialChargingCode,
* durationCurrency [1] IMPLICIT DurationCurrency,
* flatRateCurrency [2] IMPLICIT FlatRateCurrency,
* volumeRateCurrency [3] IMPLICIT VolumeRateCurrency
* freeOfCharge [4] IMPLICIT NULL,
* currencyInfoNotAvailable [5] IMPLICIT NULL
* }
* }
*/
struct roseEtsiAOCSCurrencyInfo {
union {
struct roseEtsiAOCDurationCurrency duration;
struct roseEtsiAOCFlatRateCurrency flat_rate;
struct roseEtsiAOCVolumeRateCurrency volume_rate;
/*! SpecialChargingCode ::= INTEGER (1..10) */
u_int8_t special_charging_code;
} u;
/*!
* \brief Determine what is stored in the union.
* \details
* specialChargingCode(0),
* durationCurrency(1),
* flatRateCurrency(2),
* volumeRateCurrency(3),
* freeOfCharge(4),
* currencyInfoNotAvailable(5),
*/
u_int8_t currency_type;
/*!
* \brief What service is being billed.
* \details
* basicCommunication(0),
* callAttempt(1),
* callSetup(2),
* userToUserInfo(3),
* operationOfSupplementaryServ(4)
*/
u_int8_t charged_item;
};
/*
* AOCSCurrencyInfoList ::= SEQUENCE SIZE (1..10) OF AOCSCurrencyInfo
*/
struct roseEtsiAOCSCurrencyInfoList {
/*! \brief SEQUENCE SIZE (1..10) OF AOCSCurrencyInfo */
struct roseEtsiAOCSCurrencyInfo list[10];
/*! \brief Number of AOCSCurrencyInfo records present */
u_int8_t num_records;
};
/*
* RecordedCurrency ::= SEQUENCE {
* rCurrency [1] IMPLICIT Currency,
* rAmount [2] IMPLICIT Amount
* }
*/
struct roseEtsiAOCRecordedCurrency {
/*! Amount of currency involved. */
struct roseEtsiAOCAmount amount;
/*! Currency ::= IA5String (SIZE (1..10)) -- Name of currency. */
unsigned char currency[10 + 1];
};
/*
* RecordedUnits ::= SEQUENCE {
* CHOICE {
* recordedNumberOfUnits NumberOfUnits,
* notAvailable NULL
* },
* recordedTypeOfUnits TypeOfUnit OPTIONAL
* }
*/
struct roseEtsiAOCRecordedUnits {
/*! \brief recordedNumberOfUnits INTEGER (0..16777215) -- 24 bit number */
u_int32_t number_of_units;
/*! \brief TRUE if number_of_units is not available (not present) */
u_int8_t not_available;
/*! \brief recordedTypeOfUnits INTEGER (1..16) (optional) */
u_int8_t type_of_unit;
/*! \brief TRUE if type_of_unit is present */
u_int8_t type_of_unit_present;
};
/*
* RecordedUnitsList ::= SEQUENCE SIZE (1..32) OF RecordedUnits
*/
struct roseEtsiAOCRecordedUnitsList {
/*! \brief SEQUENCE SIZE (1..32) OF RecordedUnits */
struct roseEtsiAOCRecordedUnits list[32];
/*! \brief Number of RecordedUnits records present */
u_int8_t num_records;
};
/*
* ChargingAssociation ::= CHOICE {
* chargedNumber [0] EXPLICIT PartyNumber,
* chargeIdentifier ChargeIdentifier
* }
*/
struct roseEtsiAOCChargingAssociation {
/*! chargeIdentifier: INTEGER (-32768..32767) -- 16 bit number */
int16_t id;
/*! chargedNumber */
struct rosePartyNumber number;
/*!
* \details
* charge_identifier(0),
* charged_number(1)
*/
u_int8_t type;
};
/*
* AOCECurrencyInfo ::= SEQUENCE {
* CHOICE {
* freeOfCharge [1] IMPLICIT NULL,
* specificCurrency SEQUENCE {
* recordedCurrency [1] IMPLICIT RecordedCurrency,
* aOCEBillingId [2] IMPLICIT AOCEBillingId OPTIONAL
* }
* },
* chargingAssociation ChargingAssociation OPTIONAL
* }
*/
struct roseEtsiAOCECurrencyInfo {
struct {
/*! \brief recorded currency */
struct roseEtsiAOCRecordedCurrency recorded;
/*!
* \brief AOCEBillingId (optional)
* \details
* normalCharging(0),
* reverseCharging(1),
* creditCardCharging(2),
* callForwardingUnconditional(3),
* callForwardingBusy(4),
* callForwardingNoReply(5),
* callDeflection(6),
* callTransfer(7)
*/
u_int8_t billing_id;
/*! \brief TRUE if billing id is present */
u_int8_t billing_id_present;
} specific;
/*! \brief chargingAssociation (optional) */
struct roseEtsiAOCChargingAssociation charging_association;
/*! \brief TRUE if charging_association is present */
u_int8_t charging_association_present;
/*!
* \brief TRUE if this is free of charge.
* \note When TRUE, the contents of specific are not valid.
*/
u_int8_t free_of_charge;
};
/*
* AOCEChargingUnitInfo ::= SEQUENCE {
* CHOICE {
* freeOfCharge [1] IMPLICIT NULL,
* specificChargingUnits SEQUENCE
* {
* recordedUnitsList [1] IMPLICIT RecordedUnitsList,
* aOCEBillingId [2] IMPLICIT AOCEBillingId OPTIONAL
* }
* },
* chargingAssociation ChargingAssociation OPTIONAL
* }
*/
struct roseEtsiAOCEChargingUnitInfo {
/*! \brief Not valid if free_of_charge is TRUE */
struct {
/*! \brief RecordedUnitsList */
struct roseEtsiAOCRecordedUnitsList recorded;
/*!
* \brief AOCEBillingId (optional)
* \details
* normalCharging(0),
* reverseCharging(1),
* creditCardCharging(2),
* callForwardingUnconditional(3),
* callForwardingBusy(4),
* callForwardingNoReply(5),
* callDeflection(6),
* callTransfer(7)
*/
u_int8_t billing_id;
/*! \brief TRUE if billing id is present */
u_int8_t billing_id_present;
} specific;
/*! \brief chargingAssociation (optional) */
struct roseEtsiAOCChargingAssociation charging_association;
/*! \brief TRUE if charging_association is present */
u_int8_t charging_association_present;
/*!
* \brief TRUE if this is free of charge.
* \note When TRUE, the contents of specific are not valid.
*/
u_int8_t free_of_charge;
};
/*
* ARGUMENT ChargingCase
*/
struct roseEtsiChargingRequest_ARG {
/*!
* \details
* chargingInformationAtCallSetup(0),
* chargingDuringACall(1),
* chargingAtTheEndOfACall(2)
*/
u_int8_t charging_case;
};