Summary:ASTERISK-13980: [patch] Create option to require audio before reinvite
Reporter:Jeff Phelps (blargman)Labels:
Date Opened:2009-04-17 13:52:24Date Closed:2011-06-22 16:49:14
Versions:Frequency of
Environment:Attachments:( 0) all_changes_final.patch
( 1) requireaudio_r192813.patch
( 2) requireaudio_r199214.patch
( 3) requireaudio_r204719.patch
Description:Due to revision 182527, I can no longer talk to my SIP Gateway, as it requires audio before a reinvite can be sent.

* no longer sends audio before a reinvite as of the aforementioned revision, and therefore I needed a way to use/test the 1.6.x branch without upgrading my current hardware...  

therefore, this patch adds the option 'requireaudio=yes' to asterisk.conf...

based on the state of this option, asterisk will or will not send audio to the SIP Gateway before sending a reinvite.


The default setting is requireaudio = no
Comments:By: Jeff Phelps (blargman) 2009-04-17 14:24:00

added second file so that the if statement uses the ast_opt_require_audio so that way it is not a waste of code space to define it...

By: Jeff Phelps (blargman) 2009-04-17 15:00:50

Courtesy of seanbright, added output for the option to 'core show settings' and reformatted so that everything would line up correctly...

By: Jeff Phelps (blargman) 2009-04-28 17:28:58

revision for the patch is 189082

By: Jeff Phelps (blargman) 2009-05-06 13:17:03

uploaded new patch for r192813 of trunk...

By: Ronald Chan (loloski) 2009-06-04 15:06:50

ping! a friend of mine, need this feature :)

By: Ronald Chan (loloski) 2009-06-04 15:10:34

just want to ask, how this can be move further?....will surely test this next with a friend :)

By: Jeff Phelps (blargman) 2009-06-04 15:10:37

I still use this patch, but have to update every time i try to install and test a new version...

Ping the asterisk-dev mailing list and let them know you have an interest/need in seeing this committed to the code...

Thanks for the interest...

By: Jeff Phelps (blargman) 2009-06-04 15:11:29

also, if you can test it, and say that it works for you, then that can help move it along faster...

By: Jeff Phelps (blargman) 2009-06-04 15:12:34

let me know what version of * you/your friend are on, and I will gladly update the patch for your version...

By: Ronald Chan (loloski) 2009-06-04 15:26:27

just bring this to trunk, since I personally don't use 1.6.x on production system yet :) we can't test this until next week. he will bring the other gateway to his system in order for this to test.

thanks BlargMaN.

By: Jeff Phelps (blargman) 2009-06-04 15:40:55

Brought this up to trunk per request of loloski...

The revision of trunk was r199214 at the time this was re-done...

By: Olle Johansson (oej) 2009-06-08 02:19:58

Why is Asterisk no longer sending audio before the re-invite?

By: Jeff Phelps (blargman) 2009-06-08 10:43:02

I have no idea...  I just know that the change was made, and it broke my system...  so I fixed it without really changing anything...  So to speak...

By: Jeff Phelps (blargman) 2009-06-10 15:12:41

The hardware that I am using, is a Cisco Call Manager v4.2

By: Olle Johansson (oej) 2009-06-17 10:03:24

I wonder if the change was made by decision or if it's actually a bug that needs a fix. Mail the mailing lite and ask so that we can clear that out.

By: Jeff Phelps (blargman) 2009-06-17 10:59:03

When I originally had this problem, I talked with file on #asterisk-bugs, and he said that the change was made and new exactly what my problem was after describing it to him, and providing him with SIP debugs…

So, I’m thinking that this is not a bug…

but, I will ask in the mailing list...

By: Leif Madsen (lmadsen) 2009-06-17 11:44:47

Just assigning this to file for now so he can make a comment as to what the issue is (or isn't) so that we can decide how to move this issue forward. Thanks!

By: Leif Madsen (lmadsen) 2009-06-17 11:55:58

Unassigning from file since he's busy.

By: Olle Johansson (oej) 2009-06-17 12:24:04

Just to clarify: We should not change behaviour in a released product. This needs to be fixed, unless it's really, really the only way to solve some other issue, but then it should be optional and by default, the behaviour should be as before.

By: Jeff Phelps (blargman) 2009-06-17 13:57:17

With the comment made by oej, this patch would put the functionality back to its original state, with the option to change it to the new abilities, just by changing my default setting to true, instead of false...

Comment???  Ideas???

By: Jeff Phelps (blargman) 2009-06-30 16:03:49


By: Leif Madsen (lmadsen) 2009-07-01 08:13:37

Marked as Ready for Review -- if this patch is not ready for commit, please let me know, and I will put it back to Ready for Testing.

By: Jeff Phelps (blargman) 2009-07-02 11:45:06

Updated to trunk again...  didn't know if it made any difference...

By: Ronald Chan (loloski) 2009-07-04 09:35:54


A friend of mind confirm that this works for him last week when he test this, i don't have a console debug to attach, anyway oej question

Why is Asterisk no longer sending audio before the re-invite? is still mystery??? anyway the patch made my BlagerMan seems to fixed my friend problem he still continue to use this patch as of this writing according to him with my conversation on the phone. thanks BlargMaN

By: Jeff Phelps (blargman) 2009-07-13 10:21:34

Ping...  Just waiting for someone to review this...

By: Jeff Phelps (blargman) 2009-08-04 13:55:50

Ping...  Just tryin to keep this from settling under the dust at the bottom of the list...  8)~

By: Jeff Phelps (blargman) 2009-09-08 14:13:43

Just trying to keep this alive...

By: Olle Johansson (oej) 2009-09-08 14:20:49

Ok, this is marked for trunk - but you talk about 1.6.x branch  - was this changed in a released version, like 1.6.0 or 1.6.1?

By: Jeff Phelps (blargman) 2009-09-08 14:23:22

it was changed in revision 182527...  i'll have to double check the change logs for the actual release it went into...

By: Jeff Phelps (blargman) 2009-09-08 14:25:42

it was committed on 2009-03-17, and went into

By: Olle Johansson (oej) 2009-09-08 14:27:43


Patch by kpfleming

By: Kevin P. Fleming (kpfleming) 2009-10-01 11:38:05

There is no correlation between audio flowing and re-INVITEs occurring in any RFC or specification I have seen. It is perfectly reasonable for chan_sip to issue a re-INVITE of any type (direct media path or T.38) before any audio has been sent to the other endpoint. If the other endpoint requires audio before receiving a re-INVITE, then we need to have a workaround to support them.

With that said, I don't think the supplied patch is the right way to solve this problem; this is not an Asterisk-wide problem, it is specific to chan_sip, and it should be solved in chan_sip. In addition, it should be controllable on a per-peer basis, not only globally. I suggest that the proper way to control this is for chan_sip to mark each new sip_pvt (dialog) structure as "no media has passed yet", and then when sip_write() is called it can mark the dialog as "media has passed". If a re-INVITE is attempted before audio has passed, and the configuration option to require media is enabled, then the re-INVITE should be marked as pending (which chan_sip already has support for), and sip_write() can call check_pendings() when it marks a dialog as "media has passed", which would trigger the re-INVITE that is pending.