@@ -33,6 +33,16 @@ var send = &cli.Command{
3333 Aliases : []string {"simNumber" },
3434 Usage : "SIM card index (one-based index, e.g. 1)" ,
3535 },
36+ & cli.BoolFlag {
37+ Name : "deliveryReport" ,
38+ Usage : "Enable delivery report (default: true)" ,
39+ Value : true ,
40+ },
41+ & cli.IntFlag {
42+ Name : "priority" ,
43+ Usage : "Priority, use >= 100 to bypass all limits and delays (-128 to 127, default: 0)" ,
44+ Value : 0 ,
45+ },
3646 & cli.DurationFlag {
3747 Name : "ttl" ,
3848 Usage : "Time to live (duration, e.g. 1h30m)" ,
@@ -49,7 +59,12 @@ var send = &cli.Command{
4959 ttl := c .Duration ("ttl" )
5060 validUntil := c .Timestamp ("validUntil" )
5161 if ttl > 0 && validUntil != nil {
52- return cli .Exit ("TTL and Valid Until flags are mutually exclusive" , 1 )
62+ return cli .Exit ("TTL and Valid Until flags are mutually exclusive" , codes .ParamsError )
63+ }
64+
65+ priority := c .Int ("priority" )
66+ if priority < int (smsgateway .PriorityMinimum ) || priority > int (smsgateway .PriorityMaximum ) {
67+ return cli .Exit (fmt .Sprintf ("Priority must be between %d and %d" , smsgateway .PriorityMinimum , smsgateway .PriorityMaximum ), codes .ParamsError )
5368 }
5469
5570 return nil
@@ -63,10 +78,13 @@ var send = &cli.Command{
6378 client := metadata .GetClient (c .App .Metadata )
6479 renderer := metadata .GetRenderer (c .App .Metadata )
6580
81+ withDeliveryReport := c .Bool ("deliveryReport" )
6682 req := smsgateway.Message {
67- ID : c .String ("id" ),
68- Message : msg ,
69- PhoneNumbers : c .StringSlice ("phones" ),
83+ ID : c .String ("id" ),
84+ Message : msg ,
85+ PhoneNumbers : c .StringSlice ("phones" ),
86+ WithDeliveryReport : & withDeliveryReport ,
87+ Priority : smsgateway .MessagePriority (c .Int ("priority" )),
7088 }
7189
7290 if sim := uint8 (c .Int ("sim" )); sim > 0 {
0 commit comments