Hi Girish!
Please send all emails to the list.
I have not tried IVR yet, nor I'm a programmer and experienced in
debugging - so my advices are very basic.
As ser crashes not immediately, maybe this is a memory problem. Try to
comment some parts of your module to find out the statements which makes
ser crash.
regards,
klaus
GR S wrote:
Note: forwarded message attached.
Klaus,
I posted this mail to the SER dev list yesterday and did not get reply for that. So i am
sending this to you off list. Could you please take a look at this and tell what is
going
wrong? I diagnosed it further and found that SER crashes because of SIGSEGV when we
modify the uri. Any help in this regard would greately be appreciated.
Regards,
=====
Girish Gopinath <gr_sh2003(a)yahoo.com>
__________________________________
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/
------------------------------------------------------------------------
Subject:
SER Crash Issues
From:
GR S <gr_sh2003(a)yahoo.com>
Date:
Tue, 1 Jun 2004 06:00:40 -0700 (PDT)
To:
serdev(a)lists.iptel.org
To:
serdev(a)lists.iptel.org
Hello All,
We have a system running SER and Asterisk together. SER on 5060 and Asterisk on 6060.
The
role of Asterisk is here to play the ivr messages. The calls land on SER and it gets the
appropriate context from a module and t_relays it to Asterisk. This is working fine, but
we experience crashes with SER after every 20-30 attempts. Our efforts to figure out the
problem were not succeeded. I am attaching herewith relevent parts of my ser.cfg file,
and the routine from the module that queries for the appropriate site context. Can
anyone
please verify the code and tell where the problem is? Any help on this regard would
greately be appreciated.
This is from ser.cfg file:
modparam ("ivrtest", "db_url",
"mysql://ser:heslo@localhost/ser")
modparam ("ivrtest", "proxy_domain", "192.168.68.20")
modparam ("ivrtest", "media_server", "192.168.68.20:6060")
if ( method == "INVITE") {
sl_send_reply("100", "Trying");
log(1,"Processsing call 1\n");
if (uri =~ "sip:[0-9]{10}@*"){
if (! get_ivr_context("1")) {
sl_send_reply ("404", "Not Found");
drop ();
break;
}
t_relay();
log(1, "Context Relayed\n");
break;
}
}
---------------------------------------------------------------------------
This is the routine from the module that serves the request for ivr context:
int get_ivr_context (struct sip_msg *msg, char *p1, char *p2)
{
str uri, strval;
char tollfree [15], newuri [60], sqlcommand [150];
db_res_t *res;
db_row_t row;
uri = msg->first_line.u.request.uri;
/* Expected toll free:- "sip:12345678900@blah..." */
memset (tollfree, 0x00, 15);
strncpy (tollfree, uri.s+4, 11);
strval.s = malloc(strlen(tollfree) + 1 );
strcpy(strval.s, tollfree);
strval.len = strlen(strval.s);
memset (sqlcommand, 0x00, 150);
sprintf (sqlcommand, "SELECT sitename FROM siteinfo, pbxivr WHERE siteinfo.siteid
=
pbxivr.siteid AND pbxivr.tollfreenum = '%s'", tollfree);
#if 0
fprintf(stderr, "Q: %s\n", sqlcommand);
#endif
db_raw_query (h, sqlcommand, &res);
if (RES_ROW_N (res) < 1) return -1;
row = RES_ROWS (res)[0];
if (! res || ! row.values)
{
db_free_query(h, res);
return -1;
}
else
{
/* New URI: "sip:sitename@192.168.68.20:6060"*/
memset (newuri, 0x00, 60);
sprintf (newuri, "sip:%s@%s", row.values[0].val.string_val, media_server);
uri.s = malloc (strlen (newuri)+1);
bzero (uri.s,strlen (newuri)+1);
strncpy (uri.s, newuri, strlen (newuri));
uri.len = strlen (newuri);
msg->parsed_uri_ok = 1;
set_uri (msg, uri);
}
if (db_free_query(h, res) < 0) return -1;
return 1;
}
TIA,
=====
Girish Gopinath <gr_sh2003(a)yahoo.com>
__________________________________
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/