[Serusers] sems voicemail: t_relay / t_newtran and socket closing problem
Stefan Sayer
sayer at fokus.fraunhofer.de
Thu Jun 9 23:55:34 CEST 2005
Hello,
there are two options:
1) use a dedicated instance of ser on another port that writes all
requests directly to sems; forward calls via t_relay_to_udp
2) set user_prefix_separator=+ in sems.conf, then sems will reply with
a contact in the form of voicemail+<user>@host which you can then filter
in your ser.cfg. have a look at docs/ directory in sems
http://cvs.berlios.de/cgi-bin/viewcvs.cgi/sems/answer_machine/docs/
Stefan
Dennis Real wrote:
> Hi,
>
> I have a strange problem with stateful processing using t_relay and t_newtran.
> For normal routing I use t_relay but all sems modules require the usage of
> t_newtran, e.g.:
>
> if ( !t_newtran() )
> {
> sl_reply_error();
> };
> t_write_unix("/tmp/am_sock", "voicemail");
>
> The problem now is how to handle BYE and CANCEL messages for deestablishing
> connections. For the echo server (reachable at 4242 at 192.168.11.1) I use the
> following code for getting back transaction and closing socket to sems:
>
> if ( uri=~"^sip:4242@" && ( method=="BYE" || method=="CANCEL" ) )
> {
> if (!t_newtran())
> {
> sl_send_reply("500", "could not create transaction");
> break;
> };
>
> if( !t_write_unix("/tmp/am_sock", "bye") )
> {
> t_reply("500", "error contacting sems");
> };
>
> break;
>
> }
>
> This works fine. But how can I do this for voicemail? The uri will not be
> changed so I can't destinguish between BYE for a normal and a voicemail
> connection.
>
> All other destinations do not use t_newtran (and no socket to sems) so simply
> t_relay is used for BYE and CANCEL messages.
>
> The whole ser.cfg is attached below.
>
> Regards and thanks for your help,
> Dennis
>
>
More information about the sr-users
mailing list