[OpenSER-Devel] openserctl ping
Edson
4lists at gmail.com
Fri Aug 24 22:51:34 CEST 2007
Juha,
If I take the script:
#/bin/sh
myhost="sip.test.name"
CMD="t_uac_dlg OPTIONS \"$1\" \".\" \".\" \"From:
sip:daemon@$myhost\"$\r\n\"To: <$1>\"$\r\n\"Contact: sip:daemon@!!>\"$\r\n"
echo -ne "$CMD" > /tmp/cmd
hexdump -c /tmp/cmd
echo -e "\n---------------------------\n"
CTLCMD="echo -en"
RET="$($CTLCMD $CMD)"
echo $RET
And run it:
teste edson
I got this output:
0000000 t _ u a c _ d l g O P T I O N
0000010 S " e d s o n @ c l i e n t .
0000020 d o m a i n " " . " " . "
0000030 " F r o m : s i p : d a e m o
0000040 n @ s i p . t e s t . n a m e "
0000050 $ \r \n " T o : < e d s o n @ c
0000060 l i e n t . d o m a i n > " $ \r
0000070 \n " C o n t a c t : s i p : d
0000080 a e m o n @ ! ! > " $ \r \n
000008d
---------------------------
t_uac_dlg OPTIONS "edson at client.domain" "." "." "From:
sip:daemon at sip.test.name"$
"To: <edson at client.domain>"$
"Contact: sip:daemon@!!>"$
Is this the desired output?
Edson.
>-----Original Message-----
>From: Juha Heinanen [mailto:jh at tutpro.com]
>Sent: sexta-feira, 24 de agosto de 2007 17:09
>To: Edson
>Cc: daniel at voice-system.ro; devel at openser.org
>Subject: RE: [OpenSER-Devel] openserctl ping
>
>
> > I have a closer look on the command string and finded that many '\'
>where
> > missed.
> >
> > If What You want is to send a string like:
> >
> > t_uac_dlg OPTIONS "" "." "." "From: sip:daemon@"$'\r\n'"To:
> > <>"$'\r\n'"Contact: sip:daemon@!!>"$'\r\n'
> >
> > Then You should change it's definition to:
> >
> > CMD="t_uac_dlg OPTIONS \"$1\" \".\" \".\" \"From:
> > sip:daemon@$myhost\"$'\r\n'\"To: <$1>\"$'\r\n'\"Contact:
> > sip:daemon@!!>\"$'\r\n'"
> >
> > And not:
> >
> > CMD="t_uac_dlg OPTIONS \"$1\" \".\" \".\" \"From:
> > sip:daemon@$myhost"$'\r\n'"To: <$1>"$'\r\n'"Contact:
>sip:daemon@!!>"$'\r\n'
>
>edson,
>
>i noticed too that there some errors in the CMD that i sent to the list,
>but i had fixed them. in the tests i have used this:
>
> CMD="t_uac_dlg OPTIONS \"$1\" \".\" \".\" \"From:
>sip:daemon@$myhost"$'\r\n'"To: <$1>"$'\r\n'"Contact:
>sip:daemon@!!>"$'\r\n'"\""
>
>that results in exactly correct /tmp/cmd:
>
>taimen:~# hexdump -c /tmp/cmd
>0000000 t _ u a c _ d l g O P T I O N
>0000010 S " s i p : j h @ t e s t . f
>0000020 i " " . " " . " " F r o m
>0000030 : s i p : d a e m o n @ t a i
>0000040 m e n \r \n T o : < s i p : j h
>0000050 @ t e s t . f i > \r \n C o n t a
>0000060 c t : s i p : d a e m o n @ !
>0000070 ! > \r \n "
>
>what you suggest in above results in /tmp/cmd:
>
>taimen:~# hexdump -c /tmp/cmd
>0000000 t _ u a c _ d l g O P T I O N
>0000010 S " s i p : j h @ t e s t . f
>0000020 i " " . " " . " " F r o m
>0000030 : s i p : d a e m o n @ t a i
>0000040 m e n " $ ' \ r \ n ' " T o :
>0000050 < s i p : j h @ t e s t . f i >
>0000060 " $ ' \ r \ n ' " C o n t a c t
>0000070 : s i p : d a e m o n @ ! ! >
>0000080 " $ ' \ r \ n '
>
>and
>
>openserctl ping sip:jh at test.fi
>
>never returns.
>
>-- juha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://openser.org/pipermail/devel/attachments/20070824/0dba157c/attachment-0001.htm
More information about the Devel
mailing list