[asterisk-dev] Version Dial() comma separation was introduced in?

Mark Michelson mmichelson at digium.com
Mon May 18 13:47:46 CDT 2009


Alistair Cunningham wrote:
> Alistair Cunningham wrote:
>> Tilghman Lesher wrote:
>>> On Monday 18 May 2009 11:33:48 am Alistair Cunningham wrote:
>>>> Does anyone know which stable version(s) of Asterisk introduced using
>>>> commas rather than "|" to separate the arguments for Dial()? I'd like to
>>>> run a diff between it and the previous version.
>>> 1.6.0
>> Thanks, that's what I feared. Looks like I'm going to need to get my 
>> hands dirty rather than using diff.
> 
> The reason I ask is that the parser seems to behave differently between 
> 1.4.21.1 and 1.6.1.0. Here's from 1.6.1.0:
> 
> <SIP/enswitch-local-0826d558>AGI Rx << EXEC Dial 
> SIP/0123456789 at 5-sip.example.com,600,oL(86398000:60000)
>      -- AGI Script Executing Application: (Dial) Options: 
> (SIP/0123456789 at 5-sip.example.com,600,oL(86398000:60000))
>    == Using SIP RTP CoS mark 5
>    == Using UDPTL CoS mark 5
> [May 18 18:03:05] WARNING[24557]: chan_sip.c:4526 create_addr: No such 
> host: 5-sip.example.com,600,ooL(86398000
> [May 18 18:03:05] WARNING[24557]: app_dial.c:1518 dial_exec_full: Unable 
> to create channel of type 'SIP' (cause 20 - Unknown)
>    == Everyone is busy/congested at this time (1:0/0/1)
> 
> With 1.4.21.1, "EXEC Dial 
> SIP/0123456789 at 5-sip.example.com|600|oL(86398000:60000)" worked. The 
> peer does exist:
> 
> mysql> select name from sippeers where name='5-sip.example.com';
> +-------------------+
> | name              |
> +-------------------+
> | 5-sip.example.com |
> +-------------------+
> 1 row in set (0.00 sec)
> 
> Perhaps the allowed characters in a peer name have changed? I'll 
> continue looking at the source for app_dial.c to see if I can spot it.
> 

This looks like the offending code (from handle_exec in res_agi.c):

                 if (*vptr == ',') {
                     *cptr++ = '\\';
                     *cptr++ = ',';
                 } else if (*vptr == '|') {
                     *cptr++ = ',';
                 } else {
                     *cptr++ = *vptr;
                 }

The first if statement will escape any commas it comes across in the options. 
Interestingly, it appears that if you were to use vertical bars as you showed 
with 1.4.21.1, you would likely see a successful operation since they are 
replaced with commas.

Was it intended that AGI commands would still use vertical bars as option 
separators?

Mark Michelson



More information about the asterisk-dev mailing list