Asterisk
  1. Asterisk
  2. ASTERISK-5689

[branch] Bridge two channels via a Dialplan App or an AMI event

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Severity: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Target Release Version/s: None
    • Component/s: Core/General
    • Labels:
      None
    • SVN Revision Number:
      61260
    • Mantis ID:
      5841
    • Regression:
      No

      Description

      This is probably a piece of crap. Probably can be done much more efficiently as well.

      It does work though.

      It's used to bridge another channel into the current channel right in the dialplan.

      I basically stole everything from mattf's manager bridge action and uncommented and commented stuff until it worked. (In fact, his name should probably be in the copyright notice instead of mine.)

      example usage...

      exten => s,1,Set(BRIDGECHAN=sip/tahaitianprincess69_1994-asdf)
      exten => s,2,Bridge

      That would bridge my internet girlf... I mean a person in an active call with my active call.

      It prints some weird garbage to the screen...

      Nov 23 22:08:39 NOTICE[21612]: app_bridge.c:98 bridge_exec: Attempting to bridge Local/13053249999@faketelco-fe90,1 with Local/1@onwait-076f,2 Playtone: 0xb62b2e9ct
      Nov 23 22:08:39 NOTICE[21612]: app_bridge.c:205 bridge_exec: Channels Bridge/Local/13053249999@faketelco-fe90,1<ZOMBIE> and é·é·ocal/1@onwait-076f,2<ZOMBIE> were successfully bridged

      Also prints these errors (even though they don't seem to cause any trouble)

      Nov 23 22:08:46 ERROR[21612]: ../include/asterisk/lock.h:324 __ast_pthread_mutex_unlock: app_bridge.c line 255 (bridge_exec): mutex '&tmpchana->lock' freed more times than we've locked!
      Nov 23 22:08:46 ERROR[21612]: ../include/asterisk/lock.h:337 __ast_pthread_mutex_unlock: app_bridge.c line 255 (bridge_exec): Error releasing mutex: Operation not permitted
      Nov 23 22:08:46 ERROR[21612]: ../include/asterisk/lock.h:324 __ast_pthread_mutex_unlock: app_bridge.c line 257 (bridge_exec): mutex '&tmpchanb->lock' freed more times than we've locked!
      Nov 23 22:08:46 ERROR[21612]: ../include/asterisk/lock.h:337 __ast_pthread_mutex_unlock: app_bridge.c line 257 (bridge_exec): Error releasing mutex: Operation not permitted
      Nov 23 22:08:46 ERROR[21612]: ../include/asterisk/lock.h:324 __ast_pthread_mutex_unlock: app_bridge.c line 259 (bridge_exec): mutex '&chana->lock' freed more times than we've locked!
      Nov 23 22:08:46 ERROR[21612]: ../include/asterisk/lock.h:337 __ast_pthread_mutex_unlock: app_bridge.c line 259 (bridge_exec): Error releasing mutex: Operation not permitted
      Nov 23 22:08:46 ERROR[21612]: ../include/asterisk/lock.h:324 __ast_pthread_mutex_unlock: app_bridge.c line 261 (bridge_exec): mutex '&chanb->lock' freed more times than we've locked!
      Nov 23 22:08:46 ERROR[21612]: ../include/asterisk/lock.h:337 __ast_pthread_mutex_unlock: app_bridge.c line 261 (bridge_exec): Error releasing mutex: Operation not permitted

                • ADDITIONAL INFORMATION ******

      I faxed a disclaimer back in February or something.

      p.s. i had to disable "playtones" to get it to work

      p.s.s. i know it would make more sense to have the BRIDGECHAN be an arg instead of a channel var.

      p.s.s.s. the reason for the "goto" statements is because in matt's it returns in a bunch of different places, but for an app we want to make sure we do LOCAL_USER_REMOVE.. so i just took all the returns and set res and sent them down to the bottom... without the goto's the code would keep executing even if there was an error at the beginning.

        Activity

        Hide
        Russell Bryant added a comment -

        moy: Thanks for the reply.

        I have another concern on the licensing side of things. There is the following statement in the original report:

        "I basically stole everything from mattf's manager bridge action and uncommented and commented stuff until it worked. (In fact, his name should probably be in the copyright notice instead of mine.)"

        If that is the case, then where did this code originally come from? Did it come from an old report where the code was disclaimed? Unfortunately, this will need to be resolved before I can do anything more with this code ...

        Show
        Russell Bryant added a comment - moy: Thanks for the reply. I have another concern on the licensing side of things. There is the following statement in the original report: "I basically stole everything from mattf's manager bridge action and uncommented and commented stuff until it worked. (In fact, his name should probably be in the copyright notice instead of mine.)" If that is the case, then where did this code originally come from? Did it come from an old report where the code was disclaimed? Unfortunately, this will need to be resolved before I can do anything more with this code ...
        Hide
        Serge Vecher added a comment -

        russell: I believe mattf referred here is matt florell (!cresl1n). The code was "ripped off" from issue 4297. Looks like it was disclaimed there ....

        Show
        Serge Vecher added a comment - russell: I believe mattf referred here is matt florell (!cresl1n). The code was "ripped off" from issue 4297. Looks like it was disclaimed there ....
        Hide
        Moises Silva added a comment -

        Yes, indeed, "twisted" administrator, said in his first post, point 4:

        "You seem to have used my code and not mflorrel's, although they're quite similar. If you're going to give credit, then it should be to both of us. I obviously don't mind people taking my code and doing things with it, but if you're going to credit things, give credit where it's due."

        So, I think that fixes the licensing issue, right?

        Show
        Moises Silva added a comment - Yes, indeed, "twisted" administrator, said in his first post, point 4: "You seem to have used my code and not mflorrel's, although they're quite similar. If you're going to give credit, then it should be to both of us. I obviously don't mind people taking my code and doing things with it, but if you're going to credit things, give credit where it's due." So, I think that fixes the licensing issue, right?
        Hide
        Russell Bryant added a comment -

        Yeah, it's all fine now.

        Show
        Russell Bryant added a comment - Yeah, it's all fine now.
        Hide
        Russell Bryant added a comment -

        After doing various minor fixes and code cleanup changes in the branch, I have committed this to trunk in revision 61281.

        Thank you to everyone that contributed to this patch, in both writing code and testing!

        Show
        Russell Bryant added a comment - After doing various minor fixes and code cleanup changes in the branch, I have committed this to trunk in revision 61281. Thank you to everyone that contributed to this patch, in both writing code and testing!

          Dates

          • Created:
            Updated:
            Resolved:

            Development