Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

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

[Freeswitch-users] S3 Upload Issue


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





PostPosted: Sat Nov 20, 2021 5:47 pm    Post subject: [Freeswitch-users] S3 Upload Issue Reply with quote

Hi Users,

We have a scenario, in which we are uploading recording file on "S3" (AWS) after completion of a call through python script.
We encountered error in uploading recording file on S3 for some calls and for some it worked fine. After debugging the issue we have this scenario:
Currently when the calls hangup after being answered (before we get the below mentioned logs in fs_cli), the script returns us an error (logs attached). But if we get the below mentioned [Debug] logs and call hangup after these, no error occurs and script successfully upload the file to s3.
We have not encountered that issue before.

[Debug Logs]
2021-11-19 02:58:08.748629 [DEBUG] switch_ivr_async.c:1427 Record session sample rate: 8000 -> 8000
2021-11-19 02:58:08.748629 [DEBUG] switch_core_media_bug.c:970 Attaching BUG to sofia/external/+18162394364
2021-11-19 02:58:08.768629 [DEBUG] switch_ivr_async.c:1717 No silence detection configured; assuming start of speech
2021-11-19 02:58:09.588628 [DEBUG] switch_rtp.c:7793 Correct audio ip/port confirmed.
2021-11-19 02:58:09.588628 [DEBUG] switch_core_io.c:448 Setting BUG Codec PCMU:0
2021-11-19 02:59:02.468628 [DEBUG] sofia.c:7406 Channel sofia/internal/3175520010@3.210.46.94:12000 ([email]sofia/internal/3175520010@3.210.46.94:12000[/email]) entering state [calling][0]
2021-11-19 02:59:02.928627 [DEBUG] sofia.c:7406 Channel sofia/internal/3175520010@3.210.46.94:12000 ([email]sofia/internal/3175520010@3.210.46.94:12000[/email]) entering state [ready][200]
2021-11-19 02:59:02.928627 [DEBUG] sofia.c:7416 Remote SDP:
v=0
o=Z 0 2 IN IP4 44.227.145.86
s=Z
c=IN IP4 44.227.145.86
t=0 0
m=audio 57578 RTP/AVP 0 106 9 8 3 101 98
a=rtpmap:106 opus/48000/2
a=fmtp:106 sprop-maxcapturerate=16000; minptime=20; useinbandfec=1
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=rtpmap:98 telephone-event/48000
a=fmtp:98 0-16

2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5601 Audio Codec Compare [PCMU:0:8000:20:64000:1]/[PCMU:0:8000:20:64000:1]
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5656 Audio Codec Compare [PCMU:0:8000:20:64000:1] ++++ is saved as a match
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5601 Audio Codec Compare [opus:106:48000:20:0:2]/[PCMU:0:8000:20:64000:1]
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5601 Audio Codec Compare [G722:9:8000:20:64000:1]/[PCMU:0:8000:20:64000:1]
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5601 Audio Codec Compare [PCMA:8:8000:20:64000:1]/[PCMU:0:8000:20:64000:1]
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5601 Audio Codec Compare [GSM:3:8000:20:13200:1]/[PCMU:0:8000:20:64000:1]
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5517 Set telephone-event payload to 101@8000
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5860 Set telephone-event payload to 101@8000
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5918 sofia/internal/3175520010@3.210.46.94:12000 ([email]sofia/internal/3175520010@3.210.46.94:12000[/email]) Set 2833 dtmf send payload to 101 recv payload to 101
2021-11-19 02:59:02.928627 [DEBUG] sofia.c:8427 Processing updated SDP
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:8657 Audio params are unchanged for sofia/internal/3175520010@3.210.46.94:12000 ([email]sofia/internal/3175520010@3.210.46.94:12000[/email]).
------------------------------------------------------------------------------------------------------------------------------------------

[Upload Error logs]

2021-11-19 02:47:03.348630 [ERR] mod_python.c:317 Error calling python script
2021-11-19 02:47:03.348630 [ERR] mod_python.c:165 Python Error by calling script "s3_upload": <class 'boto3.exceptions.S3UploadFailedError'>
Message: Failed to upload /tmp/3175520010_12028997788_fa1b6644-9779-42bb-a830-6bf51381484f.wav to storage.rvm.sas2.co/3175520010_12028997788_fa1b6644-9779-42bb-a830-6bf51381484f.wav: An error occurred (BadDigest) when calling the PutObject operation (reached max retries: 4): The Content-MD5 you specified did not match what we received.
Exception: None

Traceback (most recent call last)
        File: "/usr/local/freeswitch/scripts/s3_upload.py", line 22, in fsapi
        File: "/usr/local/lib/python2.7/dist-packages/boto3/s3/inject.py", line 131, in upload_file
        File: "/usr/local/lib/python2.7/dist-packages/boto3/s3/transfer.py", line 287, in upload_file
------------------------------------------------------------------------------------------------------------------------------------

Any help in this regard is highly appreciated.

Regards,
Danish Daud
Back to top
udy786 at gmail.com
Guest





PostPosted: Sat Nov 20, 2021 8:22 pm    Post subject: [Freeswitch-users] S3 Upload Issue Reply with quote

I will suggest you to use Python 3 and change the code accordingly and try. 

As I was boto3 in other process project to upload recording to S3 and had same random issue. After shifting to Python 3, never had any problem.


On Sun, 21 Nov 2021, 4:05 am Danish Daud, <dajanjua@gmail.com (dajanjua@gmail.com)> wrote:

Quote:

Hi Users,

We have a scenario, in which we are uploading recording file on "S3" (AWS) after completion of a call through python script.
We encountered error in uploading recording file on S3 for some calls and for some it worked fine. After debugging the issue we have this scenario:
Currently when the calls hangup after being answered (before we get the below mentioned logs in fs_cli), the script returns us an error (logs attached). But if we get the below mentioned [Debug] logs and call hangup after these, no error occurs and script successfully upload the file to s3.
We have not encountered that issue before.

[Debug Logs]
2021-11-19 02:58:08.748629 [DEBUG] switch_ivr_async.c:1427 Record session sample rate: 8000 -> 8000
2021-11-19 02:58:08.748629 [DEBUG] switch_core_media_bug.c:970 Attaching BUG to sofia/external/+18162394364
2021-11-19 02:58:08.768629 [DEBUG] switch_ivr_async.c:1717 No silence detection configured; assuming start of speech
2021-11-19 02:58:09.588628 [DEBUG] switch_rtp.c:7793 Correct audio ip/port confirmed.
2021-11-19 02:58:09.588628 [DEBUG] switch_core_io.c:448 Setting BUG Codec PCMU:0
2021-11-19 02:59:02.468628 [DEBUG] sofia.c:7406 Channel sofia/internal/3175520010@3.210.46.94:12000 ([email]sofia/internal/3175520010@3.210.46.94:12000[/email]) entering state [calling][0]
2021-11-19 02:59:02.928627 [DEBUG] sofia.c:7406 Channel sofia/internal/3175520010@3.210.46.94:12000 ([email]sofia/internal/3175520010@3.210.46.94:12000[/email]) entering state [ready][200]
2021-11-19 02:59:02.928627 [DEBUG] sofia.c:7416 Remote SDP:
v=0
o=Z 0 2 IN IP4 44.227.145.86
s=Z
c=IN IP4 44.227.145.86
t=0 0
m=audio 57578 RTP/AVP 0 106 9 8 3 101 98
a=rtpmap:106 opus/48000/2
a=fmtp:106 sprop-maxcapturerate=16000; minptime=20; useinbandfec=1
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=rtpmap:98 telephone-event/48000
a=fmtp:98 0-16

2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5601 Audio Codec Compare [PCMU:0:8000:20:64000:1]/[PCMU:0:8000:20:64000:1]
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5656 Audio Codec Compare [PCMU:0:8000:20:64000:1] ++++ is saved as a match
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5601 Audio Codec Compare [opus:106:48000:20:0:2]/[PCMU:0:8000:20:64000:1]
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5601 Audio Codec Compare [G722:9:8000:20:64000:1]/[PCMU:0:8000:20:64000:1]
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5601 Audio Codec Compare [PCMA:8:8000:20:64000:1]/[PCMU:0:8000:20:64000:1]
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5601 Audio Codec Compare [GSM:3:8000:20:13200:1]/[PCMU:0:8000:20:64000:1]
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5517 Set telephone-event payload to 101@8000
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5860 Set telephone-event payload to 101@8000
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5918 sofia/internal/3175520010@3.210.46.94:12000 ([email]sofia/internal/3175520010@3.210.46.94:12000[/email]) Set 2833 dtmf send payload to 101 recv payload to 101
2021-11-19 02:59:02.928627 [DEBUG] sofia.c:8427 Processing updated SDP
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:8657 Audio params are unchanged for sofia/internal/3175520010@3.210.46.94:12000 ([email]sofia/internal/3175520010@3.210.46.94:12000[/email]).
------------------------------------------------------------------------------------------------------------------------------------------

[Upload Error logs]

2021-11-19 02:47:03.348630 [ERR] mod_python.c:317 Error calling python script
2021-11-19 02:47:03.348630 [ERR] mod_python.c:165 Python Error by calling script "s3_upload": <class 'boto3.exceptions.S3UploadFailedError'>
Message: Failed to upload /tmp/3175520010_12028997788_fa1b6644-9779-42bb-a830-6bf51381484f.wav to storage.rvm.sas2.co/3175520010_12028997788_fa1b6644-9779-42bb-a830-6bf51381484f.wav: An error occurred (BadDigest) when calling the PutObject operation (reached max retries: 4): The Content-MD5 you specified did not match what we received.
Exception: None

Traceback (most recent call last)
        File: "/usr/local/freeswitch/scripts/s3_upload.py", line 22, in fsapi
        File: "/usr/local/lib/python2.7/dist-packages/boto3/s3/inject.py", line 131, in upload_file
        File: "/usr/local/lib/python2.7/dist-packages/boto3/s3/transfer.py", line 287, in upload_file
------------------------------------------------------------------------------------------------------------------------------------

Any help in this regard is highly appreciated.

Regards,
Danish Daud





_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time https://signalwire.community

Professional FreeSWITCH Services
sales@freeswitch.com (sales@freeswitch.com)
https://freeswitch.com

Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://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
https://freeswitch.com
Back to top
bilaln018 at gmail.com
Guest





PostPosted: Mon Nov 22, 2021 1:12 pm    Post subject: [Freeswitch-users] S3 Upload Issue Reply with quote

Thanks Uday,
We did this change and issue is resolved now.
Writing here for future reference.




Regards
Abbasi

On Sun, 21 Nov 2021 at 6:08 AM, Uday kumar <udy786@gmail.com (udy786@gmail.com)> wrote:

Quote:
I will suggest you to use Python 3 and change the code accordingly and try. 

As I was boto3 in other process project to upload recording to S3 and had same random issue. After shifting to Python 3, never had any problem.


On Sun, 21 Nov 2021, 4:05 am Danish Daud, <dajanjua@gmail.com (dajanjua@gmail.com)> wrote:

Quote:

Hi Users,

We have a scenario, in which we are uploading recording file on "S3" (AWS) after completion of a call through python script.
We encountered error in uploading recording file on S3 for some calls and for some it worked fine. After debugging the issue we have this scenario:
Currently when the calls hangup after being answered (before we get the below mentioned logs in fs_cli), the script returns us an error (logs attached). But if we get the below mentioned [Debug] logs and call hangup after these, no error occurs and script successfully upload the file to s3.
We have not encountered that issue before.

[Debug Logs]
2021-11-19 02:58:08.748629 [DEBUG] switch_ivr_async.c:1427 Record session sample rate: 8000 -> 8000
2021-11-19 02:58:08.748629 [DEBUG] switch_core_media_bug.c:970 Attaching BUG to sofia/external/+18162394364
2021-11-19 02:58:08.768629 [DEBUG] switch_ivr_async.c:1717 No silence detection configured; assuming start of speech
2021-11-19 02:58:09.588628 [DEBUG] switch_rtp.c:7793 Correct audio ip/port confirmed.
2021-11-19 02:58:09.588628 [DEBUG] switch_core_io.c:448 Setting BUG Codec PCMU:0
2021-11-19 02:59:02.468628 [DEBUG] sofia.c:7406 Channel sofia/internal/3175520010@3.210.46.94:12000 ([email]sofia/internal/3175520010@3.210.46.94:12000[/email]) entering state [calling][0]
2021-11-19 02:59:02.928627 [DEBUG] sofia.c:7406 Channel sofia/internal/3175520010@3.210.46.94:12000 ([email]sofia/internal/3175520010@3.210.46.94:12000[/email]) entering state [ready][200]
2021-11-19 02:59:02.928627 [DEBUG] sofia.c:7416 Remote SDP:
v=0
o=Z 0 2 IN IP4 44.227.145.86
s=Z
c=IN IP4 44.227.145.86
t=0 0
m=audio 57578 RTP/AVP 0 106 9 8 3 101 98
a=rtpmap:106 opus/48000/2
a=fmtp:106 sprop-maxcapturerate=16000; minptime=20; useinbandfec=1
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=rtpmap:98 telephone-event/48000
a=fmtp:98 0-16

2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5601 Audio Codec Compare [PCMU:0:8000:20:64000:1]/[PCMU:0:8000:20:64000:1]
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5656 Audio Codec Compare [PCMU:0:8000:20:64000:1] ++++ is saved as a match
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5601 Audio Codec Compare [opus:106:48000:20:0:2]/[PCMU:0:8000:20:64000:1]
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5601 Audio Codec Compare [G722:9:8000:20:64000:1]/[PCMU:0:8000:20:64000:1]
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5601 Audio Codec Compare [PCMA:8:8000:20:64000:1]/[PCMU:0:8000:20:64000:1]
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5601 Audio Codec Compare [GSM:3:8000:20:13200:1]/[PCMU:0:8000:20:64000:1]
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5517 Set telephone-event payload to 101@8000
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5860 Set telephone-event payload to 101@8000
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5918 sofia/internal/3175520010@3.210.46.94:12000 ([email]sofia/internal/3175520010@3.210.46.94:12000[/email]) Set 2833 dtmf send payload to 101 recv payload to 101
2021-11-19 02:59:02.928627 [DEBUG] sofia.c:8427 Processing updated SDP
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:8657 Audio params are unchanged for sofia/internal/3175520010@3.210.46.94:12000 ([email]sofia/internal/3175520010@3.210.46.94:12000[/email]).
------------------------------------------------------------------------------------------------------------------------------------------

[Upload Error logs]

2021-11-19 02:47:03.348630 [ERR] mod_python.c:317 Error calling python script
2021-11-19 02:47:03.348630 [ERR] mod_python.c:165 Python Error by calling script "s3_upload": <class 'boto3.exceptions.S3UploadFailedError'>
Message: Failed to upload /tmp/3175520010_12028997788_fa1b6644-9779-42bb-a830-6bf51381484f.wav to storage.rvm.sas2.co/3175520010_12028997788_fa1b6644-9779-42bb-a830-6bf51381484f.wav: An error occurred (BadDigest) when calling the PutObject operation (reached max retries: 4): The Content-MD5 you specified did not match what we received.
Exception: None

Traceback (most recent call last)
        File: "/usr/local/freeswitch/scripts/s3_upload.py", line 22, in fsapi
        File: "/usr/local/lib/python2.7/dist-packages/boto3/s3/inject.py", line 131, in upload_file
        File: "/usr/local/lib/python2.7/dist-packages/boto3/s3/transfer.py", line 287, in upload_file
------------------------------------------------------------------------------------------------------------------------------------

Any help in this regard is highly appreciated.

Regards,
Danish Daud





_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time https://signalwire.community

Professional FreeSWITCH Services
sales@freeswitch.com (sales@freeswitch.com)
https://freeswitch.com

Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://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
https://freeswitch.com

_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time https://signalwire.community

Professional FreeSWITCH Services
sales@freeswitch.com (sales@freeswitch.com)
https://freeswitch.com

Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://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
https://freeswitch.com
Back to top
dajanjua at gmail.com
Guest





PostPosted: Mon Nov 22, 2021 10:37 pm    Post subject: [Freeswitch-users] S3 Upload Issue Reply with quote

[SOLVED]
By switching to FreeSwitch 1.10.7 & then building mod_python3 instead of mod_python resolve the issue. (Please run the "ldconfig" command before configuring FreeSwitch 1.10.7 using "./configure" command while installing from source)
Thank you !!!



On Mon, Nov 22, 2021 at 9:27 AM Danish Daud <dajanjua@gmail.com (dajanjua@gmail.com)> wrote:

Quote:
Thanks! Uday, for your suggestions.
Actually I also have not faced that issue while I tried to upload a file to S3 through python script locally (outside of freeswitch). I have tested successfully both with python 2.7 & 3.7.
We are using FreeSwitch 1.10.6 & we have tried to build mod_python in a way that it should use python 3 instead of python 2, but not succeed. If someone can guide us regarding that. It might help.
Also Can someone understand the logic I send above regarding the logs for successful upload and without these we receive errors ?  



On Sun, Nov 21, 2021 at 6:17 AM Uday kumar <udy786@gmail.com (udy786@gmail.com)> wrote:

Quote:
I will suggest you to use Python 3 and change the code accordingly and try. 

As I was boto3 in other process project to upload recording to S3 and had same random issue. After shifting to Python 3, never had any problem.


On Sun, 21 Nov 2021, 4:05 am Danish Daud, <dajanjua@gmail.com (dajanjua@gmail.com)> wrote:

Quote:

Hi Users,

We have a scenario, in which we are uploading recording file on "S3" (AWS) after completion of a call through python script.
We encountered error in uploading recording file on S3 for some calls and for some it worked fine. After debugging the issue we have this scenario:
Currently when the calls hangup after being answered (before we get the below mentioned logs in fs_cli), the script returns us an error (logs attached). But if we get the below mentioned [Debug] logs and call hangup after these, no error occurs and script successfully upload the file to s3.
We have not encountered that issue before.

[Debug Logs]
2021-11-19 02:58:08.748629 [DEBUG] switch_ivr_async.c:1427 Record session sample rate: 8000 -> 8000
2021-11-19 02:58:08.748629 [DEBUG] switch_core_media_bug.c:970 Attaching BUG to sofia/external/+18162394364
2021-11-19 02:58:08.768629 [DEBUG] switch_ivr_async.c:1717 No silence detection configured; assuming start of speech
2021-11-19 02:58:09.588628 [DEBUG] switch_rtp.c:7793 Correct audio ip/port confirmed.
2021-11-19 02:58:09.588628 [DEBUG] switch_core_io.c:448 Setting BUG Codec PCMU:0
2021-11-19 02:59:02.468628 [DEBUG] sofia.c:7406 Channel sofia/internal/3175520010@3.210.46.94:12000 ([email]sofia/internal/3175520010@3.210.46.94:12000[/email]) entering state [calling][0]
2021-11-19 02:59:02.928627 [DEBUG] sofia.c:7406 Channel sofia/internal/3175520010@3.210.46.94:12000 ([email]sofia/internal/3175520010@3.210.46.94:12000[/email]) entering state [ready][200]
2021-11-19 02:59:02.928627 [DEBUG] sofia.c:7416 Remote SDP:
v=0
o=Z 0 2 IN IP4 44.227.145.86
s=Z
c=IN IP4 44.227.145.86
t=0 0
m=audio 57578 RTP/AVP 0 106 9 8 3 101 98
a=rtpmap:106 opus/48000/2
a=fmtp:106 sprop-maxcapturerate=16000; minptime=20; useinbandfec=1
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=rtpmap:98 telephone-event/48000
a=fmtp:98 0-16

2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5601 Audio Codec Compare [PCMU:0:8000:20:64000:1]/[PCMU:0:8000:20:64000:1]
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5656 Audio Codec Compare [PCMU:0:8000:20:64000:1] ++++ is saved as a match
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5601 Audio Codec Compare [opus:106:48000:20:0:2]/[PCMU:0:8000:20:64000:1]
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5601 Audio Codec Compare [G722:9:8000:20:64000:1]/[PCMU:0:8000:20:64000:1]
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5601 Audio Codec Compare [PCMA:8:8000:20:64000:1]/[PCMU:0:8000:20:64000:1]
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5601 Audio Codec Compare [GSM:3:8000:20:13200:1]/[PCMU:0:8000:20:64000:1]
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5517 Set telephone-event payload to 101@8000
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5860 Set telephone-event payload to 101@8000
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5918 sofia/internal/3175520010@3.210.46.94:12000 ([email]sofia/internal/3175520010@3.210.46.94:12000[/email]) Set 2833 dtmf send payload to 101 recv payload to 101
2021-11-19 02:59:02.928627 [DEBUG] sofia.c:8427 Processing updated SDP
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:8657 Audio params are unchanged for sofia/internal/3175520010@3.210.46.94:12000 ([email]sofia/internal/3175520010@3.210.46.94:12000[/email]).
------------------------------------------------------------------------------------------------------------------------------------------

[Upload Error logs]

2021-11-19 02:47:03.348630 [ERR] mod_python.c:317 Error calling python script
2021-11-19 02:47:03.348630 [ERR] mod_python.c:165 Python Error by calling script "s3_upload": <class 'boto3.exceptions.S3UploadFailedError'>
Message: Failed to upload /tmp/3175520010_12028997788_fa1b6644-9779-42bb-a830-6bf51381484f.wav to storage.rvm.sas2.co/3175520010_12028997788_fa1b6644-9779-42bb-a830-6bf51381484f.wav: An error occurred (BadDigest) when calling the PutObject operation (reached max retries: 4): The Content-MD5 you specified did not match what we received.
Exception: None

Traceback (most recent call last)
        File: "/usr/local/freeswitch/scripts/s3_upload.py", line 22, in fsapi
        File: "/usr/local/lib/python2.7/dist-packages/boto3/s3/inject.py", line 131, in upload_file
        File: "/usr/local/lib/python2.7/dist-packages/boto3/s3/transfer.py", line 287, in upload_file
------------------------------------------------------------------------------------------------------------------------------------

Any help in this regard is highly appreciated.

Regards,
Danish Daud





_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time https://signalwire.community

Professional FreeSWITCH Services
sales@freeswitch.com (sales@freeswitch.com)
https://freeswitch.com

Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://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
https://freeswitch.com

_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time https://signalwire.community

Professional FreeSWITCH Services
sales@freeswitch.com (sales@freeswitch.com)
https://freeswitch.com

Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://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
https://freeswitch.com

Back to top
dajanjua at gmail.com
Guest





PostPosted: Mon Nov 22, 2021 10:47 pm    Post subject: [Freeswitch-users] S3 Upload Issue Reply with quote

Thanks! Uday, for your suggestions.
Actually I also have not faced that issue while I tried to upload a file to S3 through python script locally (outside of freeswitch). I have tested successfully both with python 2.7 & 3.7.
We are using FreeSwitch 1.10.6 & we have tried to build mod_python in a way that it should use python 3 instead of python 2, but not succeed. If someone can guide us regarding that. It might help.
Also Can someone understand the logic I send above regarding the logs for successful upload and without these we receive errors ?  



On Sun, Nov 21, 2021 at 6:17 AM Uday kumar <udy786@gmail.com (udy786@gmail.com)> wrote:

Quote:
I will suggest you to use Python 3 and change the code accordingly and try. 

As I was boto3 in other process project to upload recording to S3 and had same random issue. After shifting to Python 3, never had any problem.


On Sun, 21 Nov 2021, 4:05 am Danish Daud, <dajanjua@gmail.com (dajanjua@gmail.com)> wrote:

Quote:

Hi Users,

We have a scenario, in which we are uploading recording file on "S3" (AWS) after completion of a call through python script.
We encountered error in uploading recording file on S3 for some calls and for some it worked fine. After debugging the issue we have this scenario:
Currently when the calls hangup after being answered (before we get the below mentioned logs in fs_cli), the script returns us an error (logs attached). But if we get the below mentioned [Debug] logs and call hangup after these, no error occurs and script successfully upload the file to s3.
We have not encountered that issue before.

[Debug Logs]
2021-11-19 02:58:08.748629 [DEBUG] switch_ivr_async.c:1427 Record session sample rate: 8000 -> 8000
2021-11-19 02:58:08.748629 [DEBUG] switch_core_media_bug.c:970 Attaching BUG to sofia/external/+18162394364
2021-11-19 02:58:08.768629 [DEBUG] switch_ivr_async.c:1717 No silence detection configured; assuming start of speech
2021-11-19 02:58:09.588628 [DEBUG] switch_rtp.c:7793 Correct audio ip/port confirmed.
2021-11-19 02:58:09.588628 [DEBUG] switch_core_io.c:448 Setting BUG Codec PCMU:0
2021-11-19 02:59:02.468628 [DEBUG] sofia.c:7406 Channel sofia/internal/3175520010@3.210.46.94:12000 ([email]sofia/internal/3175520010@3.210.46.94:12000[/email]) entering state [calling][0]
2021-11-19 02:59:02.928627 [DEBUG] sofia.c:7406 Channel sofia/internal/3175520010@3.210.46.94:12000 ([email]sofia/internal/3175520010@3.210.46.94:12000[/email]) entering state [ready][200]
2021-11-19 02:59:02.928627 [DEBUG] sofia.c:7416 Remote SDP:
v=0
o=Z 0 2 IN IP4 44.227.145.86
s=Z
c=IN IP4 44.227.145.86
t=0 0
m=audio 57578 RTP/AVP 0 106 9 8 3 101 98
a=rtpmap:106 opus/48000/2
a=fmtp:106 sprop-maxcapturerate=16000; minptime=20; useinbandfec=1
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=rtpmap:98 telephone-event/48000
a=fmtp:98 0-16

2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5601 Audio Codec Compare [PCMU:0:8000:20:64000:1]/[PCMU:0:8000:20:64000:1]
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5656 Audio Codec Compare [PCMU:0:8000:20:64000:1] ++++ is saved as a match
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5601 Audio Codec Compare [opus:106:48000:20:0:2]/[PCMU:0:8000:20:64000:1]
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5601 Audio Codec Compare [G722:9:8000:20:64000:1]/[PCMU:0:8000:20:64000:1]
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5601 Audio Codec Compare [PCMA:8:8000:20:64000:1]/[PCMU:0:8000:20:64000:1]
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5601 Audio Codec Compare [GSM:3:8000:20:13200:1]/[PCMU:0:8000:20:64000:1]
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5517 Set telephone-event payload to 101@8000
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5860 Set telephone-event payload to 101@8000
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:5918 sofia/internal/3175520010@3.210.46.94:12000 ([email]sofia/internal/3175520010@3.210.46.94:12000[/email]) Set 2833 dtmf send payload to 101 recv payload to 101
2021-11-19 02:59:02.928627 [DEBUG] sofia.c:8427 Processing updated SDP
2021-11-19 02:59:02.928627 [DEBUG] switch_core_media.c:8657 Audio params are unchanged for sofia/internal/3175520010@3.210.46.94:12000 ([email]sofia/internal/3175520010@3.210.46.94:12000[/email]).
------------------------------------------------------------------------------------------------------------------------------------------

[Upload Error logs]

2021-11-19 02:47:03.348630 [ERR] mod_python.c:317 Error calling python script
2021-11-19 02:47:03.348630 [ERR] mod_python.c:165 Python Error by calling script "s3_upload": <class 'boto3.exceptions.S3UploadFailedError'>
Message: Failed to upload /tmp/3175520010_12028997788_fa1b6644-9779-42bb-a830-6bf51381484f.wav to storage.rvm.sas2.co/3175520010_12028997788_fa1b6644-9779-42bb-a830-6bf51381484f.wav: An error occurred (BadDigest) when calling the PutObject operation (reached max retries: 4): The Content-MD5 you specified did not match what we received.
Exception: None

Traceback (most recent call last)
        File: "/usr/local/freeswitch/scripts/s3_upload.py", line 22, in fsapi
        File: "/usr/local/lib/python2.7/dist-packages/boto3/s3/inject.py", line 131, in upload_file
        File: "/usr/local/lib/python2.7/dist-packages/boto3/s3/transfer.py", line 287, in upload_file
------------------------------------------------------------------------------------------------------------------------------------

Any help in this regard is highly appreciated.

Regards,
Danish Daud





_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time https://signalwire.community

Professional FreeSWITCH Services
sales@freeswitch.com (sales@freeswitch.com)
https://freeswitch.com

Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://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
https://freeswitch.com

_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time https://signalwire.community

Professional FreeSWITCH Services
sales@freeswitch.com (sales@freeswitch.com)
https://freeswitch.com

Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://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
https://freeswitch.com
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