[Serusers] ser.cfg scripting error
Klaus Darilion
klaus.mailinglists at pernau.at
Tue Jun 21 23:38:32 CEST 2005
You could use t_replicte to keep the current location data in both
ser's. Then, lookup("location") works. (except if the clients are behind
NAT).
regards,
klaus
Jack Wei wrote:
> my setup is 2 ser servers & 1 mysql server. i want to look up a user in table
> "location" to see if one of the two ser servers registered the user, so i've
> decided to follow the example in the admin guide and use exec_dset(). however,
> i'm getting an error output. anyone knows what's wrong with the following?
>
>
> if ( !exec_dset( 'QUERY="select contact from location where
> username=\"$SIP_OUSER\"";
> DEST_URI=`mysql -user -pheslo -h10.1.201.107 -Bs -e"$QUERY"
> ser`;
> if [ -z "$DEST_URI" ] then exit 1 fi;
> echo "$DEST_URI"; echo > /dev/null;' ) )
> {
> xlog("L_INFO", "\n\n%ru is not online (in db)\n");
> sl_send_reply( "404", "User does not exist" );
> break;
> };
>
>
>
>
> the error output is:
>
>
>
>
> sh: -c: line 4: syntax error: unexpected end of file
> 12(14932) ERROR:exec_str: no uri from QUERY="select contact from location where
> username=\"$SIP_OUSER\"";
> DEST_URI=`mysql -user -pheslo -h10.1.201.107 -Bs -e"$QUERY"
> ser`;
> if [ -z "$DEST_URI" ] then exit 1 fi;
> echo "$DEST_URI"; echo > /dev/null;
> sip:12222220002 at 10.1.201.191
> 12(14932)
>
>
>
>
>
> i'm not sure why 'sip:12222220002 at 10.1.201.191' is there, but i think that
> might be part of the problem. when i tried the following:
>
>
>
>
> if ( !exec_dset( 'echo sip:12222220002 at 10.1.201.65; echo > /dev/null' ) )
>
>
>
> it works fine.
>
> Jack Wei
>
>
>
> __________________________________
> Yahoo! Mail Mobile
> Take Yahoo! Mail with you! Check email on your mobile phone.
> http://mobile.yahoo.com/learn/mail
>
> _______________________________________________
> Serusers mailing list
> serusers at lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serusers
>
>
More information about the sr-users
mailing list