[Freeswitch-users] mod_xml_cdr not saving file correctly

Paul paul at iamfine.com
Fri Jan 27 10:11:42 MSK 2012


Using latest build I have encountered a very odd behavior and want to know if
it is a bug or not.
If not - I would appreciate any ideas on how to work around it

--
I have a lua script that processes my inbound calls, and uses mod_xml_cdr to
do a http curl to a web api and also save a copy to the local /log/xml_cdr
directory
--
When the call comes in - sometimes the xml_cdr works as advertised (posts
and saves). This is what the cdr looks like .....

<?xml version="1.0"?>
<cdr>
  <channel_data>
    <state>CS_REPORTING</state>
    <direction>inbound</direction>
    <state_number>11</state_number>
    <flags>0=1;1=1;35=1;36=1;38=1;41=1;51=1</flags>
    <caps>1=1;2=1;3=1;4=1;5=1;6=1</caps>
  </channel_data>

and sometimes it saves as follows, which breaks the http curl post.

%3C%3Fxml%20version%3D%221.0%22%3F%3E%0A%3Ccdr%3E%0A%20%20%3Cchannel_data%3E%0A%20%20%20%20%3Cstate%3ECS_REPORTING%3C/state%3E%0A%20%20%20%20%3Cdirection%3Einbound%3C/direction%3E%0A%20%20%20%20%3Cstate_number%3E11%3C/state_number%3E%0A%20%20%20%20%3Cflags%3E0%3D1%3B1%3D1%3B35%3D1%3B36%3D1%3B38%3D1%3B41%3D1%3B51%3D1%3C/flags%3E%0A%20%20%20%20%3Ccaps%3E1%3D1%3B2%3D1%3B3%3D1%3B4%3D1%3B5%3D1%3B6%3D1%3C/caps%3E%0A%20%20%3C/channel_data%3E%0A%20%20%3Cvariables%3E%0A%20%20%20%20%3Cdirection%3Einbound%3C/direction%3E%0A%20%20%20%20%3Cuuid%3E8bc9c803-d459-4228-bf9d-87419e57c73b%3C/uuid%3E%0A%20%20%20%20%3Csession_id%3E66%3C/session_id%3E%0A%20%20%20%20%3Csip_local_network_addr%3E192.168.100.82%3C/sip_local_network_addr%3E%0A%20%20%20%20%3Csip_network_ip%3E72.249.14.242%3C/sip_network_ip%3E%0A%20%20%20%20%3Csip_network_port%3E5060%3C/sip_network_port%3E%0A%20%20%20%20%3Csip_received_ip%3E72.249.14.242%3C/sip_received_ip%3E%0A%20%20%20%20%3Csip_received_port%3E5060%3C/sip_received_port%3E%0A%20%20%20%20%3Csip_via_protocol%3Eudp%3C/sip_via_protocol%3E%0A%20%20%20%20%3Csip_from_user%3E4088924027%3C/sip_from_user%3E%0A%20%20%20%20%3Csip_from_uri


I have taken the above snippets directly from the xml_cdr files that are
saved

both calls come in on same gateway and are answered with the same script
THE only difference is the caller ID
in the first case it is 10 digits NPA-NXX
in the second i convert it to 11 digits before executing the bulk of the
script with a 1NPA-NXX

both numbers are used as strings (confirmed with the lua type(var))


Any ideas welcome -
Paul



--
View this message in context: http://freeswitch-users.2379917.n2.nabble.com/mod-xml-cdr-not-saving-file-correctly-tp7229340p7229340.html
Sent from the freeswitch-users mailing list archive at Nabble.com.



Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list