[OpenSER-Users] manipulate INVITES

Patrick Miccio patrick.miccio at upc.at
Fri Jun 29 17:43:20 CEST 2007


Hi Andreas,

what you explained sounds like my solution No.2 (correct me if I am
wrong), which is not working, OpenSer makes the userloc check right
before relaying the call, if you replace the user part of the R-URI it
will try to find the extension ;0)

It feels like for that solution one has to work with the location table,
fill it dynamically for each call, or fill in advance with known
extensions by copying the basenumber location...

Also using domains in register and location is a must in this case to
differentiate between extensions (ext. 200 could be at multiple
locations) , but I don't want to transform OpenSER in a PBX.

cheers,

Patrick.

> Patrick,
> 
> You don't want to alter the To header. Extract the extension from the 
> R-URI and save it into an AVP (or var if >= 1.2) , then do a lookup
> with the resulting R-RUI (user-part without extension), and if it's 
> successful, replace the user-part with the extension saved in the
> AVP/var.
> 
> Cheers,
> Andreas
> 
> Patrick Miccio wrote:
> > Hello everybody,
> > 
> > since this is my first post and I am kinda new to OpenSER, bare with
> > me ;)
> > 
> > I have been trying to manipulate invites for the last 2 days and
> > cant find the proper way to reach what is expected.
> > 
> > my goal:
> > send invites to specific PBX (Asterisk for example) with only the
> > desired extension and not the full username, this is based on a
> > avp_check if that UAC needs only extensions, some do, some don't ;)
> > 
> > 
> > Here is what I do:
> > First off all I extract the real username (in subscribers) and
> > extension from the R-URI and place it in "$avp(callee_user)" and
> > "$avp(callee_exten)"
> > 
> > #############
> > my solution No1 is "working"
> > 
> >  avp_pushto("$ru/username", "$avp(callee_user)");
> >  avp_copy("$avp(callee_exten)","$avp(callee_tmp)/gd");
> >  if( subst('/^To:(.*)sip:[^@]*(@[a-zA-Z0-9.]+.*)$/To:\1sip:$avp(callee_tmp)\2/ig') ){};
> > 
> > ->	callee_user is 012345678
> > ->	callee_exten is 200
> > ->	$ru is sip:012345678 at xxx.xxx.xxx.xxx;user=phone
> > ->	subst [ To:
> > <sip:012345678200 at xxx.xxx.xxx.xxx;user=phone> ] with [To:
> > <sip:200 at xxx.xxx.xxx.xxx;user=phone> ]
> > 
> > Those 3 lines work "fine", the testing Asterisk PBX gets the call
> > correctly. The problem is that I should not change the "To:" part,
> > it will make problems with call forwards etc...
> > 
> > 
> > #############
> > my solution No.2 NOT working.
> > 
> > if
> > (subst_uri('/^sip:([0-9]+)@(.*)$/sip:$avp(callee_tmp)@\2;/i')){$};
> > 
> > doesn't work because OpenSER of course cant find 200 in the
> > userloc....
> > 
> > #############
> > 
> > Generally I would think that changing the INVITE uri itself like in
> > solution No.2 is the best way, couldn't find any proper way to make
> > that work though.
> > 
> > Does anyone have an idea how to realize this properly, or even if
> > this makes sense ;) ?
> > 
> > thx in advance,
> > 
> > Patrick.
> > 
> > _______________________________________________
> > Users mailing list
> > Users at openser.org
> > http://openser.org/cgi-bin/mailman/listinfo/users






More information about the sr-users mailing list