SIP Simple Support On Asterisk 11

Home » Asterisk Users » SIP Simple Support On Asterisk 11
Asterisk Users 4 Comments

Hi all,

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&tr814)
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/

Thanks a lot,

Eloi

4 thoughts on - SIP Simple Support On Asterisk 11

  • Eloi Bail wrote:

    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:

    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

  • Hi,

    Thanks a lot for this detailed answer :

    – I managed to have it working disabling auth message request
    : auth_message_requests = no in sip.conf
    – pedantic=no does not resolve the issue
    – reenabling auth_message_requests = yes and removing pedantic option, your patch in chan_sip resolves the issues !

    As it looks like pidgin has an issue, I guess that we can use it as a workaround.

    I would like know to enable presence notification between each users. To fulfill it, I am using http://asteriskdocs.org/en/3rd_Edition/asterisk-book-html-chunk/DeviceStates_id265377.html

    Am I doing it in a good way ?

    Thanks !

    Eloi

  • Eloi,

    My responses are inline.

    You’re welcome. Thank you for responding. A lot of people forget to do so and future list readers are left wondering whether or not the proposed solution worked.

    I’m glad my patch worked but keep in mind that it really is a workaround, because it will cause actual retransmits of MESSAGE requests to be treated as new requests. This may not cause you any issues, but the root problem should still be addressed by submitting a report to the Pidgin bug tracker [1]. It’s a straightforward problem so if you provide a link to your original post [2] the developers should be able to resolve it quickly.

    Yes, but there is a 4th edition of “Asterisk: The Definitive Guide” available in the Open Feedback Publishing System [3] that is focused on documenting Asterisk 11.

    [1] https://developer.pidgin.im/wiki/TipsForBugReports
    [2] http://lists.digium.com/pipermail/asterisk-users/2013-June/279569.html
    [3] http://ofps.oreilly.com/titles/9781449332426/asterisk-DeviceStates.html

    Regards,

    Matthew Roth InterMedia Marketing Solutions Software Engineer and Systems Developer