[OpenSER-Users] pv transformation does not work when Contact contains spaces

Robert Dyck rob.dyck at telus.net
Sun Dec 23 08:50:36 CET 2007


When I included a pv transformation in my cfg script to extract the expires value from a Contact I found that it would not work if the Contact string contained spaces. I does not seem to affect registration.

$(ct{param.value,expires})

The following patch in 1.3.0 works for me --

--- parser/parse_param.c-orig   2007-12-22 23:23:05.000000000 -0800
+++ parser/parse_param.c        2007-12-22 23:23:38.000000000 -0800
@@ -281,7 +281,7 @@

        while(_s->len) {
                switch(_s->s[0]) {
-               case ' ':
+               //case ' ':
                case '\t':
                case '\r':
                case '\n':

An example of a message that fails Contact expires transformation --
Session Initiation Protocol
    Request-Line: REGISTER sip:proxy01.sipphone.com SIP/2.0
        Method: REGISTER
        Resent Packet: False
    Message Header
        Via: SIP/2.0/UDP 192.168.1.4:5061;branch=z9hG4bK-1849b3b3
        From: Gateway <sip:17476316719 at proxy01.sipphone.com>;tag=a0bda46794e0291o1
        To: Gateway <sip:1234567 at proxy01.sipphone.com>
        Call-ID: 6d0c06a5-8d11d464 at 192.168.1.4
        CSeq: 51635 REGISTER
        Max-Forwards: 70
        Authorization: Digest username="1234567",realm="proxy01.sipphone.com",nonce="476e0e7866cafbf20434684456644a3d2022c85f",uri="sip:proxy01.sipphone.com",algorithm=MD5,response="57d8e4aea67f9bb45ced0394fe54d659"
        Contact: Gateway <sip:1234567 at 192.168.1.4:5061>;expires=3600
        User-Agent: Linksys/SPA3000-3.1.10(GWd)
        Content-Length: 0
        Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER
        Supported: x-sipura
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kamailio.org/pipermail/users/attachments/20071222/55c7b8c0/attachment.htm 


More information about the Users mailing list