chan_celliax not working with more than 4 device

Hi,

I am trying to work with 8 devices. I downloaded a version from "http://www.celliax.org/celliax_stuff.tgz".
But It creates problem with 5 devices. It works fine for 4 devices. I found write error(Resource Temporarily Unavailable).

I am currently trying to patch a working version for my customized need. I added a function
t o the original version like,

/* dump the fd status */
void
serial_pool_fd_dump_stat(
int fd)
{
int mcs;
int dtr;
int rts;
int dcd;
int cts;
int dsr;

/* see if this is terminal device */
if(!isatty(fd)) {
return;
}

/* get DTR, RTS, DCD status */

/* TIOCMGET get the status of modem bits */
mcs = 0;
if(ioctl(fd, TIOCMGET, &mcs) < 0) {
ast_log(LOG_ERROR, "error preparing fd[%d]: %s\n", fd, strerror(errno));
}
dsr = ((mcs | TIOCM_DSR) == mcs);
dtr = ((mcs | TIOCM_DTR) == mcs);
rts = ((mcs | TIOCM_RTS) == mcs);
cts = ((mcs | TIOCM_CTS) == mcs);
dcd = ((mcs | TIOCM_CAR) == mcs);
ast_log(LOG_NOTICE, "device status fddebug(%d)\n"
"---------------\n"
"dsr %s\n"
"dtr %s\n"
"rts %s\n"
"cts %s\n"
"dcd %s\n"
"---------------\n"
, fd
, dsr ? "++++: he is DOWN" : "----: he is UP"
, dtr ? "++++: I am DOWN" : "----: I am UP"
, rts ? "++++: I am ready to receive data" : "----: I am NOT ready to receive data"
, cts ? "++++: he is ready to receive" : "----: he is NOT ready to receive"
, dcd ? "++++: He is NOT connected" : "----: He is connected");
}

I called this function before the write() function call in serial_write_AT()
and serial_write_AT_nocr().

Let me show you the output,

............
............

device status fddebug(20)
---------------
dsr ----: he is UP
dtr ----: wait I am UP
rts ----: I am NOT ready to receive data
cts ++++: he is ready to receive
dcd ----: He is connected
---------------
..............
..............

The above code is when it is working good. But after some moments I get,

..................................
.................................
device status fddebug(20)
---------------
dsr ----: he is UP
dtr ----: wait I am UP
rts ----: I am NOT ready to receive data
cts ----: he is NOT ready to receive
dcd ----: He is connected
---------------
..................................
.................................

OR sometimes I get


................................
................................
device status fddebug(16)
---------------
dsr ++++: he is DOWN
dtr ----: I am UP
rts ----: I am NOT ready to receive data
cts ----: he is NOT ready to receive
dcd ----: He is connected
---------------
................................
................................

I do not know why the CTS or DSR is changed. And when it changes message sending
fails. If I try to close the fd at this moment, it stucks. I do not know how to recover from
this position. I have watched your code for problem. But no luck.

Some more informations:

*CLI> core show version
Asterisk 1.4.11 built by root @ Kiev-L on a i686 running Linux on 2007-10-02 16:08:20 UTC
*CLI>

Again I worked on a old version(I do not know how to get the version number from the archive).
It works with 8 devices smoothly.

Please let me know if there are other tests I should do with any code.

-- Thanks
Kamanashis Roy


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Again, I think the following

Again,

I think the following line in the chan_celliax.c should be replaced(It is creating segmentation fault).


#define CELLIAX_P_LOG (unsigned long)pthread_self(), __LINE__, p ? p->name ? p->name : "none" : "none", p ? p->owner ? p->owner->_state : -1 : -1, p ? p->interface_state : -1, p ? p->phone_callflow : -1, p ? p->skype_callflow : -1

The following code should be used instead of that.

#ifdef CELLIAX_SKYPE
# define CELLIAX_P_LOG (unsigned long)pthread_self(), __LINE__, p ? p->name ? p->name : "none" : "none", p ? p->owner ? p->owner->_state : -1 : -1, p ? p->interface_state : -1, p ? p->phone_callflow : -1, p ? p->skype_callflow : -1
#else
# define CELLIAX_P_LOG (unsigned long)pthread_self(), __LINE__, p ? p->name ? p->name : "none" : "none", p ? p->owner ? p->owner->_state : -1 : -1, p ? p->interface_state : -1, p ? p->phone_callflow : -1, -1
#endif /*- CELLIAX_SKYPE -*/

-- Thanks
Kamanashis Roy


more info, please

ciao Kamanashis (is this the name or latname?),

I would ask you to subscribe to the developers or users mailing list, it would be a much more effective mean to communicate (because it seems that this is not an easy problem ;-) ), see http://www.celliax.org/support for how to subscribe to the mailing lists.

Also, I would need much more details, like: operating system (linux or windows, which version and distribution), what hardware (which cellphone models, which datacable models, which soundcard models), what are you trying to do (callbacks, disa, etc), how is the flow (from where the calls are initiated, where they are terminated, eg: softphone->asterisk->celliax->mobile, etc), and *important* what is the problem:

I mean, what happens? Are you sure the problem is with the serials and not with the soundcards? (etc etc).

Happy to know you are trying this, I'm willing to help you at full extent.

Giovanni


p->skype_callflow = segfault?

You wrote:
I think the following line in the chan_celliax.c should be replaced(It is creating segmentation fault).
...

I do not think that, the segfault has another origin. If there is no CELLIAX_SKYPE defined the p->skype and p->skype_callflow still exist (they are zero, in this case). But maybe I have not got something

Giovanni


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.