Eloi Bail wrote:>
> I am trying to enable SIP SIMPLE communication in my test environment.
>
> I have the following env :
>
> - one server (192.168.50.126) with Asterisk 11
> - 2 clients using pidgin : demo-bob and demo-alice on my 192.168.50.143
>
> I successfully had a phone call between clients.
>
> I used the following link to enable SIMPLE messaging between my clients :
>
http://highsecurity.blogspot.ca/2012/03/asterisk-10-110-sms-messaging-or-sip.html
>
> Both users managed to register.
>
> Adding verbose on the server, I have the following traces when I send the
> message "MESSAGE FROM ALICE TO BOB" from "demo-alice"
to "demo-bob"
>
> http://paste.fedoraproject.org/19489/37158861/
>
> As you can see I succeed to have the message sent from alice to Asterisk.
>
> When the server is trying to transmitting, I see a 401 error message.
> According to this post (
http://forums.digium.com/viewtopic.php?f=1&t=72814 )
> the first 401 should be normal as authentication is requested.
>
> Afterwards the server emit 202 message.
>
> But "demo-bob" never receives a message.
> I ran wireshark on server and client. It confirms that no message is sent
from
> Asterisk to "demo-bob".
>
> Could you please give me advice ?
>
> Here are my extensions.conf and sip.conf according to the link I mentioned.
> http://paste.fedoraproject.org/19626/16493741/
>
> http://paste.fedoraproject.org/19627/49423137/
Eloi,
The trace shows that the initial MESSAGE from Alice does not include an
Authorization header so Asterisk responds with a 401 Unauthorized. Alice then
replies with a MESSAGE with an Authorization header, but reuses the same CSeq
header (CSeq: 6 MESSAGE) which causes Asterisk to ignore it as a retransmit:
> [Jun 18 16:49:35] DEBUG[16266] chan_sip.c: Ignoring SIP message because of
> retransmit (MESSAGE Seqno 6, ours 6)
I believe this is a bug in Pidgin because RFC 3261 [1] states:
CSeq or Command Sequence contains an integer and a method name. The
CSeq number is incremented for each new request within a dialog and
is a traditional sequence number.
...
Requests within a dialog MUST contain strictly monotonically
increasing and contiguous CSeq sequence numbers (increasing-by-one)
in each direction (excepting ACK and CANCEL of course, whose numbers
equal the requests being acknowledged or cancelled).
However, there is also a similar issue [2] that can be worked around by setting
"pedantic=no" in sip.conf. If that doesn't work, you can give the
following
(untested) patch to chan_sip.c a try:
===============================================================================---
chan_sip.c.orig 2013-06-19 11:44:38.000000000 -0400
+++ chan_sip.c 2013-06-19 11:47:22.000000000 -0400
@@ -28078,6 +28078,7 @@
} else if (p->icseq &&
p->icseq == seqno &&
req->method != SIP_ACK &&
+ p->method != SIP_MESSAGE &&
(p->method != SIP_CANCEL || p->alreadygone)) {
/* ignore means "don't do anything with it" but
still have to
respond appropriately. We do this if we receive a repeat of
===============================================================================
Good luck and please let the list know how this works out.
[1] http://www.ietf.org/rfc/rfc3261.txt
[2] https://issues.asterisk.org/jira/browse/ASTERISK-19139
Regards,
Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer