[Asterisk-Dev] app_valetparking bugs

Yifang Dai daiy.akx at yarde.com
Wed Oct 6 17:19:56 MST 2004


Hi, I've started using app_valetparking, and found two bugs, both are
related to 

static int ast_valetparking(struct ast_channel *chan, void *data)

1. when assign appname, the ValetUnparkCall should be assigned when
there's already somecall parked in exten,lotname

- appname = ast_is_valetparked(exten,lotname) ? "ValetParkCall" : "ValetUnparkCall";
+ appname = ast_is_valetparked(exten,lotname) ? "ValetUnparkCall" : "ValetParkCall";

2. When appname is 'ValetUnparkCall', then the call to pbx_exec(chan,app,data,1) 
will have data in the format of

'<exten>|<lotname>|<timeout>[|<return_ext>][|<return_pri>][|<return_context>]

while in function

static int valetunpark_call(struct ast_channel *chan, void *data)

lotname get assigned <lotname>|<timeout>[|<return_ext>][|<return_pri>][|<return_context>]

To fix this, I've added these lines... 

        if((lotname=strchr(exten,'|'))) {
                *lotname = '\0';
                *lotname++;
+                /* find the next | and put a '\0' there */
+                if((junk=strchr(lotname,'|'))) {
+                        *junk = '\0';
+                }
        }

 
These two changes appear to make app_valetparking work as described...

-- 
Yifang Dai
Senior System Administrator
Yarde Metals Inc
45 Newell St, Southington, CT 06010
(Phone) 860-406-6107; (FAX) 860-406-4060



More information about the asterisk-dev mailing list