bayonne-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bayonne-devel] Problem : Bayonne always try to drop call when exiting


From: Julien Chavanton
Subject: [Bayonne-devel] Problem : Bayonne always try to drop call when exiting
Date: Mon, 9 Aug 2004 15:06:22 -0400

I still have a small problem with Dialogic when I make outbound call and
there is busy for example when the script exit bayonne still make a
gc_dropcall() even if there is no call ?

I see that when bayonne program close it does validate if there is an
active call before drop and release but when doing exit it goes to
hangup and tries to drop the call even if there is no call ?

In some case I suspect it could block the port and restrict further
outgoing calls.


I will try to patch this by adding 
gc_ResetLineDev(linedev, EV_ASYNC); 
In case of Dropcall failure 
And a proper validation before making the dropcall.
if(crn != -1) 
in DialogicTrunk::hangupCall 


//FROM Bayonne source code:


//BAYONNE CLOSING = CRN validation is used
DialogicTrunk::~DialogicTrunk()
{
        terminate();
        stopChannel(EV_ASYNC);
        tsRelease();

        if(crn != -1)
        {
                gc_DropCall(crn, GC_NORMAL_CLEARING, EV_SYNC);
                gc_ReleaseCallEx(crn, EV_SYNC);
        }

        if(dialogicivr.getBoardType() == SPRINGWARE)
                if(dx_close(chdev) < 0)
                        postError(chdev, "dx_close");

        ::close(evbuf[0]);
        ::close(evbuf[1]);
}

//EXIT = If I understand I think will always a call the Dialogic hangup
I //see a pointer to method but can not find the exact method name I
guess it //is an alias to DialogicTrunk::hangupCall
void DialogicTrunk::exit(void)
{
        if(!Trunk::flags.onexit)
                if(redirect("::exit"))
                {
                        autoloop(false);
                        Trunk::flags.onexit = true;
                        return;
                }

        char buffer[33];
        getName(buffer);
        slog(Slog::levelDebug) << buffer << ": script exiting" << endl;
        handler = &DialogicTrunk::hangupHandler;
}


//CALL HANGUP No CRN validation
bool DialogicTrunk::hangupCall(void)
{
        int cause;

        if(!Trunk::flags.offhook && !_accepted)
                return false;

        _disconnecting = true;

        switch(callstate)
        {
        case GCST_ACCEPTED:
        case GCST_OFFERED:
                cause = GC_CALL_REJECTED;
                break;
        default:
                cause = GC_NORMAL_CLEARING;
        }

        if(gc_DropCall(crn, cause, EV_ASYNC) < 0)
        {
                postGCError("gc_DropCall");
                return false;
        }

        Trunk::flags.offhook = false;
        return true;
}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]