pjsip-ua session timer error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello

I have am making a SIP application using the pjsip invite session that supports the timer extension.

I have found that the timer extension does not work quite right when an INVITE is received from a UAC that does not support timer but does contain a Session-Expires header (inserted by a proxy). Currently pjsip is responding with the UAC as the refresher. Then when no refresh occurs pjsip releases the call.

RFC 4028 section 9 shows that the uas should be the refresher if the uac does not support timer. I have fixed this by patching sip_timer.c pjsip_timer_process_req from around line 1091 to be:

            /* If UAC support timer (currently check the existence of
             * Session-Expires and Supported header in the request), set UAC as refresher.
             * Note proxies may add Session-Expires if they want the UAS to provide timer
             * if supported.
             */
            int uacSupportsTimer = 0;
            pjsip_supported_hdr *sup_hdr = (pjsip_supported_hdr*)
                  pjsip_msg_find_hdr(msg, PJSIP_H_SUPPORTED, NULL);
            if (sup_hdr) {
                unsigned i;
                for (i=0; i<sup_hdr->count; ++i) {
                    if (pj_stricmp(&sup_hdr->values[i], &STR_TIMER)==0) {
                        uacSupportsTimer = PJSIP_INV_SUPPORT_TIMER;
                        break;
                    }
                }
            }
            inv->timer->refresher = (se_hdr && uacSupportsTimer) ? TR_UAC : TR_UAS;

Regards

Glenn



Glenn Walbran
Software Engineer
NEC New Zealand Limited
NEC House, Level 6, 40 Taranaki Street, PO Box 1936, Wellington 6140, New Zealand
T: 043816265  M: 0293816265  F: +6443811110
glenn.walbran at nec.co.nz<mailto:glenn.walbran at nec.co.nz>
<http://nz.nec.com/>nz.nec.com<http://nz.nec.com>

[cid:imagebdc883.JPG at 0d8f5b9e.479d6566]

Please consider the environment before printing this email

Attention:
The information contained in this message and or attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material.  Any review, retransmission, dissemination, copying or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any system and destroy any copies. NEC has no liability for any act or omission in reliance on the email or any attachment.  Before opening this email or any attachment(s), please check them for viruses. NEC is not responsible for any viruses in this email or any attachment(s); any changes made to this  email or any attachment(s) after they are sent; or any effects this email or any attachment(s) have on your network or computer system.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20141024/0b39f44a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: imagebdc883.JPG
Type: image/jpeg
Size: 24297 bytes
Desc: imagebdc883.JPG
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20141024/0b39f44a/attachment.JPG>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux