pj_str_t, char*, and ptr

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks for your response.
 
I've found the same, and it work.
I haven't yet had time to reply at my message.
 
Thanks again, and bye.



From: archie@bbsti.comTo: pjsip at lists.pjsip.orgDate: Fri, 29 Aug 2008 11:44:34 -0400Subject: Re: pj_str_t, char*, and ptr






C?dric,
 
?tag? is of pj_str_t type.  The length of the string is located at rdata->msg_info.to->tag.slen. You can use the ptr and slen to copy or duplicate the string.  Here are some routines that work with pj_str_t http://www.pjsip.org/pjlib/docs/html/group__PJ__PSTR.htm although none create a null terminated string from a pj_str_t.
 
Take care,
Archie 
 
 
CHAR szBuffer[4000];  
ZeroMemory(szBuffer, sizeof(szBufffer));
memcpy(szBuffer, rdata->msg_info.to->tag.ptr, rdata->msg_info.to->tag.slen);
 
PCHAR pszBuffer;
pszBuffer = calloc(rdata->msg_info.to->tag.slen,1);
memcpy(pszBuffer, rdata->msg_info.to->tag.ptr, rdata->msg_info.to->tag.slen);
 
 
 

 
 
 
 
 




From: pjsip-bounces@xxxxxxxxxxxxxxx [mailto:pjsip-bounces at lists.pjsip.org] On Behalf Of cedric levequeSent: Friday, August 29, 2008 9:43 AMTo: pjsip at lists.pjsip.orgSubject: pj_str_t, char*, and ptr
 
Hi, I want to get some information on incoming request from rdata(pjsip_rx_data). When I use rdata->msg_info.to->tag.ptr, I obtain tag from the to but also the rest of the message. It is because of the "NOT null terminated" for the ptr, or a bug ? Do you know how I can do this ? Thanks by advance. C?dric.



Avec une webcam et Messenger partagez vos ?motions en vid?o ! T?l?chargez gratuitement !
_________________________________________________________________
Plus besoin de cl? usb ! Stockez votre musique en ligne gratuitement !
http://www.windowslive.fr/skydrive/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20080829/01afc2e1/attachment-0001.html 


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux