[Serusers] route to PSTN

Tobias Lindgren tobias.lindgren at ip-only.se
Tue Mar 14 19:48:21 CET 2006


I'm far from an expert myselfe, but here goes.. (inlined in your text..):

Br,
/T

McAvan, Troy-P29897 said the following on 2006-03-14 19:32:
> Would it be possible for someone to explain what each line means?
> if(method=="INVITE")
- If the SIP request method is an "INVITE", proceed with the code
between { and }.
> {
>    if(uri =~ "^sip9.*@.*")
- If the URI-field in the SIP request starts with and is like
<sip9><anything>@<anything> proceed.
>    {
>         rewritehostport("ipofmediatrix:port");
- Rewrite the host and port part of the SIP uri, eg. this is what I
would like to do to for example forward this INVITE to another destination.
>         if(!t_relay())
- Relay the message to the new destination specified with
rewritehostport(). Remember this SIP-conversation and statefully
inspection of all the following messages (transactions) following this
INVITE (read more about t_relay in the "tm"-module README-file). If
there is an error in any of the following transactions (eg. a 404 Not
Found SIP message), proceed with this code snippet.
>         {
>             sl_reply_error();
- Replay statelessly with the errormessage found in t_relay (in my
example, 404 Not Found).
>         };
>     };
> };  
> 
> I am not a software guy and it would be great if someone could explain it line by line possibly.
> 
> Troy
> 
> _______________________________________________
> Serusers mailing list
> serusers at lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serusers




More information about the sr-users mailing list