Send announcements from ID 5000
This commit is contained in:
		
							parent
							
								
									586a9246b7
								
							
						
					
					
						commit
						e7b1c24ed9
					
				@ -428,6 +428,7 @@ def stream_trimmer_loop():
 | 
				
			|||||||
def sendSpeech(self,speech):
 | 
					def sendSpeech(self,speech):
 | 
				
			||||||
    sleep(1)
 | 
					    sleep(1)
 | 
				
			||||||
    _nine = bytes_3(9)
 | 
					    _nine = bytes_3(9)
 | 
				
			||||||
 | 
					    _source_id = bytes_3(5000)
 | 
				
			||||||
    _slot  = systems[system].STATUS[2]
 | 
					    _slot  = systems[system].STATUS[2]
 | 
				
			||||||
    while True:
 | 
					    while True:
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
@ -442,7 +443,7 @@ def sendSpeech(self,speech):
 | 
				
			|||||||
            systems[system].STATUS[_stream_id] = {
 | 
					            systems[system].STATUS[_stream_id] = {
 | 
				
			||||||
            'START':     _pkt_time,
 | 
					            'START':     _pkt_time,
 | 
				
			||||||
            'CONTENTION':False,
 | 
					            'CONTENTION':False,
 | 
				
			||||||
            'RFS':       _nine,
 | 
					            'RFS':       _source_id,
 | 
				
			||||||
            'TGID':      _nine,
 | 
					            'TGID':      _nine,
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            _slot['TX_TGID'] = _nine
 | 
					            _slot['TX_TGID'] = _nine
 | 
				
			||||||
@ -457,6 +458,7 @@ def sendSpeech(self,speech):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
def disconnectedVoice(system):
 | 
					def disconnectedVoice(system):
 | 
				
			||||||
    _nine = bytes_3(9)
 | 
					    _nine = bytes_3(9)
 | 
				
			||||||
 | 
					    _source_id = bytes_3(5000)
 | 
				
			||||||
    logger.info('(%s) Sending disconnected voice',system)
 | 
					    logger.info('(%s) Sending disconnected voice',system)
 | 
				
			||||||
    _say = [words['silence']]
 | 
					    _say = [words['silence']]
 | 
				
			||||||
    _say.append(words['silence']) 
 | 
					    _say.append(words['silence']) 
 | 
				
			||||||
@ -476,7 +478,7 @@ def disconnectedVoice(system):
 | 
				
			|||||||
    
 | 
					    
 | 
				
			||||||
    _say.append(words['silence']) 
 | 
					    _say.append(words['silence']) 
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    speech = pkt_gen(_nine, _nine, bytes_4(9), 1, _say)
 | 
					    speech = pkt_gen(_source_id, _nine, bytes_4(9), 1, _say)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    sleep(1)
 | 
					    sleep(1)
 | 
				
			||||||
    _slot  = systems[system].STATUS[2]
 | 
					    _slot  = systems[system].STATUS[2]
 | 
				
			||||||
@ -493,7 +495,7 @@ def disconnectedVoice(system):
 | 
				
			|||||||
            systems[system].STATUS[_stream_id] = {
 | 
					            systems[system].STATUS[_stream_id] = {
 | 
				
			||||||
            'START':     _pkt_time,
 | 
					            'START':     _pkt_time,
 | 
				
			||||||
            'CONTENTION':False,
 | 
					            'CONTENTION':False,
 | 
				
			||||||
            'RFS':       _nine,
 | 
					            'RFS':       _source_id,
 | 
				
			||||||
            'TGID':      _nine,
 | 
					            'TGID':      _nine,
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            _slot['TX_TGID'] = _nine
 | 
					            _slot['TX_TGID'] = _nine
 | 
				
			||||||
@ -543,7 +545,8 @@ def ident():
 | 
				
			|||||||
                #test 
 | 
					                #test 
 | 
				
			||||||
                #_say.append(AMBEobj.readSingleFile('44xx.ambe'))
 | 
					                #_say.append(AMBEobj.readSingleFile('44xx.ambe'))
 | 
				
			||||||
                _all_call = bytes_3(16777215)
 | 
					                _all_call = bytes_3(16777215)
 | 
				
			||||||
                speech = pkt_gen(_all_call, _all_call, bytes_4(16777215), 1, _say)
 | 
					                _source_id= bytes_3(5000)
 | 
				
			||||||
 | 
					                speech = pkt_gen(_source_id, _all_call, bytes_4(16777215), 1, _say)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                sleep(1)
 | 
					                sleep(1)
 | 
				
			||||||
                _slot  = systems[system].STATUS[2]
 | 
					                _slot  = systems[system].STATUS[2]
 | 
				
			||||||
@ -561,7 +564,7 @@ def ident():
 | 
				
			|||||||
                        systems[system].STATUS[_stream_id] = {
 | 
					                        systems[system].STATUS[_stream_id] = {
 | 
				
			||||||
                        'START':     _pkt_time,
 | 
					                        'START':     _pkt_time,
 | 
				
			||||||
                        'CONTENTION':False,
 | 
					                        'CONTENTION':False,
 | 
				
			||||||
                        'RFS':       _all_call,
 | 
					                        'RFS':       _source_id,
 | 
				
			||||||
                        'TGID':      _all_call,
 | 
					                        'TGID':      _all_call,
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        _slot['TX_TGID'] = _all_call
 | 
					                        _slot['TX_TGID'] = _all_call
 | 
				
			||||||
@ -1537,7 +1540,7 @@ class routerHBP(HBSYSTEM):
 | 
				
			|||||||
                    for num in str(_int_dst_id):
 | 
					                    for num in str(_int_dst_id):
 | 
				
			||||||
                        _say.append(words[num])
 | 
					                        _say.append(words[num])
 | 
				
			||||||
     
 | 
					     
 | 
				
			||||||
                speech = pkt_gen(_nine, _nine, bytes_4(9), 1, _say)
 | 
					                speech = pkt_gen(bytes_3(5000), _nine, bytes_4(9), 1, _say)
 | 
				
			||||||
                
 | 
					                
 | 
				
			||||||
                #call speech in a thread as it contains sleep() and hence could block the reactor
 | 
					                #call speech in a thread as it contains sleep() and hence could block the reactor
 | 
				
			||||||
                reactor.callInThread(sendSpeech,self,speech)
 | 
					                reactor.callInThread(sendSpeech,self,speech)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user