[Home]

Summary:ASTERISK-13389: [patch] Add the immediate=yes option to chan_iax2
Reporter:John Covert (jcovert)Labels:
Date Opened:2009-01-18 16:21:00.000-0600Date Closed:2010-05-12 15:01:10
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Channels/chan_iax2
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) chan_iax2.c.patch-1.6.0.3
( 1) chan_iax2.c.patch-trunk
( 2) iax.conf.sample.patch
Description:IAX phones and devices (such as the IAXy) are cool.  When you pick up the phone, a message is sent (even before you dial), and just like on the DAHDI FSX devices, code gets executed.

DAHDI has "immediate=yes" so that when you pick up the phone, you get connected directly to the "s" extension.  This is useful for lobby phones, elevator phones, manual service (number please), etc.

It was nearly trivial to implement in chan_iax2.c.  I made a deliberate decision to only implement it for users/friends who authenticate (as any properly connected phone or ATA would).  Simply add "immediate=yes" in the friend or user definition, and when you pick up the phone, instead of dialtone, you go right to extension "s" in the appropriate context.

****** ADDITIONAL INFORMATION ******

I've provided two versions of the patch.  One for 1.6.0.3 (for testing) and one for trunk.

I've also provided the following to add at the end of iax.conf.sample to document how to use it, and a patch for trunk.  Here's that example.

Comments:By: John Covert (jcovert) 2009-01-18 16:29:50.000-0600

BTW, the 1.6.0.3 patch file also fixes an unrelated compiler warning, but that has separately been fixed in trunk.  That's the "@@ -7085,7 +7087,7 @@" hunk.  Ignore it except for testing on 1.6.0.3.

By: David Vossel (dvossel) 2009-02-05 16:11:46.000-0600

cool patch.  i'll look over it and get it committed.

By: Miguel Molina (coolmig) 2009-02-05 17:13:16.000-0600

Very cool patch! Does it work with IAX2 softphones like Zoiper too? How hard would be to do an "unofficial" 1.4 backport of this?

By: John Covert (jcovert) 2009-02-05 17:22:47.000-0600

The 1.4 code and 1.2 code in the area of this patch is essentially the same, so any backporting is easy.

As for softphones... basically it works for any device which, when picked up, initiates its IAX connection before sending digits.  Unlike SIP, IAX has the ability to communicate a call initiation and then send digits one at a time.  I think most softphones can't be "picked up" and present the entire dialled number all at once.

By: Digium Subversion (svnbot) 2009-02-06 14:12:33.000-0600

Repository: asterisk
Revision: 174046

U   trunk/CHANGES
U   trunk/channels/chan_iax2.c
U   trunk/configs/iax.conf.sample

------------------------------------------------------------------------
r174046 | dvossel | 2009-02-06 14:12:33 -0600 (Fri, 06 Feb 2009) | 12 lines

Adds immediate yes/no option to iax.conf

This is very similar to the DAHDI immediate=yes option.  When the phone is picked up, instead of giving a dialtone it connects directly to the "s" extension.  Changes where implemented in chan_iax2.c to directly connect to the "s" extension in the appropriate context when this option is enabled.  Examples explaining its use are added to iax2.conf.sample.  CHANGES has been updated as well.

(closes issue ASTERISK-13389)
Reported by: jcovert
Patches:
     chan_iax2.c.patch-trunk uploaded by jcovert (license 551)
     iax.conf.sample.patch uploaded by jcovert (license 551)
Tested by: jcovert, dvossel
Review: http://reviewboard.digium.com/r/143/

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=174046

By: Digium Subversion (svnbot) 2009-02-06 14:26:28.000-0600

Repository: asterisk
Revision: 174075

_U  branches/1.6.0/

------------------------------------------------------------------------
r174075 | dvossel | 2009-02-06 14:26:28 -0600 (Fri, 06 Feb 2009) | 18 lines

Blocked revisions 174046 via svnmerge

........
 r174046 | dvossel | 2009-02-06 14:12:33 -0600 (Fri, 06 Feb 2009) | 12 lines
 
 Adds immediate yes/no option to iax.conf
 
 This is very similar to the DAHDI immediate=yes option.  When the phone is picked up, instead of giving a dialtone it connects directly to the "s" extension.  Changes where implemented in chan_iax2.c to directly connect to the "s" extension in the appropriate context when this option is enabled.  Examples explaining its use are added to iax2.conf.sample.  CHANGES has been updated as well.
 
 (closes issue ASTERISK-13389)
 Reported by: jcovert
 Patches:
       chan_iax2.c.patch-trunk uploaded by jcovert (license 551)
       iax.conf.sample.patch uploaded by jcovert (license 551)
 Tested by: jcovert, dvossel
 Review: http://reviewboard.digium.com/r/143/
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=174075

By: Digium Subversion (svnbot) 2009-02-06 14:29:58.000-0600

Repository: asterisk
Revision: 174076

_U  branches/1.6.1/

------------------------------------------------------------------------
r174076 | dvossel | 2009-02-06 14:29:58 -0600 (Fri, 06 Feb 2009) | 18 lines

Blocked revisions 174046 via svnmerge

........
 r174046 | dvossel | 2009-02-06 14:12:33 -0600 (Fri, 06 Feb 2009) | 12 lines
 
 Adds immediate yes/no option to iax.conf
 
 This is very similar to the DAHDI immediate=yes option.  When the phone is picked up, instead of giving a dialtone it connects directly to the "s" extension.  Changes where implemented in chan_iax2.c to directly connect to the "s" extension in the appropriate context when this option is enabled.  Examples explaining its use are added to iax2.conf.sample.  CHANGES has been updated as well.
 
 (closes issue ASTERISK-13389)
 Reported by: jcovert
 Patches:
       chan_iax2.c.patch-trunk uploaded by jcovert (license 551)
       iax.conf.sample.patch uploaded by jcovert (license 551)
 Tested by: jcovert, dvossel
 Review: http://reviewboard.digium.com/r/143/
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=174076

By: John Covert (jcovert) 2010-05-05 14:17:34

Looks like this only made it into 1.6.2 for some reason.  Could this be put into 1.6.0 and 1.6.1, if possible, please?  If not, it should be noted here.

By: David Vossel (dvossel) 2010-05-12 15:01:09

This only went into Trunk, 1.6.2 was branched after this was committed to trunk so it has it as well.  Since it is a new feature it will not be backported to 1.6.0 or 1.6.1.