[Home]

Summary:ASTERISK-05482: [patch] application arguments with options are not parsed correctly
Reporter:vortex_0_o (vortex_0_o)Labels:
Date Opened:2005-11-06 18:22:43.000-0600Date Closed:2008-01-15 15:55:18.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) appopts.patch
( 1) parseoptions.patch
Description:exten => 8601,1,Dial(Local/8602/n,,D(${AGENTBYCALLERID_${CALLERIDNUM}}#${agentpass_${AGENTBYCALLERID_${CALLERIDNUM}}}##))

exten => 8602,1,AgentCallbackLogin()

the above used to work round about cvs 25th October and before.
Comments:By: Russell Bryant (russell) 2005-11-06 18:33:07.000-0600

Is this still an issue with the latest cvs head?

By: Russell Bryant (russell) 2005-11-06 19:46:13.000-0600

Have you tested the D() option to Dial in any other way to see if it is functioning as expected?

By: Russell Bryant (russell) 2005-11-06 20:30:36.000-0600

The D() option to dial is not working correctly.  The flag for the 'D' option is set, but the arguments for that option are not properly extracted.

By: Russell Bryant (russell) 2005-11-06 21:41:01.000-0600

Can you verify that this patch fixes your problem?

By: vortex_0_o (vortex_0_o) 2005-11-07 18:16:11.000-0600

patch works - thanks!

By: Kevin P. Fleming (kpfleming) 2005-11-07 19:29:33.000-0600

This patch can't be right... I tested the D() option myself before I committed the restructuring of app_dial.

The 'argloc' values in the options structure are intentionally incremented by 1 so that zero means 'this option doesn't take an argument', but the index values are zero-based so they can be used directly to index the array elements.

I think the problem must be somewhere else... It could be the s++ -> *++s conversion that I did in ast_app_parse_options, but I'll need to see the option parsing fail first to know for sure.

By: Russell Bryant (russell) 2005-11-07 22:50:44.000-0600

This has been fixed by incrementing the arg_index in the AST_APP_OPTION_ARG macro.

By: vortex_0_o (vortex_0_o) 2005-11-10 12:18:28.000-0600

Don't know if this is the same thing but retyring with current cvs the above passes a ( at the beginning that is not intended

resulting in error
illegal DTMF character '(' in string.

By: Russell Bryant (russell) 2005-11-10 16:39:49.000-0600

Yeah, you're right.  I forgot about that.  I had fixed it in my original patch.

Please try the new uploaded patch to verify that it fixes your problem.

By: alric (alric) 2005-11-10 17:03:49.000-0600

This may be related, A() is also not working as intended I believe.

   -- Executing Dial("Zap/2-1", "SIP/102110&SIP/102112|10|trA(granbury)") in new stack
   -- Called 102110
   -- Called 102112
   -- Got SIP response 486 "Busy Here" back from 64.6.35.91
   -- SIP/102110-7718 is busy
   -- SIP/102112-03e6 is ringing
   -- SIP/102112-03e6 answered Zap/2-1
Nov 10 16:57:31 WARNING[22661]: file.c:508 ast_openstream_full: File (granbury does not exist in any format
Nov 10 16:57:31 WARNING[22661]: file.c:820 ast_streamfile: Unable to open (granbury (format ulaw): No such file or directory

By: alric (alric) 2005-11-10 17:08:30.000-0600

Could be the same thing as 5711?

By: Russell Bryant (russell) 2005-11-10 18:19:12.000-0600

yes, it's all the same problem.

By: Russell Bryant (russell) 2005-11-10 18:21:27.000-0600

fixed in cvs head

By: vortex_0_o (vortex_0_o) 2005-11-10 20:18:08.000-0600

now with current cvs I get a the error:

"missing closing parenthesis for argument 'D' in string..."

By: Kevin P. Fleming (kpfleming) 2005-11-10 20:22:52.000-0600

Not current enough :-) We are updating CVS HEAD rapidly tonight.

By: Digium Subversion (svnbot) 2008-01-15 15:55:18.000-0600

Repository: asterisk
Revision: 7051

U   trunk/ChangeLog
U   trunk/app.c

------------------------------------------------------------------------
r7051 | russell | 2008-01-15 15:55:17 -0600 (Tue, 15 Jan 2008) | 2 lines

issue ASTERISK-5482, ASTERISK-5562, and probably others

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=7051