[Serusers] route to PSTN

McAvan, Troy-P29897 Troy.McAvan at gdc4s.com
Tue Mar 14 19:52:38 CET 2006


Tobias,
	Thank you for your time and explanation. For =~  what does this mean? Does the = means something particular, and then does the ~ means something particular as well? Also one last thing, what does the ^ mean?

Thanks again,
Troy

-----Original Message-----
From: Tobias Lindgren [mailto:tobias.lindgren at ip-only.se]
Sent: Tuesday, March 14, 2006 11:48 AM
To: McAvan, Troy-P29897
Cc: serusers at lists.iptel.org
Subject: Re: [Serusers] route to PSTN


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