jookies / jasmin

Jasmin - Open source SMS gateway
http://jasminsms.com
Other
1.04k stars 556 forks source link

Outbound restrictions - select multiple filters for user authorization #967

Closed WolframPrime closed 3 years ago

WolframPrime commented 3 years ago

I'm looking for a way to make outbound (MT) authorization more granular - perhaps I'm looking at incorrectly so feel free to correct me.

I'd like to be able to limit allowed SourceAddr by gid or uid - ie. uid 'companya' sends an authorization header and can log in to the RESTAPI but will receive "No route found" if they don't try to send through an approved SourceAddr within their group.

It seems I could be able to accomplish this via filters if I could add multiple filters to a single MT Route, but it seems I can only add a single filter when adding an MT Router.

Is there a way to chain these together, it seems like multiple filters can't be used on a single MT router (if SourceAddr is 16045551234 AND gid is 'brand1' send through SMPP_1).

magojr commented 3 years ago

Hi WolframPrime in the MT router definition, you can add multiple filters, delimited by a semicolon. Check the documentation here: https://docs.jasminsms.com/en/latest/management/jcli/modules.html#mt-router-manager

jcli : mtrouter -a Adding a new MT Route: (ok: save, ko: exit) type StaticMTRoute jasmin.routing.Routes.StaticMTRoute arguments: filters, connector filters filter_1;filter_2 order 10 connector smppc(smppcc_1) rate 0.0 ok

WolframPrime commented 3 years ago

Thank you, I can't believe I missed that!