[Asterisk-Dev] Problem with multiple lines on Cisco phones.

Constantine Filin cfilin at intermedia.net
Wed Oct 27 01:24:01 MST 2004


I have a scenario where in channel SIP there are no users, only peers
taken in realtime from a database. Also I am using multiple lines
feature supported by Cisco phones 7960 and 7940. Multiple lines on a
single phone mean that in my setup I can have 2 or more peers sharing
the same IP address. 

When an INVITE arrives from one of IP sharing peers, chan_sip.c goes to
function "check_user_full", where the code finds out that the caller is
not a user (I do not have users) and gets down to call

peer = find_peer(NULL, &p->recv);

The second argument is the IP address where INVITE came from. Since
there are 2 peers sharing this IP address, "find_peer" in 50% of the
cases returns peer that is not the one that sent "INVITE". Eventually
this means that is it impossible to place a call from one of the 2 peers
sharing the same IP address.

One possible way to get it fixed is replace the above line of code with

peer = find_peer( (p->cid_num[0]=='\0') NULL ? p->cid_num, &p->recv);

p->cid_num is populated just a few lines above in function
"check_user_pull". 

Does anyone see that the suggested fix will create bug? If the suggested
fix is not right way to do it then what is the right way?

Thanks

-c



More information about the asterisk-dev mailing list