[Home]

Summary:ASTERISK-23257: sip.conf option pendantic=yes not working for dialed numbers with sign #
Reporter:Wilmar Campos (willcampos78)Labels:
Date Opened:2014-02-05 16:58:24.000-0600Date Closed:2014-02-07 02:17:05.000-0600
Priority:MajorRegression?
Status:Closed/CompleteComponents:Channels/chan_sip/Messaging
Versions:11.7.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Centos 6.4 64 BitAttachments:
Description:Bug occurs when pedantic=yes option is active in sip.conf.
To replicate just create an extension like:
{noformat}
exten => _12.,1,NoOP(SIP Call ${EXTEN}, ${CALLERID(all)})
same => n,Dial(SIP/${EXTEN}@IP_PROVIDER,120,)
same => n,Hangup
{noformat}

When user dial {{126060#1305777777}}, the provider receives the call like:
{{126060%231305777777}}.

Please use same default sip.conf and add only pedantic=yes.

The flow of the call in signaling messages are:

{noformat}
customer -> asterisk SIP/SDP Request: INVITE sip:126060#13057777777@asterisk_ip, with session description

asterisk -> customer SIP Status: 100 Trying

asterisk -> provider SIP/SDP Request: INVITE sip:126060%23130577777@provider_ip, with session description
{noformat}

The issue is replicable with Asterisk 11.6.0 and 11.7.0

Comments:By: Matt Jordan (mjordan) 2014-02-05 17:10:23.768-0600

Thank you for taking the time to report this bug and helping to make Asterisk better. Unfortunately, we cannot work on this bug because your description did not include enough information. You may find it helpful to read the Asterisk Issue Guidelines http://www.asterisk.org/developers/bug-guidelines. We would be grateful if you would then provide a more complete description of the problem. At a minimum, we need:

1. the specific steps or actions you took that caused you to encounter the problem,
2. the behavior you expected, and
3. the behavior you actually encountered (in as much detail as possible).

This likely includes output from the console with debug level logging, a SIP trace (if this is SIP related), and configuration information such as dialplan (e.g. extensions.conf) and channel configuration (e.g. sip.conf). Thanks!



By: Wilmar Campos (willcampos78) 2014-02-06 19:29:31.920-0600

Hi Matt,

I have read the bug guidelines, and I think I have include most of the information the guidelines recommends.  There are others that are not related to this bug.

So far I have include information describing the problem, it is not really too complex, just activate pedantic on the version 11.7.0 of asterisk and check if a call with # sign in dial string have # or %23.  

I also have include steps to replicate the issue.
Also based on pedantic documentation, I guess option is not doing what is suppose to do.

I also have include a simple tshark trace and extensions example on how to setup and replicate issue.

Please advise based on my report what information is missing?  This is my first time doing this... so I don't know if there is a format you want me to follow.

Thanks,

Wilmar


By: Walter Doekes (wdoekes) 2014-02-07 02:14:49.657-0600

{noformat}
     reserved    =  ";" / "/" / "?" / ":" / "@" / "&" / "=" / "+"
                    / "$" / ","
     unreserved  =  alphanum / mark
     mark        =  "-" / "_" / "." / "!" / "~" / "*" / "'"
                    / "(" / ")"
     escaped     =  "%" HEXDIG HEXDIG
     token       =  1*(alphanum / "-" / "." / "!" / "%" / "*"
                    / "_" / "+" / "`" / "'" / "~" )
     separators  =  "(" / ")" / "<" / ">" / "@" /
                    "," / ";" / ":" / "\" / DQUOTE /
                    "/" / "[" / "]" / "?" / "=" /
                    "{" / "}" / SP / HTAB
     word        =  1*(alphanum / "-" / "." / "!" / "%" / "*" /
                    "_" / "+" / "`" / "'" / "~" /
                    "(" / ")" / "<" / ">" /
                    ":" / "\" / DQUOTE /
                    "/" / "[" / "]" / "?" /
                    "{" / "}" )
{noformat}

And:

{noformat}
SIP-URI          =  "sip:" [ userinfo ] hostport
                   uri-parameters [ headers ]
SIPS-URI         =  "sips:" [ userinfo ] hostport
                   uri-parameters [ headers ]
userinfo         =  ( user / telephone-subscriber ) [ ":" password ] "@"
user             =  1*( unreserved / escaped / user-unreserved )
user-unreserved  =  "&" / "=" / "+" / "$" / "," / ";" / "?" / "/"
{noformat}

So. Notice how you construct the user-part, by combining unreserved / escaped / user-unreserved.

The "#" isn't in it.

So, pedantic does what it's supposed to do: send out valid SIP on the wire.

You'll need to fix your device. Make it escape the "#" by sending "%23" instead.

Example of my old SPA941 phone when dialing 123#456.

{noformat}
INVITE sip:123%23456@voip...
{noformat}

Cheers.

Closing as not a bug.

By: Walter Doekes (wdoekes) 2014-02-07 02:17:05.117-0600

(Ask on IRC #asterisk or #asterisk-bugs if you want it reopened.)

By: Wilmar Campos (willcampos78) 2014-02-07 06:33:21.112-0600

Thanks Walter, sorry for the dumb questions, where do I change it to include the # ?

Thanks,

Wilmar

By: Walter Doekes (wdoekes) 2014-02-07 06:38:27.669-0600

What?

You cannot *add* the '#' to the protocol just like that. That's like adding MAKE_ME_A_SANDWICH request type and expecting the provider to make you a sandwich.

The thing you should do, is fix the customer device to send out "%23" instead of "#".

If the problem is with your provider -- that it doesn't cope with '%23' -- then you should slap the provider with some pages of RFC3261.

Cheers,
Walter

By: Wilmar Campos (willcampos78) 2014-02-07 06:50:52.005-0600

Agree on that!

Thank you very much!!

By: Wilmar Campos (willcampos78) 2014-02-07 07:08:30.815-0600

Last remark, I notice when I have pendatic=no, the invite gets out with #, but when the asterisk gives back 183 progress, which is locally generated by asterisk, the contact goes out with the # esapcaed to %23

If pedantic=no, should not the 183 message have the # in it?  instead of the escaped one?



By: Walter Doekes (wdoekes) 2014-02-07 07:46:37.378-0600

It's a bug. But the real bug is that pedantic=no allows you to send out bad SIP.

So if anything should get fixed, it's the latter.

By: Wilmar Campos (willcampos78) 2014-02-11 08:30:32.555-0600

What should I do then?  Open another bug ticket?

By: Walter Doekes (wdoekes) 2014-02-11 08:55:00.041-0600

Depends on what you want.

If you leave pedantic to 'yes', you won't notice any bugs. But you'll notice how asterisk gracefully accepts your bad SIP and turns it into legal SIP ('#' becomes '%23').

If you set it to 'no', you'll see inconsistent buggy behaviour with regards to sending '#' some of the time.

You could open a ticket requesting it to always behave as pedantic=yes. But then you could simply set pedantic=yes instead and be done with it.
You could open a ticket requesting it to send out bad SIP all of the time with pedantic=no. But that ticket will most likely get the WONTFIX resolution.