Re: [pjsip] Error segmentation

KD
Klaus Darilion
Fri, Jun 18, 2010 1:59 PM

Hi Peter!

Please do not use private emails unless it is a private issue. Always
use the mailing list - this will increase the chance that somebody helps
you.

Am 18.06.2010 15:36, schrieb peter hanshon:

here is the code that i changed

You are trying to send an INVITE in-dialog, immediately after sending
the initial INVITE. I guess this can not work as reINVITEs may be sent
only if the first INVITE is answered.

What are you trying to achieve?
Sending reINVITE with XML body?

If you want to send XML body in INVITEs I think it might be better to
use pjsua_call_make_call() for initial INVITE or pjsua_call_reinvite()
for ind-dialog INVITEs.

regards
Klaus

case 'm':

/* Make call! : */
printf("(You currently have %d calls)\n",
pjsua_call_get_count());
uri = NULL;
ui_input_url("Make call", buf, sizeof(buf), &result);
if (result.nb_result != NO_NB) {

if (result.nb_result == -1 || result.nb_result == 0) {
puts("You can't do that with make call!");
continue;
} else {
pjsua_buddy_info binfo;
pjsua_buddy_get_info(result.nb_result-1, &binfo);
tmp.ptr = buf;
pj_strncpy(&tmp, &binfo.uri, sizeof(buf));
}

} else if (result.uri_result) {
tmp = pj_str(result.uri_result);
} else {
tmp.slen = 0;
}
char body;
body=malloc(MAXMOTS
sizeof(char *));
const pj_str_t SIP_INFO = pj_str("INVITE");
pj_status_t status;
pjsua_msg_data msg_data;
pjsua_msg_data_init(&msg_data);
msg_data.content_type = pj_str("application/xml");
pjsua_call_make_call( current_acc, &tmp, 0, NULL,&msg_data , NULL);
pj_ansi_snprintf(body, sizeof(body),
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"
"<LaBri:user_profile
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" \r\n"
"xmlns:LaBri="http://www.labri.fr/"
xsi:schemaLocation="http://www.labri.fr/ uaprofschema.xsd">\r\n"
"<!-- edited with XMLSpy v2009 (http://www.altova.com) by ait chellouche (prive) -->\r\n"
"<user id=" 1">\r\n "
,
app_config.acc_cfg[current_acc].cred_info[app_config.acc_cfg[current_acc].cred_count].username
);
msg_data.msg_body = pj_str(body);

status = pjsua_call_send_request(current_call, &SIP_INFO,
&msg_data);

break;

Date: Fri, 18 Jun 2010 15:18:17 +0200
From: klaus.mailinglists@pernau.at
To: pjsip@lists.pjsip.org
CC: mido.1111@hotmail.fr
Subject: Re: [pjsip] Error segmentation

Hi!

We do not have time to review the whole source code to find the lines of
code you have changed.

Just post the relevant snippet of your code, marking the lines added

by you.

This will increase the chance that somebody reviews the code.

regards
klaus

Am 17.06.2010 20:57, schrieb peter hanshon:

HELLO
I changed "pjsua_app.c " so when sending a message sip invite with

a xml

it display somme line then it displays error sip calls
enclosed "pjsua_app.c"
so where is the problem

THANK YOU


Hotmail : une messagerie performante et gratuite avec une sécurité
signée Microsoft Profitez-en


Hotmail : une messagerie performante et gratuite avec une sécurité
signée Microsoft Profitez-en https://signup.live.com/signup.aspx?id=60969

Hi Peter! Please do not use private emails unless it is a private issue. Always use the mailing list - this will increase the chance that somebody helps you. Am 18.06.2010 15:36, schrieb peter hanshon: > here is the code that i changed You are trying to send an INVITE in-dialog, immediately after sending the initial INVITE. I guess this can not work as reINVITEs may be sent only if the first INVITE is answered. What are you trying to achieve? Sending reINVITE with XML body? If you want to send XML body in INVITEs I think it might be better to use pjsua_call_make_call() for initial INVITE or pjsua_call_reinvite() for ind-dialog INVITEs. regards Klaus > > > > > case 'm': > > /* Make call! : */ > printf("(You currently have %d calls)\n", > pjsua_call_get_count()); > uri = NULL; > ui_input_url("Make call", buf, sizeof(buf), &result); > if (result.nb_result != NO_NB) { > > if (result.nb_result == -1 || result.nb_result == 0) { > puts("You can't do that with make call!"); > continue; > } else { > pjsua_buddy_info binfo; > pjsua_buddy_get_info(result.nb_result-1, &binfo); > tmp.ptr = buf; > pj_strncpy(&tmp, &binfo.uri, sizeof(buf)); > } > > } else if (result.uri_result) { > tmp = pj_str(result.uri_result); > } else { > tmp.slen = 0; > } > char *body; > body=malloc(MAXMOTS*sizeof(char *)); > const pj_str_t SIP_INFO = pj_str("INVITE"); > pj_status_t status; > pjsua_msg_data msg_data; > pjsua_msg_data_init(&msg_data); > msg_data.content_type = pj_str("application/xml"); > pjsua_call_make_call( current_acc, &tmp, 0, NULL,&msg_data , NULL); > pj_ansi_snprintf(body, sizeof(body), > "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" > "<LaBri:user_profile > xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \r\n" > "xmlns:LaBri=\"http://www.labri.fr/\" > xsi:schemaLocation=\"http://www.labri.fr/ uaprofschema.xsd\">\r\n" > "<!-- edited with XMLSpy v2009 (http://www.altova.com) by ait chellouche > (prive) -->\r\n" > "<user id=\" 1\">\r\n " > , > app_config.acc_cfg[current_acc].cred_info[app_config.acc_cfg[current_acc].cred_count].username > ); > msg_data.msg_body = pj_str(body); > > status = pjsua_call_send_request(current_call, &SIP_INFO, > &msg_data); > > break; > > > Date: Fri, 18 Jun 2010 15:18:17 +0200 > > From: klaus.mailinglists@pernau.at > > To: pjsip@lists.pjsip.org > > CC: mido.1111@hotmail.fr > > Subject: Re: [pjsip] Error segmentation > > > > Hi! > > > > We do not have time to review the whole source code to find the lines of > > code you have changed. > > > > Just post the relevant snippet of your code, marking the lines added > by you. > > > > This will increase the chance that somebody reviews the code. > > > > regards > > klaus > > > > Am 17.06.2010 20:57, schrieb peter hanshon: > > > > > > HELLO > > > I changed "pjsua_app.c " so when sending a message sip invite with > a xml > > > it display somme line then it displays error sip calls > > > enclosed "pjsua_app.c" > > > so where is the problem > > > > > > THANK YOU > > > > > > > ------------------------------------------------------------------------ > > > Hotmail : une messagerie performante et gratuite avec une sécurité > > > signée Microsoft Profitez-en > <https://signup.live.com/signup.aspx?id=60969> > > > > > > > > > > > > _______________________________________________ > > > Visit our blog: http://blog.pjsip.org > > > > > > pjsip mailing list > > > pjsip@lists.pjsip.org > > > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > ------------------------------------------------------------------------ > Hotmail : une messagerie performante et gratuite avec une sécurité > signée Microsoft Profitez-en <https://signup.live.com/signup.aspx?id=60969>