No subject


Fri Jul 16 17:26:04 CEST 2010


specification in front of the variable name -
http://www.opensips.org/Resources/DocsCoreVar. By default the message
that you have access to in failure route is the request.

To send the Invite to another destination just set the $du and do
t_relay().



Regards,

-- 
Anca Vamanu
www.voice-system.ro








On 10/05/2010 01:12 PM, Najib Hara wrote:

  Hi,

  

Probably , the best way is to use 302 replies, but I'm still looking
for a way to collect the data from these replies (or from 600 errors).
Is there a function or a module who can handle it ?

I also need to get my INVITEs back so I could insert the collected data
in their bodies.  I know that The TM module can duplicate SIP messages
in memory, but how to deal with 2 messages at the same time ? 

As a memo, here are the steps:

  
    send the received INVITE to a server
    get a 302 reply from the server with data on the body
    collect the data from the 302 reply
    insert data on the INVITE
    resend it to the initial destination
  
  

Thanks

  

  From: lebron_najib at hotmail.com

To: users at lists.opensips.org

Date: Fri, 1 Oct 2010 13:24:07 +0000

Subject: Re: [OpenSIPS-Users] Adding data to a request before relaying
it

  

  
  
  
Thank you Anca, I'm working on it and I'll post the specific part of
the routing logic as soon as finished.

  

  From: lebron_najib at hotmail.com

To: users at lists.opensips.org

Subject: Adding data to a request before relaying it

Date: Fri, 1 Oct 2010 08:55:05 +0000

  

  
Hi everybody,

  

I'm a newer in the OpenSIPS world and I'm trying to learn how to use it
efficiently.

I'm working on a project where I have to modify incoming requests
before relaying them to their first destination.

By modifying, I mean sending those requests to a server which will send
back messages with the additional data to implement in the requests.

The next step is to collect those informations from the responses and
add them to the initial requests which will be relayed to their initial
destination.

My question is: is OpenSIPS capable of doing this ?

  

For more detail, here is a scheme.

  

Thank you in advance for your responses

  

_______________________________________________
Users mailing list
Users at lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
  
_______________________________________________
Users mailing list
Users at lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
  




_______________________________________________
Users mailing list
Users at lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users 		 	   		  

_______________________________________________
Users mailing list
Users at lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users 		 	   		  
--_f64d2161-cd1c-4a34-a71c-062fc7773402_
Content-Type: text/html; charset="windows-1256"
Content-Transfer-Encoding: 8bit

<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Hi everyone,<br><br>Here is the routing logic that I did to implement this type of scenario, but I have some remarks and I would like to share it with you so I can have your opinion:<br>I used the 380 reply (Alternative Service) instead of the 6xx replies because OpenSIPS seems like it can't resend my INVITE after receiving this type of replies.<br>Here is the errors in the log file:<br><br><blockquote>ERROR:tm:t_forward_nonack: discarding fwd for a cancelled/6xx transaction<br>ERROR:tm:w_t_relay: t_forward_nonack failed<br></blockquote><br>What do you think about those errors? And how could I use the 6xx replies (a 603 reply for example) to get my data and resend my INVITE ?<br><br>Here is my routing logic (with 380 replies):<br><br><blockquote>####### Routing Logic ########<br><br><br># main request routing logic<br><br>route{<br>&nbsp;&nbsp;&nbsp; if (!mf_process_maxfwd_header("10")) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sl_send_reply("483","Too Many Hops");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; exit;<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; if(is_method("INVITE")) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if($rU=='1000') {&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; t_relay("x.x.x.x:5060"); # sending the INVITE to a SIP server who answer with a 380 reply<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; t_on_failure("1");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; exit;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; else {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; route(1);<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br>failure_route[1] {<br>&nbsp;&nbsp;&nbsp; if(t_check_status("380")) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xlog("$(&lt;reply&gt;hdr(via)[*])\r\n");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xlog("$(&lt;reply&gt;hdr(From)[*])\r\n");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xlog("$(&lt;reply&gt;hdr(To)[*])\r\n");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xlog("$(&lt;reply&gt;hdr(Call-ID)[*])\r\n");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xlog("$(&lt;reply&gt;hdr(CSeq)[*])\r\n");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xlog("$(&lt;reply&gt;hdr(Contact)[*])\r\n");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xlog("$(&lt;reply&gt;hdr(Error-Info)[*])\r\n");<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; append_hf("Error-Info: $(&lt;reply&gt;hdr(Error-Info)[*])\r\n");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; t_relay();<br>&nbsp;&nbsp;&nbsp; &nbsp; <br>&nbsp;&nbsp;&nbsp; }<br>}<br>route[1] {<br>&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; if (!t_relay()) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sl_reply_error();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; exit;<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br></blockquote><br><br><hr id="stopSpelling">From: lebron_najib at hotmail.com<br>To: users at lists.opensips.org<br>Date: Tue, 5 Oct 2010 13:54:57 +0000<br>Subject: Re: [OpenSIPS-Users] Adding data to a request before relaying it<br><br>

<meta http-equiv="Content-Type" content="text/html; charset=unicode">
<meta name="Generator" content="Microsoft SafeHTML">
<style>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Tahoma;}

</style>




<style>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Tahoma;}

</style>
Hi Anca,<br><br>Thank you for your quick response. It would be great if you can give me your opinion on the routing logic that I made to respond to this type of scenario:<br><br>---<br>loadmodule "tm.so"<br>loadmodule "textops.so"<br>...<br>---<br>route{<br>&nbsp;&nbsp;&nbsp; if(is_method("INVITE")) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; t_relay("tcp:server_adress:5060");<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; t_on_failure("1");<br>&nbsp;&nbsp;&nbsp; }<br>}<br>failure_route[1] {<br>&nbsp;&nbsp;&nbsp; if(t_check_status("600") {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; add_body("$&lt;reply&gt;rb)", "Data");<br># this function adds a body to a message or replace it if existing, but I'm not sure I can use a pseudo-variable as a parameter<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $(&lt;request&gt;rb) = $(&lt;reply&gt;rb);<br># another possibility and again I'm not sure that those are R/W variables<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; t_relay();<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br><hr id="ecxstopSpelling">Date: Tue, 5 Oct 2010 14:28:54 +0300<br>From: anca at opensips.org<br>To: users at lists.opensips.org<br>Subject: Re: [OpenSIPS-Users] Adding data to a request before relaying it<br><br>




  
  <title>Message body</title>


Hi Najib,<br>
<br>


More information about the Users mailing list