@@ -27,8 +27,7 @@ communication = parser.add_argument_group('communication')
2727
2828communication .add_argument ('-t' , '--type' ,
2929 type = str ,
30- help = 'OpenSIPS MI Communication Type' ,
31- default = 'http' )
30+ help = 'OpenSIPS MI Communication Type' )
3231communication .add_argument ('-i' , '--ip' ,
3332 type = str ,
3433 help = 'OpenSIPS MI IP Address' ,
@@ -37,6 +36,15 @@ communication.add_argument('-p', '--port',
3736 type = int ,
3837 help = 'OpenSIPS MI Port' ,
3938 default = 8888 )
39+ communication .add_argument ('-f' , '--file' ,
40+ type = str ,
41+ help = 'OpenSIPS MI FIFO File' )
42+ communication .add_argument ('-fb' , '--fallback' ,
43+ type = str ,
44+ help = 'OpenSIPS MI Fallback FIFO File' )
45+ communication .add_argument ('-fd' , '--dir' ,
46+ type = str ,
47+ help = 'OpenSIPS MI FIFO Reply Directory' )
4048
4149group = parser .add_mutually_exclusive_group (required = True )
4250
8391 except json .JSONDecodeError as e :
8492 print ('Invalid JSON: ' , e )
8593 exit (1 )
94+
95+ if not args .type or args .type == 'fifo' :
96+ fifo_args = {}
97+ if args .file :
98+ fifo_args ['file' ] = args .file
99+ if args .fallback :
100+ fifo_args ['fallback' ] = args .fallback
101+ if args .dir :
102+ fifo_args ['dir' ] = args .dir
103+ mi = OpenSIPSMI ('fifo' , ** fifo_args )
86104
87105if args .type == 'http' :
88106 mi = OpenSIPSMI ('http' , url = 'http://{}:{}/mi' .format (args .ip , args .port ))
0 commit comments