Module: sip-router
Branch: kamailio_3.0
Commit: ce764c910789bdc977452895c9faaeea7cb8078f
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ce764c910789bdc977452895c9faaeea7cb8078f

Author: Andrei Pelinescu-Onciul <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date:   Sat Oct 31 10:27:43 2009 +0100

core: append_branch() sets also the send_socket, path & flags

- the script append_branch() sets also the new branch send_socket
 (if forced), path vector and branch flags, making it more
 compatible with the kamailio version.

Reported-by: Juha Heinanen  jh at tutpro com
(cherry picked from commit 394e061f8c582a4e146603934ef101f3bcd479db)

---

 action.c |    9 +++++----
 route.c  |   11 +++++++++++
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/action.c b/action.c
index 1694419..b8256a7 100644
--- a/action.c
+++ b/action.c
@@ -339,15 +339,16 @@ int do_action(struct run_act_ctx* h, struct action* a, 
struct sip_msg* msg)
 
                /* jku -- introduce a new branch */
                case APPEND_BRANCH_T:
-                       if ((a->val[0].type!=STRING_ST)) {
+                       if (unlikely(a->val[0].type!=STR_ST)) {
                                LOG(L_CRIT, "BUG: do_action: bad 
append_branch_t %d\n",
                                        a->val[0].type );
                                ret=E_BUG;
                                goto error;
                        }
-                       ret=ser_append_branch( msg, a->val[0].u.string,
-                                          a->val[0].u.string ? 
strlen(a->val[0].u.string):0,
-                                          0, 0, a->val[1].u.number, 0);
+                       getbflagsval(0, (flag_t*)&flags);
+                       ret=append_branch(msg, &a->val[0].u.str, &msg->dst_uri,
+                                                               &msg->path_vec, 
a->val[1].u.number,
+                                                               (flag_t)flags, 
msg->force_send_socket);
                        break;
 
                /* jku begin: is_length_greater_than */
diff --git a/route.c b/route.c
index fc25c64..8d6f2c6 100644
--- a/route.c
+++ b/route.c
@@ -976,6 +976,17 @@ int fix_actions(struct action* a)
                                                                        
(unsigned int)t->val[0].u.number);
                                }
                                break;
+                       case APPEND_BRANCH_T:
+                               if (t->val[0].type!=STRING_ST){
+                                       BUG("invalid subtype%d for 
append_branch_t\n",
+                                                               t->val[0].type);
+                                       return E_BUG;
+                               }
+                               s.s=t->val[0].u.string;
+                               s.len=(s.s)?strlen(s.s):0;
+                               t->val[0].u.str=s;
+                               t->val[0].type=STR_ST;
+                               break;
                        default:
                                /* no fixup required for the rest */
                                break;


_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to