My Sofia SIP application responds to Invite with no SDP like this
nua_respond(_nh, 200, "OK",
SIPTAG_CONTENT_TYPE_STR("application/sdp"),
NUTAG_OFFER_SENT(1),
SOATAG_USER_SDP_STR("m=audio 1 RTP/AVP 0\n"
"a=rtpmap:0 PCMU/8000"),
TAG_NULL());
However, ACK after this one is not processed, and I see "ACK Timeout". Are there any tags I'm missing?
Related
I have a API made in Dotnet 6, running in a docker container and hosted on AWS.
The client is built in Wordpress and uses php curl to make requests to the api.
The Api is built with using minimal APIs and as much as I can see it doesn't do anything too fancy.
After going live with the API I did start notice strange logs where requests end with a BadHttpRequestException.
I have not been able to trace what is causing it but if we look at the server logs that traces the entire request we can see that the request is fulfilled and it sends back the response with a status of 200.
After that at row 18 it starts to close the connection, but at row 19 it starts to read the body again which after a while ends with a Bad request error at row 22 before the connection is stopped.
This error is not caught in my exception middleware so I'm lost to what to do or how to fix in.
Any suggestions would be highly appreciated.
Both Logs below are for the same endpoint on the api
Log with error in it
1 "Connection id \"{ConnectionId}\" accepted.",
2 "Connection id \"{ConnectionId}\" started.",
3 "{HostingRequestStartingLog:l}",
4 "{CandidateCount} candidate(s) found for the request path '{Path}'",
5 "Request matched endpoint '{EndpointName}'",
6 "The request has an origin header: '{origin}'.",
7 "CORS policy execution successful.",
8 "Successfully validated the token.",
9 "AuthenticationScheme: {AuthenticationScheme} was successfully authenticated.",
10"AuthenticationScheme: {AuthenticationScheme} was successfully authenticated.",
11"Authorization was successful.",
12"Executing endpoint '{EndpointName}'",
13"Writing value of type '{Type}' with status code '200'.",
14"Executed endpoint '{EndpointName}'",
15"HTTP {RequestMethod} {RequestPath} responded 200 in {Elapsed:0.0000} ms",
16"Connection id \"{ConnectionId}\" completed keep alive response.",
17"{HostingRequestFinishedLog:l}",
18"Connection id \"{ConnectionId}\" received FIN.",
19"Connection id \"{ConnectionId}\", Request id \"{TraceIdentifier}\": started reading request body.",
20"Connection id \"{ConnectionId}\" sending FIN because: \"{Reason}\"",
21"Connection id \"{ConnectionId}\" disconnecting.",
22"Connection id \"{ConnectionId}\" bad request data: \"{message}\"",
23"Exception": "Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException: Unexpected end of request content.\n at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1ContentLengthMessageBody.TryReadInternal(ReadResult& readResult)\n at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1MessageBody.OnConsumeAsync()"
24"Connection id \"{ConnectionId}\", Request id \"{TraceIdentifier}\": done reading request body.",
25"Connection id \"{ConnectionId}\" stopped.",
Log that is fine
1 "Connection id \"{ConnectionId}\" accepted.",
2 "Connection id \"{ConnectionId}\" started.",
3 "{HostingRequestStartingLog:l}",
4 "{CandidateCount} candidate(s) found for the request path '{Path}'",
5 "Request matched endpoint '{EndpointName}'",
6 "The request has an origin header: '{origin}'.",
7 "CORS policy execution successful.",
8 "Successfully validated the token.",
9 "AuthenticationScheme: {AuthenticationScheme} was successfully authenticated.",
10"AuthenticationScheme: {AuthenticationScheme} was successfully authenticated.",
11"Authorization was successful.",
12"Executing endpoint '{EndpointName}'",
13"Writing value of type '{Type}' with status code '200'.",
14"Executed endpoint '{EndpointName}'",
15"HTTP {RequestMethod} {RequestPath} responded 200 in {Elapsed:0.0000} ms",
16"Connection id \"{ConnectionId}\" completed keep alive response.",
17"{HostingRequestFinishedLog:l}",
18"Connection id \"{ConnectionId}\", Request id \"{TraceIdentifier}\": started reading request body.",
19"Connection id \"{ConnectionId}\", Request id \"{TraceIdentifier}\": done reading request body.",
20"Connection id \"{ConnectionId}\" received FIN.",
21"Connection id \"{ConnectionId}\" disconnecting.",
22"Connection id \"{ConnectionId}\" sending FIN because: \"{Reason}\"",
23"Connection id \"{ConnectionId}\" stopped.",
I have ruby app which uses SMTP from SES aws.
In some my log from SNS I got something like that:
"delivery": {
"timestamp": "2022-09-02T12:38:30.510Z",
"processingTimeMillis": 1678,
"recipients": [
"example#mail
],
"smtpResponse": "250 2.6.0 <xxxxx#eu-west-1.amazonses.com> [InternalId=xxxxx, Hostname=xxxx.prod.outlook.com] 13028 bytes in 0.065, 192.793 KB/sec Queued mail for delivery",
"remoteMtaIp": "x.x.x.x",
"reportingMTA": "x.smtp-out.eu-west-1.amazonses.com"
}
}
My question is about Queued mail for delivery, becouse when I got this response the e-mail does not reach the end recipient.
It happens randomly, some emails arrive, some don't.
When emails arrive I got: "smtpResponse": "250 OK (someexample#mail.com:250 2.6.0 <x-x-x-x#eu-west-1.amazon...)",.
How can I solve it or where to look for the problem?
I will try to setup outgoing mail server in odoo 9 .so i fill all the field and test connection and the connection also success , but at the time of send mail it will generate an error .
Field fill like that:-
Name : sendmail
Priority: 10
SMTP Server : smtp.office365.com
SMTP Port:25
Debugging: enable
Connection Security:TLS (STARTTLS)
Username:my yser name
Password:password
But, when we send any mail then it will generate the below error
16-12-06 10:04:28,440 426 INFO test openerp.addons.base.ir.ir_mail_server: Mail delivery failed via SMTP server 'smtp.office365.com'.
SMTPDataError: 550
5.7.60 SMTP; Client does not have permissions to send as this sender
2016-12-06 10:04:28,443 426 ERROR test openerp.addons.mail.models.mail_mail: failed sending mail (id: 136) due to Mail Delivery Failed
Mail delivery failed via SMTP server 'smtp.office365.com'.
SMTPDataError: 550
5.7.60 SMTP; Client does not have permissions to send as this sender
Traceback (most recent call last):
File "/usr/lib/python2.7/dist- packages/openerp/addons/mail/models/mail_mail.py", line 262, in send
res = IrMailServer.send_email(msg, mail_server_id=mail.mail_server_id.id)
File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 248, in wrapper
return new_api(self, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 490, in new_api
result = method(self._model, cr, uid, *args, **old_kwargs)
File "/usr/lib/python2.7/dist-packages/openerp/addons/base/ir/ir_mail_server.py", line 483, in send_email
raise MailDeliveryException(_("Mail Delivery Failed"), msg)
MailDeliveryException: (u'Mail Delivery Failed', u"Mail delivery failed via SMTP server 'smtp.office365.com'.\nSMTPDataError: 550\n5.7.60 SMTP; Client does not have permissions to send as this sender")
So i tried too much for this , but i am not getting any solution , if you have any solutin , please share with me .
Use port 587.
The error message tells you that the sender is invalid - you can only send as the mailbox owner (primary SMTP address) or as one of the proxy addresses associated with the mailbox.
Removing all catchall parameters (mail.catchall.domain and mail.catchall.alias) under "Settings" -> "Technical" -> "Parameters" -> "System Parameters" and it work like charm .
WORKS LIKE CHARM :
Removing all catchall parameters (mail.catchall.domain and mail.catchall.alias) under "Settings" -> "Technical" -> "Parameters" -> "System Parameters" and it work like charm . TY Debasish
I'm on Odoo V12
It was not suffisient for my problem, I had to delete the alias domain but there another thing to check :
I initialy created my odoo installation with a GMAIL address, worked a bit but had to switch for a pro e-mail because all my invitations e-mail was blocked by Google Bot beacause it look liked suspicious. It did this only in Odoo v12 because there is more links in the mail.
So I configured my real smtp server in Odoo but get the error 550. Odoo kept in the COMPANY settings the primary gmail address and tried to send on my other smtp server with the gmail name. The other server didn't accepted it so sent me back error 550.
Once i putted my new e-mail address in the company description, and deleted alias domain it worked !!
PS : Don't try to edit ir_mail_server.py to put in bruteforce your e-mail ... Doesn't work ..
Hello and good evening to you,
This topic has been sort of a trouble to me and to many, suppose i want to send EMail in a C++ program to use smtp and StartTLS , what do i do, i culled a simple source code from google and i saw this code from here
http://www.drdobbs.com/sending-e-mail-using-smtp-and-winsock/184416591
now i want to use google mail and it uses authentication for smtp and also startTLS how do i do this
the sourcecode i saw looks like this
#pragma comment(lib, "wsock32.lib")
#include <windows.h>
#include "MailMessage.h"
int main(int argc, char **argv)
{
MailMessage mail("A Sender",
"someone#someplace.com",
"mail.someplace.com");
mail.To("A Recipient",
"you#yourplace.com");
mail.Subject("Sample message");
mail.Body("Plain text body",
"<HTML><BODY>\r\n"
" <H2>HTML Body</H2>\r\n"
"</BODY></HTML>""\r\n");
mail.Attach("C:\\Attach.txt");
const char *result =
mail.Send().data();
if (result[0] == '\0')
result = "Success";
MessageBox(NULL, result, "Result",
MB_ICONINFORMATION|MB_OK);
return 0;
}
After connecting to the server and issuing a EHLO (not HELO) command, if the server's reply includes the STARTTLS capability then you can issue a STARTTLS command at any time to create a secure session with the server. Upon receiving a successful STARTTLS reply, you need to send and complete an SSL/TLS handshake. Once the session has been created, you can continue sending your SMTP commands and receiving SMTP replies, starting with a new EHLO command (as the server's capabilities can change after the connection is secured). You have to encrypt your commands and decrypt the replies as you go. The communication would look like this (this example assumes an Application-Specific password has been configured in GMail if two-step verification is enabled):
S: 220 smtp.gmail.com ESMTP dg12sm55710335pac.47 - gsmtp
C: EHLO <hostname>
S: 250-smtp.gmail.com at your service, [<ip address>]
S: 250-SIZE 35882577
S: 250-8BITMIME
S: 250-STARTTLS
S: 250-ENHANCEDSTATUSCODES
S: 250-PIPELINING
S: 250-CHUNKING
S: 250 SMTPUTF8
C: STARTTLS
S: 220 2.0.0 Ready to start TLS
C/S: (Exchange SSL/TLS handshake)
C/S: (Everything from here on is now encrypted)
C: EHLO <hostname>
S: 250-smtp.gmail.com at your service, [<ip address>]
S: 250-SIZE 35882577
S: 250-8BITMIME
S: 250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH
S: 250-ENHANCEDSTATUSCODES
S: 250-PIPELINING
S: 250-CHUNKING
S: 250 SMTPUTF8
C: AUTH LOGIN
S: 334 VXNlcm5hbWU6
C: (Send base64 encoded username)
S: 334 UGFzc3dvcmQ6
C: (Send base64 encoded password)
S: 235 2.7.0 Accepted
C: (Send email as needed)
C: QUIT
S: 221 2.0.0 closing connection m1sm91929700pfi.27 - gsmtp
Now, how you actually handle the encryption is up to you. You can use a library like OpenSSL, or you can use Microsoft's Crypto/SChannel API. There are plenty of online tutorials and books on how to use them with sockets.
I wrote a program with Qt to work with cisco ip phone services. I'm using QNetworkAccessManager to post XML objects to phones and QTcpServer's socket with QTextStream to respond to authentication requests (simply writing http headers with "AUTHORIZED" to text stream).
QString cTime = currTime.currentDateTimeUtc().toString("ddd, dd MMM yyyy hh:mm:ss");
QTextStream os(socket); os << "HTTP/1.1 200 OK\r\n"
"Content-Type: text/plain\r\n"
"Date: " + cTime + " GMT\r\n"
"Connection: close\r\n"
"\r\n"
"AUTHORIZED";
The problem is the phones don't accept that response and return <CiscoIPPhoneError Number="4" />.
I used node.js for that before and simply wrote "AUTHORIZED" to http.serverResponse object, but I'm confused now why it doesn't work with Qt
Solved that.
The problem was the "Secure Authentication URL" field was set along with "Authentication url". And what I thought to be GET from phone was "Client hello"...
Cleared "Secure Authentication URL" in CUCM and it works now