I was thinking that now that I got a GSM stick connected to my openwrt router with a internet connection and openwrt support asterisk, will it then be possible to make a SIP trunk from the router to my PBX box?
I have been searching around on Google and it seems like I only can find a setup on either the router og the PBX box and not a combination of them.
You should be able to configure Asterisk on OpenWrt as any other device. It's been a while since I used Asterisk, but as I recall configuring a trunk is possible.
You would edit the conf file as normal.
To be clear,
Are you registering to a 3rd device, and wanting to double register (SIP <registration> OpenWrt <registration> PBX), or
Are you trying to to forward a bilnd IP call entering the router without registration (Internet > OpenWrt <registration> PBX)
Perhaps I'm rusty - but I'm not sure that answers my inquiry regarding how OpenWrt is receiving/initiating the call, or if it has to register, or perform registration to a 3rd SIP server on the Interent.
USB modems usually don't have a way to make voice calls. Of course for that to have any possibility of working the SIM would need to be subscribed to a voice plan not data only.
You could of course trunk out to a third party VoIP provider like you can with any Internet connection.
Some older mobile broadband cards used to work with chan_dongle, but I haven't tried that for years.
If your goal is to have a failover for your PBX, i.e. that you have an Asterisk instance running on OpenWrt, then this is going to work fine. I used to have an IAX trunk between two Asterisk over Wireguard, all running on OpenWrt.
I have been reading about the chan_dongle for my PBX.
The plan was to get a cell plan with both data and voice call service.
Then there was a data connection for the internet as a failover (already configured) and then I was hoping there was a way to redirect the voice part from the dongle in my router to my PBX on my pi as the primary SIP.