Merge branch 'master' into script_callbacks
authorMiklos Tirpak <miklos@iptel.org>
Thu, 4 Jun 2009 07:35:00 +0000 (09:35 +0200)
committerMiklos Tirpak <miklos@iptel.org>
Thu, 4 Jun 2009 07:35:00 +0000 (09:35 +0200)
* master:
  route_type: branch and onsend route bugs corrected
  * Commented out warning about deprecated avp name syntax.  I suggest to
  sl(k) - use load_tm_api()
  * modules_k/textops
  core: added km_parse_avp_spec()
  pv: parse K-style AVP aliases
  docbook: Generate TOC for root-level section elements
  make: required version is now 3.81
  test: gcc version test scripts
  tm: doc - added note about tmx module
  pua: use load_tm_api() instead of find_export()/load_tm()
  kex: added K pv_printf() function
  kex: added K dst uri related functions
  makefile: fix last commit
  * modules_k/acc: included Makefile.radius
  makefile: gcc version detection fix

Conflicts:

onsend.h

1  2 
modules/tm/t_fwd.c
modules_k/sl/sl.c
onsend.h

@@@ -191,15 -190,14 +192,17 @@@ static char *print_uac_request( struct 
  
        if (unlikely(branch_route)) {
                     /* run branch_route actions if provided */
+               backup_route_type = get_route_type();
                set_route_type(BRANCH_ROUTE);
                tm_ctx_set_branch_index(branch+1);
 -              if (run_top_route(branch_rt.rlist[branch_route], i_req) < 0) {
 -                      LOG(L_ERR, "ERROR: print_uac_request: Error in run_top_route\n");
 -              }
 +              if (exec_pre_script_cb(i_req, BRANCH_CB_TYPE)>0) {
 +                      if (run_top_route(branch_rt.rlist[branch_route], i_req) < 0) {
 +                              LOG(L_ERR, "ERROR: print_uac_request: Error in run_top_route\n");
 +                      }
 +                      exec_post_script_cb(i_req, BRANCH_CB_TYPE);
 +              }               
                tm_ctx_set_branch_index(0);
+               set_route_type(backup_route_type);
        }
  
        /* run the specific callbacks for this transaction */
Simple merge
diff --cc onsend.h
+++ b/onsend.h
@@@ -70,14 -69,11 +71,16 @@@ static inline int run_onsend(struct sip
                onsnd_info.buf=buf;
                onsnd_info.len=len;
                p_onsend=&onsnd_info;
+               backup_route_type=get_route_type();
                set_route_type(ONSEND_ROUTE);
 -              init_run_actions_ctx(&ra_ctx);
 -              ret=run_actions(&ra_ctx, onsend_rt.rlist[DEFAULT_RT], orig_msg);
 +              if (exec_pre_script_cb(orig_msg, ONSEND_CB_TYPE)>0) {
 +                      init_run_actions_ctx(&ra_ctx);
 +                      ret=run_actions(&ra_ctx, onsend_rt.rlist[DEFAULT_RT], orig_msg);
 +                      exec_post_script_cb(orig_msg, ONSEND_CB_TYPE);
 +              } else {
 +                      ret=0; /* drop the message */
 +              }
+               set_route_type(backup_route_type);
                p_onsend=0; /* reset it */
        }
        return ret;