Correct dialed number

Hi team,

Is there anyway to detect if the number is correct without dialing a number?

What you mean under “correct”?

If you are using an analogue PSTN line, the only way you can interact with a number is by dialing it.

This feels like “how do I build up a list of numbers for my cold calling campaign whilst only annoying the victim when they are called with the actual marketing message?”!

I agree that the original question begs the question of the meaning of “correct”.

thank you guys for the reply,

Correct means valid dial-able number. but i get Ringing event all the time so i can not have an idea which one is valid. i want to have the status as soon as i dial the number, the other way is i wait for 60-120 seconds and then i get the SIP hangup cause but i want to achieve it instantly as soon as i dial the number. NO MISS CALL TO THE caller.

Thinking any other reasonable way :smile:

help help help

So you are using SIP! You didn’t say.

SIP should give you the clearing cause as soon as it knows.

I suspect that you are actually getting a 183 Progress response, with an in-band indication of the failure cause. Asterisk will not pass in band progress unless you explicitly invoke the Progress application (I think this is because it sometimes involves answering the call on the PSTN). If this is the case, the user needs to recognize the cause from the tone, as Asterisk will not try to analyze the tone or in-band anouncements.

I’m assuming you are not actually getting the true failure cause after a minute or two, but rather one resulting from failing to clear the failed call.

Sorry i think i am not descriptive enough, i m using asterisk 1.6 which is giving me an event hangup. while i initiate the call from manager, i have set the timeout 30seconds so after 30seconds i get an event hangup. which give me cause code and cause-text.

The cause code is same i.e 16 in both cases (for answered as well as for invalid number)
This is one issue, the ideal way is i just initiate a call and i get a SIP response code if the number is invalid. but i did get Ring and session 180 progress… (the reason is my SIP provider provides Progress 180)

so any idea what could be the possible solution… at least for the 1st issue? i know the second one is not possible.

180 is ringing, not progress.

If they are not changing ringing to Progress or a final status, you need to solve the problem at the ITSP end.

Yah my mistake, it is changing 180 to progress. but the final status is not correct. However when i reject the call from the called side, it gives me User Busy … so in this case it is giving me correct one.

i read that SIP hangup reasons are only coming in Asterisk 1.8 version. so may be i need to upgrade it

The SIP reasons still get mapped to ISDN ones, in ${HANGUPCAUSE}, which gives you rather more detail, even if the mapping is sometimes many to one. I doubt that anything will distinguish between a timeout and CANCEL in 180 and one in 183. If you get 183, you need to listen to the audio, which may be difficult with Originate - I’m not sure if the normal, local channel, techniques will help with that - you might have to answer and then let the outgoing side dialplan try and analyse the audio.

I need the result instantly like in 30seconds thats the challenge here. Anyways i am updating the asterisk version to 1.8 lets see it may help

Your ITSP isn’t giving them instantly, except, possibly, in the media stream. In turn they may only be reflecting the behaviour of the ISDN network to which they connect. I suspect if you actually did a non-automated call, and called the Progress application, you would hear SIT and a voice announcement saying the number is invalid.

I don’t think 1.8 will make any difference.

Yes agreed. I was checking an application named as Waitforring
do you think this can help?

I have used another provider and getting the same result…