Summary:ASTERISK-01793: Weird behavior when you do early-dial and IAX
Reporter:schurig (schurig)Labels:
Date Opened:2004-06-10 07:23:12Date Closed:2011-06-07 14:05:04
Versions:Frequency of
Environment:Attachments:( 0) 12345.siptrace
( 1) 89956.siptrace
( 2) 89958.iaxtrace
Description:I have a account at FreeWorldDialup and use their services via the IAX protocol. So in iax.conf I have this entry:



I also happen to have a GS phone, firmware where I enabled Early Dial. I added the "iptables -t nat -A PREROUTING -p udp -i eth0 --dport 0 -j REDIRECT --t
o-port 5060" on the command line to re-route the buggy SIP packets that GS sends to UDP port 0 to UDP port 5060.

Then early dial works, e.g. with the echo test of my dialplan.

I also an outdial number for FWD-IAX in extensions.conf:

exten=_89.,2,SetCIDName(MN Solutions)

When I now do the following actions, I hear:

lift handset: dial tone -> OK
"8": silence -> OK
"9": silence -> OK
"9": busy, also 503 display -> WEIRD
"5": busy, also 503 display -> WEIRD
"8": "Your phone number is 2 5 4 0 4 1"

I'd expect to hear nothig after I've dialled "9" and "5" as well.


See http://www.freeworlddialup.com/advanced/iax for their IAX service.
Comments:By: schurig (schurig) 2004-06-10 08:04:06

Mantis does not allow me, a wheny bugreporter, to fox the Serverity from "feature" to "minor".

By: Mark Spencer (markster) 2004-06-10 18:51:16

Can you attach the sip debug please.

Also, having a global pattern match (e.g. ".") isn't very useful for SIP with early dial because with SIP we can only say "Yes, valid number" and "No, not valid number", not "Valid number, but send me some more."

By: schurig (schurig) 2004-06-11 14:42:54

I'll attach the sip debug on Monday, when I'm back at work.

By: schurig (schurig) 2004-06-11 14:49:46

Hmm, are you sure that it is true what you say?  If SIP could only say "Yes" or "No", when why does early-dial work before the IAX-Transfer to FWD happens?  E.g. I can create an extension


and Early-Dial works as expected.

Also there is a SIP status code "484 Address Incomplete". See for example an excerpt of an (t)ethereal dump at http://www.voip-info.org/wiki-Asterisk+phone+grandstream+budgetone.

By: Mark Spencer (markster) 2004-06-11 17:50:38

We use 484 Address Incomplete to indicate that more digits are necessary to have a valid number.  You can support the following dialplan with early dial:


You cannot support the following dialplan with early dial:

The reason is that when you dial 123, we must either respond with 484, which says "It's not a complete address", or we must go ahead and take the call.  There is no way for us to say both "It is a valid number, but there still might be some digits."

By: schurig (schurig) 2004-06-14 03:41:57

Please stay at the original bug I reported. I don't want to have a dialplan with 12, 123, 1234, 12345.

I want to dial 89958 and don't want to hear BUSY in between and yet get a success at the end. It is a bug to hear BUSY while dialling and, later, when dialling more numbers, you still get through and get connected. And there is no 89, 899 or 8995 extension, neither here nor at FWD. Because this extensions don't exist, this should perfectly work with early-dial.

I attached 2 files. One where I dial an " exten=12345,1,Milliwatt" local application with Early dial. As you can see, it works perfectly.

By: schurig (schurig) 2004-06-14 03:47:29

Because early-dial works perfectly on a local extension, but not when Asterisk has to do some SIP <-> IAX bridging, I also attached an IAX trace.

By: Mark Spencer (markster) 2004-06-23 23:37:00

Can you attach your dialplan?  It looks like it's calling just "9", suggesting that you might have a ${EXTEN:2} or something that is stripping off the leading digits.

I'm strongly inclined to think this is a configuration issue.

By: schurig (schurig) 2004-06-24 02:50:35

If it is a config error, then shame on my (and my apologies to waste your time).

Yes there is a ${EXTEN:2} in the dialplan. I thouught this is necessary to get rid of the "89" that I use as my local extension. If I wouldn't strip the 89, then I'd dial the fwd number 89958 (which doesn't exist) instead of 958 (which is their automated time server), wouldn't I?

exten=_89.,2,SetCIDName(MN Solutions)

By: Mark Spencer (markster) 2004-06-24 08:58:02

This is just a configuration issue.

When you have:


That means "Any number beginning with "89".

As soon as you dial the next "9" that number becomes a match because "899" is now matched by the rule "_89." and SIP's early dial model (484/404/100) can ONLY be used to indicate that the number "Is not yet valid", "Cannot be valid" or "Is valid".  There is no way to indicate "The number is valid, but there might still be more."

So, as soon as you dial that third 9, it calls the FWD server, stripping the leading 2 digits, so it sends simply the single digit "9", to which the server replies "hey there's no extension."

Since we have not yet answered the SIP call, disconnecting it is done by sending "503 Service Unavailable" since that's the only appropriate way to terminate the dialog.

Fix your dialplan, fix the SIP protocol, or turn off early dial.  If you need further assistance, find someone on IRC to help you, but this ABSOLUTELY POSITIVELY IS NOT A BUG.