[Asterisk-Dev] Disabling native bridging altogether?

Peter Hsu peter at linkupservice.com
Thu Jul 21 13:17:31 MST 2005


My asterisk server seems to be sporadically attempting native transfers when 
I don't expect it to.  I've set notransfer=yes in my iax.conf both in the 
general section and for each of my outgoing peers.  I also include the t, T, 
and L(some int > 0) tags when doing the transfer.

Yet sometimes asterisk still attempts to native bridge.  This is in the 
1.0.9 release of asterisk.  Here's a snapshot of the log:

    -- Executing Dial("Local/test at outgoing", 
"IAX2/VoicePulse-out/1NXXNXXXXXX|30|tTL(3600000:)D()m(ring)") in new stack
    -- Limit Data:
    -- timelimit=3600000
    -- play_warning=0
    -- play_to_caller=yes
    -- play_to_callee=no
    -- warning_freq=0
    -- start_sound=bogus
    -- warning_sound=silence/1
    -- end_sound=silence/1
    -- Called VoicePulse-out/1NXXNXXXXXX
    -- Started music on hold, class 'ring', on Local/test at outgoing-2
    -- Call accepted by 64.192.112.9 (format ulaw)
    -- Format for call is ulaw
    -- IAX2/VoicePulse-out/2 is ringing
    -- IAX2/VoicePulse-out/2 answered Local/test at outgoing-2
    -- Stopped music on hold on Local/test at outgoing-2
    -- Attempting native bridge of IAX2/Gafachi-out/2 and IAX2/Gafachi-out/1

My extensions.conf looks something like:

exten => 
1,1,Dial(IAX2/VoicePulse-out/1${PHONE_NUMBER}|65|tm(ring)L(3600000))

My iax.conf looks like:

[general]
notransfer=yes
port=5036
tos=lowdelay
jitterbuffer=no

disallow=all
allow=gsm
allow=ulaw
allow=ilbc
allow=adpcm
allow=alaw

[VoicePulse-out]
type=peer
context=outgoing
secret=XXXXXX
username=YYYYY
host=gwiaxt01.voicepulse.com
nat=no
notransfer=yes


My question is whether I can disable native bridging altogether.  If I 
comment out the following lines in channel.c:

                if (c0->pvt->bridge && config->timelimit==0 &&
                        (c0->pvt->bridge == c1->pvt->bridge) && 
!nativefailed && !c0->monitor && !c1->monitor) {
                                /* Looks like they share a bridge code */
                        if (option_verbose > 2)
                                ast_verbose(VERBOSE_PREFIX_3 "Attempting 
native bridge of %s and %s\n", c0->name, c1->name);
                        if (!(res = c0->pvt->bridge(c0, c1, flags, fo, rc))) 
{
                                c0->bridge = NULL;
                                c1->bridge = NULL;
                                manager_event(EVENT_FLAG_CALL, "Unlink",
                                        "Channel1: %s\r\n"
                                        "Channel2: %s\r\n"
                                        "Uniqueid1: %s\r\n"
                                        "Uniqueid2: %s\r\n",
                                        c0->name, c1->name, c0->uniqueid, 
c1->uniqueid);
                                ast_log(LOG_DEBUG, "Returning from native 
bridge, channels: %s, %s\n",c0->name ,c1->name);
                                return 0;
                        }
                        /* If they return non-zero then continue on 
normally.  Let "-2" mean don't worry about
                           my not wanting to bridge */
                        if ((res != -2) && (res != -3))
                                ast_log(LOG_WARNING, "Private bridge between 
%s and %s failed\n", c0->name, c1->name);
                        if (res != -3) nativefailed++;
                }

Will I break anything else?  This would be a temporary fix until I can look 
into the code a little more..

Any input would be appreciated.

Thank you,

Peter Hsu 




More information about the asterisk-dev mailing list