q931: Decode phone numbers as ascii strings
This commit is contained in:
parent
fb7c63ef43
commit
a79e9bb390
6
q931.py
6
q931.py
|
@ -117,7 +117,7 @@ TonNpiByte = BitStruct('ext'/Bit,
|
|||
'type_of_number'/TypeOfNumber,
|
||||
'numbering_plan'/NumberingPlan)
|
||||
CalledPartyNum = Struct('hdr'/TonNpiByte,
|
||||
'digits'/GreedyBytes)
|
||||
'digits'/GreedyString('ascii'))
|
||||
|
||||
# Figure 4-15 / Q.931
|
||||
OddEvenInd = Enum(Bit, even=0, odd=1)
|
||||
|
@ -138,7 +138,7 @@ CallingPartyNum3a = BitStruct('ext'/Bit,
|
|||
|
||||
CallingPartyNum = Struct('hdr'/TonNpiByte,
|
||||
'octet_3a'/If(this.hdr.ext == 0, CallingPartyNum3a),
|
||||
'digits'/GreedyBytes)
|
||||
'digits'/GreedyString('ascii'))
|
||||
|
||||
# Q.931 Section 4.6.7; Figure 4-43 + Table 4-32: Redirecting number
|
||||
ReasonForRedir = Enum(BitsInteger(4), unknown=0, call_forwrding_busy_or_called_dte_busy=1,
|
||||
|
@ -150,7 +150,7 @@ RedirectingNum3b = BitStruct('ext'/Const(1, Bit),
|
|||
RedirectingNum = Struct('hdr'/TonNpiByte,
|
||||
'octet_3a'/If(this.hdr.ext == 0, CallingPartyNum3a),
|
||||
'octet_3b'/If(this.hdr.ext == 0 and this.octet_3a.ext == 0, RedirectingNum3b),
|
||||
'digits'/GreedyBytes)
|
||||
'digits'/GreedyString('ascii'))
|
||||
|
||||
|
||||
InterfaceId = BitStruct('ext'/Bit, 'interface_id'/BitsInteger(7)) # TODO: extension
|
||||
|
|
Loading…
Reference in New Issue