[Asterisk-Dev] [LONG?] Impossible auto Dial with chan H323

Kiel Hedjam kiel at kikal.org
Fri Aug 13 07:11:05 MST 2004


On Thu, Aug 12, 2004, Kiel Hedjam wrote:
> 
> But this implies transforming deeply chan_h323.c,
> what do you think ? Is there a better solution ? or may I stop talking 
> now and buy a farm in Lesotho ?

It was not that stricky actually.
I reported the bug and submitted a patch bug_id:  #0002249

I changed the find_call() function.
This function find out a call within the call list iflist.

Each time a connection is built up, it's added to the iflist list
(iflist is a struct oh323_pvt pointer which points on the last oh323_pvt 
structure added to the list).

The former find_call(unsigned callReference) proceeded this way 

static struct oh323_pvt *find_call(int call_reference)
{
        struct oh323_pvt *p;

	ast_mutex_lock(&iflock);
        p = iflist;

        while(p) {
                if ((signed int)p->cd.call_reference == call_reference) {
                        /* Found the call */
                        ast_mutex_unlock(&iflock);
                        return p;
                }
                p = p->next;
        }
        ast_mutex_unlock(&iflock);
        return NULL;
}


So that when two channels were registered with the same CRV
(call_reference) only the last channel registered was found.
This situation happens exactly when the ast dials himself 
(both connection sides share the same CRV but have different 
tokens).

That's why I added a const char * parameter to find_call()
which is matched with the cd.call_token if the CRV test succeeds

regards,

-- 
Kiel



More information about the asterisk-dev mailing list