[Serusers] About exec_dset()

chungyu chungyu at ms11.voip.edu.tw
Mon Jun 4 12:35:55 CEST 2007


Dear SIP:
    Thank your reply for my question. I modify my shell script and run the 
script alone.
It can work

My shell script:

num=Bob at test.org
if [ -z "$num" ]
then
echo "$*"
else
echo $num
fi

When I call Alice at test1.org then request uri will change to Bob at test.org.
But  still did not work.
Thank your response

Chungyu


> That script a) has syntax errors, and b) doesn't make any sense.
>
> Have you run the script alone? The line:
> if[! -z "$num" ]
> needs a space before the !
>
> Also, logically, I don't get what you're trying to do. Currently, your
> script checks to see if $num has a value. If it DOES, then it echoes
> back the script arguments. If not, it echoes back sip:$num.... which
> doesn't make a bit of sense. You set $num in the beginning, so it ALWAYS
> has a value... so it's always going to echo back the script arguments.
> And if, for some strange reason, it DIDN'T have a value, why would you
> want to echo back a non-value?
>
> I don't get it.
>
>
> chungyu wrote:
>> Dear all:
>> I want to change the content of request uri. I use this function
>> ,exec_dset(), to change it.
>> This is my configuration:
>> if (!lookup("location")) {
>> exec_dset("/usr/local/etc/openser/shell/sh1");
>> #sl_send_reply("404", "Not Found");
>> exit;
>> };
>> shell scrip: sh1
>> #!/bin/sh
>> num=200 at xx.xx.xx.xx <mailto:num=200 at xx.xx.xx.xx>
>> if [! -z "$num" ]
>> then
>> echo "$*"
>> else
>> echo "sip:$num"
>> fi
>>
>> but it doesn't work.
>> error message:
>> ERROR:exec_str: no uri from /usr/local/etc/openser/shell/sh1
>> XX at xx.xx.xx <mailto:XX at xx.xx.xx>.....
>> Can somebody tell me what's wrong with my shell script.
>> Thank you for your response
>> chungyu
>> 2007/06/4
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Serusers mailing list
>> Serusers at lists.iptel.org
>> http://lists.iptel.org/mailman/listinfo/serusers
>>
>
> 




More information about the sr-users mailing list