This mode of operation is probably a breach of the terms of service of your network operator. They may terminate your account or, for example, treat the calls as minimum length reverse charged calls.
You will only be able to drop the call if the incoming trunk supports rejecting a call in the alerting state. It is very likely that the callers network will change ringback to some other tone if you can do that. Asterisk can only control the clearing cause, on networks that allow one to be provided, not how the network reacts to it.
I presume, by DID, you mean the incoming digits on the trunk. As long as you enable logging of unanswered calls, there should be no problem with your logging requirements.
Are you referring to Call back services? I don’t think we fall into that category as we are not bypassing any local telcom company in favour of using a foreign, cheaper one instead. We send every caller of our DIDs a SMS through the local mobile networks which we obviously pay for and as each sms basically means 100% profit for the MNO they should be happy. And anyway, how would any network operator pick this up?
Can you give me some pointers how to configure a trunk to do this?
And what you are saying is that the clearing cause can be such that the caller either hears a standard ringing tone or even no tone at all?
You are denying the network revenue by using them to send a signal free of charge. They will tolerate people using things like toll savers on answering machines, because they still expect a lot of chargeable traffic, but if you have a business that never generates chargeable traffic, they are likely to consider that it breaks their fair usage rules.
A SIP trunk is an example of a trunk where you can send alerting (180 Ringing) and then reject the call (e.g. 4xx Congestion). A simple, POTS, analogue line is an example of one that doesn’t support this. I think ISDN lines are closer to the SIP case.
SIP doesn’t provide a means to reject a call with ringback and I doubt that ISDN signalling does, either. The way the call finally gets rejected is likely to depend on the originating network and all the intermediate gateways. However, I would expect it to result in an NU, BUSY or CONGESTION tone, or a voice annoucement.
If every signal the networks transmit via our DIDs triggers a sms I would consider that a neat revenue generator for the networks. We basically generate sms traffic for mobile networks. And then again: How would they ever pick up what we are doing?
I assume I have to specify those parameters you mention for a sip trunk in FreePBX “Trunks” - “Incoming settings” - “User details”?
We don’t need to reject the sip call with ringback. We only need to find a way to terminate the call after we extracted the DID and CID info. The sms sent to the caller is sent via standard bulk sms service.
If I understand you correctly then there wouldn’t be a way to reject the call and all the caller will ever hear is either no tone at all or just a normal ringing tone. There will always be some voice message or other signal no matter what, correct?
You should discuss your proposal with your network operator before implementing it.
As well as being the wrong forum for support, this is the wrong forum for FreePBX. With trunks that support it, one would use the diaplan to implement alerting, followed by rejection.
What happens when the call is finally rejected is not entirely within your control. You would need to test it across all the variables that would apply in practice. In particular, one network operator may use more than one type of PSTN switch for their landline customers, and the response to a rejected call may differ between them.