Merged changes in from my branch at r4020.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4022 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Yossi Neiman committed 2007-01-22 22:03:56 +00:00
1 parent d3e1f400e5
commit c5d86f3e6f
16 files changed
+1274 -41

No files matched your search

+30 -1
View File
@@ -60,6 +60,7 @@ BaseCDR::BaseCDR(switch_mod_cdr_newchannel_t *newchannel)
if(newchannel != 0)
{
errorstate = 0;
originated=1; // One-legged calls are always considered the originator
memset(clid,0,80);
memset(dialplan,0,80);
memset(myuuid,0,37);
@@ -132,7 +133,6 @@ BaseCDR::BaseCDR(switch_mod_cdr_newchannel_t *newchannel)
// Or were we maybe we were the caller?
if(newchannel->callerprofile->originatee_caller_profile)
{
originated = 1;
if (newchannel->callerprofile) {
if(newchannel->callerprofile->caller_id_number != 0)
strncpy(src,newchannel->callerprofile->caller_id_number,strlen(newchannel->callerprofile->caller_id_number));
@@ -377,6 +377,35 @@ void BaseCDR::process_channel_variables(const std::list<std::string>& stringlist
}
}
void BaseCDR::escape_string(std::string& src)
{
std::string::size_type pos = 0;
// find all occurences of ' and replace them with \'
while ( ( pos = src.find( "'", pos ) ) != std::string::npos )
{
src.replace( pos, 1, "\\'" );
pos += 2;
}
}
std::string BaseCDR::escape_chararray(char* src)
{
std::string src_string = src;
std::string::size_type pos = 0;
// find all occurences of ' and replace them with \'
while ( ( pos = src_string.find( "'", pos ) ) != std::string::npos )
{
src_string.replace( pos, 1, "\\'" );
pos += 2;
}
return src_string;
}
/* For Emacs:
* Local Variables:
* mode:c++