Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] XML CDR resend curl command


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
john.nash778 at gmail.com
Guest





PostPosted: Thu Mar 03, 2016 5:49 am    Post subject: [Freeswitch-users] XML CDR resend curl command Reply with quote

When using XML CDR to resubmit XML CDR I have a shell script which resends XML CDR from error directory again to the web server (As per doc https://freeswitch.org/confluence/display/FREESWITCH/mod_xml_cdr)


In this script following curl command is doing the trick
Quote:
for CDR in $(find $CDRDIR -name "*.cdr.xml"); do
echo "Resubmitting $(basename $CDR .cdr.xml)..."
echo -n 'cdr='$(cat $CDR) | \
curl -sS -X POST -f --$AUTH_SCHEME -u $CRED -d @- $URL >/dev/null \
&& echo "OK, removing CDR file" \
&& rm -f $CDR
done


My question is how to handle the case when even this submission fails because of any reason?..I want to skip the remove file step in case again some error happens with web server, How can I do that?
Back to top
s.safarov at gmail.com
Guest





PostPosted: Thu Mar 03, 2016 11:40 am    Post subject: [Freeswitch-users] XML CDR resend curl command Reply with quote

You can check curl exitcode. If not zero, then do not delete file
On Thu, Mar 3, 2016, 13:48 John Nash <john.nash778@gmail.com (john.nash778@gmail.com)> wrote:

Quote:
When using XML CDR to resubmit XML CDR I have a shell script which resends XML CDR from error directory again to the web server (As per doc https://freeswitch.org/confluence/display/FREESWITCH/mod_xml_cdr)


In this script following curl command is doing the trick
Quote:
for CDR in $(find $CDRDIR -name "*.cdr.xml"); do
echo "Resubmitting $(basename $CDR .cdr.xml)..."
echo -n 'cdr='$(cat $CDR) | \
curl -sS -X POST -f --$AUTH_SCHEME -u $CRED -d @- $URL >/dev/null \
&& echo "OK, removing CDR file" \
&& rm -f $CDR
done


My question is how to handle the case when even this submission fails because of any reason?..I want to skip the remove file step in case again some error happens with web server, How can I do that?




_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org (consulting@freeswitch.org)
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
steveayre at gmail.com
Guest





PostPosted: Thu Mar 03, 2016 4:14 pm    Post subject: [Freeswitch-users] XML CDR resend curl command Reply with quote

Which this script already does - the && means the rm is only executed if the curl command had no error.

On 3 March 2016 at 16:38, Sergey Safarov <s.safarov@gmail.com (s.safarov@gmail.com)> wrote:
Quote:

You can check curl exitcode. If not zero, then do not delete file
On Thu, Mar 3, 2016, 13:48 John Nash <john.nash778@gmail.com (john.nash778@gmail.com)> wrote:



Quote:
When using XML CDR to resubmit XML CDR I have a shell script which resends XML CDR from error directory again to the web server (As per doc https://freeswitch.org/confluence/display/FREESWITCH/mod_xml_cdr)


In this script following curl command is doing the trick
Quote:
for CDR in $(find $CDRDIR -name "*.cdr.xml"); do
echo "Resubmitting $(basename $CDR .cdr.xml)..."
echo -n 'cdr='$(cat $CDR) | \
curl -sS -X POST -f --$AUTH_SCHEME -u $CRED -d @- $URL >/dev/null \
&& echo "OK, removing CDR file" \
&& rm -f $CDR
done


My question is how to handle the case when even this submission fails because of any reason?..I want to skip the remove file step in case again some error happens with web server, How can I do that?






_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org (consulting@freeswitch.org)
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org (consulting@freeswitch.org)
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services