SIP response codes instead of messages

Hi,

I have a FreePBX 2.9/Asterisk 1.6.2 installation running well with several hundred extensions and SIP trunks.

The company has a dialler system in the debt collection department that talks to the Asterisk server via a SIP trunk. All works well if calls are answers or unanswered but if the number dialled is invalid, or engaged FreePBX/Asterisk answers the call from the dialler and plays the “all circuits are busy now” message. The dialler sees this as an answered call.

Is it possible (maybe a custom context) to have Asterisk/FreePBX pass through the SIP codes from the external SIP trunk to the SIP trunk from the dialler?

Dialler --SIP Trunk–> Asterisk/FreePBX --SIP Trunk–> External Provider

Thanks

Graham

Two comments: First, this may be a provider issue. If the provider is returning “answer supervision” then FreePBX would pass that through. Alternately, it could be an Asterisk issue, in which case there’s nothing the FreePBX folks could do about it.

But also, the way you describe this setup, it sounds like you might be trying to do something of questionable legality. In the United States at least, it would be of questionable legality to use an automated system to contact an alleged debtor because you might not reach the intended target for any number of reasons, and under the FDCPA you are barred from disclosing any information about the debt to anyone other than the alleged debtor. So, you should be using humans to make these calls and if you do that, they can keep records of whether they reached the intended person or not, which is what you really need to know (knowing whether the call connected or not is useless from a legal standpoint, because it only counts if you actually reach the debtor). I’d suggest re-thinking your strategy a bit here.

Disclaimer: I am not a lawyer, and the above should not be taken as legal advice.

Thanks for the reply.

To answer the first comment, the provider is returning the correct codes (I can see them in the debug), I just need to pass them onto the other trunk from the dialler.

On the second comment, this is the UK so US rules don’t apply. Also, we ARE using humans to talk to the debtors, just using a dialler to place the initial calls.

So, back to the original question, hwo can I set the cause codes on the inbound (dialler) trunk so the match the codes I am receiving from the outbound (provider) trunk?

Thanks

Graham

Hi,

Not had any real responses to this, so I will try to reword the question.

I have a FreePBX 2.9/Asterisk 1.6.2 installation running well with several hundred extensions and SIP trunks.

We have another PBX ‘downstream’ from the Asterisk install which makes outbound calls via the Asterisk server. There is a SIP trunk between the downstream PBX and Asterisk, and another between Asterisk and the external provider. The downstream PBX cannot access the SIP provider directly due to security.

All works well if calls are answered or unanswered but if the number dialled is invalid, or engaged FreePBX/Asterisk answers the call from the dialler and plays the “all circuits are busy now” message. The downstream PBX sees this as an answered call.

Is it possible (maybe a custom context) to have Asterisk/FreePBX pass through the SIP codes from the external SIP trunk to the SIP trunk from the downstream PBX?

Downstream PBX --SIP Trunk–> Asterisk/FreePBX --SIP Trunk–> External Provider

Thanks

Graham

You need to disable the cruft freepbx puts there when trying to be helpful.

Put the following in extensions_override_freepbx.conf to disable macro outisbusy

[macro-outisbusy]
exten => s,1,MacroExit

Not sure if this will solve your problem, as depending on your setup, you might be getting a different message now :wink:
You would probably be better off if you were using plain asterisk in your scenario or some other SIP soft if all you are doing is switching calls.

Hi obelisk, thanks for your reply.

Removing that macro does stop the message, but it doesn’t change the SIP response codes coming out of Asterisk, which is where I think the issue lies. All the calls are being responded to as 503 Service Unavailable rather than, for example 404 Not Found for an invalid number.

Any ideas on that one?

Thanks for your time.

Graham

Use this code, it sends 404 back to SIP channel:

[macro-outisbusy] exten => s,1,Hangup(1)

Ah! great!

So the code after the hangup is the old ISDN cause codes which will map to the appropriate SIP code? Excellent.

Thanks for your help, I will give it a try and report back.

Graham

Yup, it is all defined in RFC 3398 - ISUP to SIP mapping - http://www.apps.ietf.org/rfc/rfc3398.html#sec-7.2.4.1