isc.c File Reference


Detailed Description

IMS Service Control - ISC Interface communication.

Author:
Dragos Vingarzan vingarzan -at- fokus dot fraunhofer dot de

Definition in file isc.c.

#include "../tm/tm_load.h"
#include "../../dset.h"
#include "isc.h"
#include "mod.h"
#include "mark.h"
#include "sip.h"
#include "../scscf/scscf_load.h"
#include "../../timer.h"

Go to the source code of this file.

Functions

int isc_forward (struct sip_msg *msg, isc_match *m, isc_mark *mark)
 Forwards the message to the application server.

Variables

tm_binds isc_tmb
 < link to the stateless reply function in sl module Structure with pointers to tm funcs
str isc_my_uri
 Uri of myself to loop the message in str.
str isc_my_uri_sip
 Uri of myself to loop the message in str with leading "sip:".
int isc_fr_timeout
 default ISC response timeout in ms
int isc_fr_inv_timeout
 default ISC INVITE response timeout in ms


Function Documentation

int isc_forward ( struct sip_msg *  msg,
isc_match m,
isc_mark mark 
)

Forwards the message to the application server.

Definition at line 84 of file isc.c.

References cscf_get_transaction(), isc_fr_inv_timeout, isc_fr_timeout, isc_mark_set(), ISC_RETURN_ERROR, ISC_RETURN_TRUE, isc_tmb, M_NAME, and isc_match::server_name.

Referenced by ISC_match_filter().

00085 {
00086     struct cell *t;
00087     unsigned int hash,label;
00088     ticks_t fr_timeout,fr_inv_timeout;
00089     DBG( "DEBUG:"M_NAME":isc_forward(): marking for AS <%.*s>\n",
00090         m->server_name.len, m->server_name.s );
00091 
00092     isc_mark_set(msg,m,mark);
00093     /* change destination so it forwards to the app server */
00094     if (msg->dst_uri.s) pkg_free(msg->dst_uri.s);
00095     msg->dst_uri.s = pkg_malloc(m->server_name.len);
00096     if (!msg->dst_uri.s) {
00097         LOG(L_ERR,"ERR:"M_NAME":isc_forward(): error allocating %d bytes\n",m->server_name.len);
00098         return ISC_RETURN_ERROR;
00099     }
00100     msg->dst_uri.len = m->server_name.len;
00101     memcpy(msg->dst_uri.s,m->server_name.s,m->server_name.len);
00102 
00103     /* append branch if last trigger failed */
00104     if (*isc_tmb.route_mode == MODE_ONFAILURE) 
00105         append_branch(msg,msg->first_line.u.request.uri.s,msg->first_line.u.request.uri.len,
00106             msg->dst_uri.s,msg->dst_uri.len,0,0);
00107     
00108     /* set the timeout timers to a lower value */
00109     cscf_get_transaction(msg,&hash,&label);
00110     t = isc_tmb.t_gett();
00111     fr_timeout = t->fr_timeout;
00112     fr_inv_timeout = t->fr_inv_timeout;
00113     t->fr_timeout=S_TO_TICKS(isc_fr_timeout)/1000;
00114     t->fr_inv_timeout=S_TO_TICKS(isc_fr_inv_timeout)/1000;
00115     
00116     /* send it */
00117     isc_tmb.t_relay(msg,0,0);
00118     
00119     /* recover the timeouts */
00120     t->fr_timeout=fr_timeout;
00121     t->fr_inv_timeout=fr_inv_timeout;
00122     
00123     LOG(L_INFO,"INFO:"M_NAME">>       msg was fwded to AS\n");
00124     
00125 //  LOG(L_INFO,"INFO:"M_NAME":isc_forward:   fw relayed with marking [%8X]\n",rc->mark.cnt);
00126 //  DBG( "DEBUG:"M_NAME":isc_forward: Forward sending finished, resuming operation\n" );
00127     return ISC_RETURN_TRUE;
00128 }


Variable Documentation

struct tm_binds isc_tmb

< link to the stateless reply function in sl module Structure with pointers to tm funcs

Definition at line 110 of file mod.c.

str isc_my_uri

Uri of myself to loop the message in str.

Definition at line 92 of file mod.c.

Referenced by isc_init(), isc_mark_get_from_msg(), and isc_mark_set().

str isc_my_uri_sip

Uri of myself to loop the message in str with leading "sip:".

Definition at line 93 of file mod.c.

Referenced by isc_init(), isc_third_party_reg(), and r_send_third_party_reg().

int isc_fr_timeout

default ISC response timeout in ms

Definition at line 94 of file mod.c.

Referenced by isc_forward().

int isc_fr_inv_timeout

default ISC INVITE response timeout in ms

Definition at line 95 of file mod.c.

Referenced by isc_forward().


Generated on Thu Oct 23 04:14:41 2008 for Open IMS Core CSCFs by  doxygen 1.5.2