[Devel] Question about TM transactions and stored UAS/UAC in TM
cells
Eliot Gable
egable at broadvox.net
Thu Dec 21 00:50:28 CET 2006
Given the TM cell:
typedef struct cell
{
struct cell* next_cell;
struct cell* prev_cell;
unsigned int hash_index;
unsigned int label;
unsigned int flags;
volatile unsigned int ref_count;
str from, callid, cseq_n, to;
str method;
struct tmcb_head_list tmcb_hl;
struct timer_link wait_tl;
struct timer_link dele_tl;
int first_branch;
int nr_of_outgoings;
int relaied_reply_branch;
struct ua_server uas;
struct ua_client uac[ MAX_BRANCHES ];
ser_lock_t reply_mutex;
unsigned int on_negative;
unsigned int on_reply;
unsigned int on_branch;
char md5[MD5_LEN];
#ifdef EXTRA_DEBUG
short damocles;
#endif
struct totag_elem *fwded_totags;
struct usr_avp *user_avps;
}cell_type;
And given the tmcb_params structure:
struct tmcb_params {
struct sip_msg* req;
struct sip_msg* rpl;
int code;
void **param;
void *extra1;
void *extra2;
};
And a callback function which receives the cell and tmcb_params
structure:
void my_tmcb_func( struct cell* t, int type, struct tmcb_params *ps )
{
...
}
Could someone explain how I access the correct UAC from t->uac[] for the
current branch?
Also, if I want to force the ANI to be a specific number going out the
UAC side, how would I make that alteration to the outgoing packet given
the ua_client_type structure:
typedef struct ua_client
{
struct retr_buf request;
struct retr_buf local_cancel;
str uri;
struct sip_msg *reply;
short last_received;
short flags;
int br_flags;
}ua_client_type;
If I modify the ANI in the UAC, will it keep that ANI for that call leg
for the remainder of the transaction?
Will updating the ANI in the UAC affect the ANI in the UAS for responses
back to the UAC that originally sent the request?
For instance:
Source OpenSER Destination
-------------
UAC --INVITE --> | UAS | UAC | UAS
-------------
-------------
UAC <--100 Trying -- | UAS | UAC | UAS
-------------
-------------
UAC | UAS | UAC | --INVITE --> UAS
-------------
-------------
UAC | UAS | UAC | <--100 Trying -- UAS
-------------
-------------
UAC | UAS | UAC | <--180 Ringing-- UAS
-------------
-------------
UAC <--180 Ringing-- | UAS | UAC | UAS
-------------
The invite from the source UAC comes into OpenSER UAS with ANI
1234567890. The 100 Trying comes from OpenSER UAS back to source UAC
with same number. The invite from OpenSER UAC goes out to destination
UAS with ANI 0987654321. The 100 Trying and 180 Ringing from destination
UAS come back with same number. The 100 Ringing goes out OpenSER UAS
with ANI back to 1234567890.
So, essentially, I need to be able to modify the From field associated
with the UAC so that the new ANI is present instead of the original one.
I need it to last for the entire transaction and be persistent even for
locally generated ACKs (for instance, an ACK to a 503 from destination
UAS).
How would I modify the contents of the cell to accomplish this?
Thanks in advance for any assistance. It is very much appreciated.
Eliot Gable
Operations Engineer
CCNA, CWNA, CWSP, Network+, Security+
Broadvox, LLC
1228 Euclid Avenue
Suite 390
Cleveland, OH 44115-1800
216-373-4808
More information about the Devel
mailing list