[OpenSER-Users] Preserving original number when using alias_db_lookup

Iñaki Baz Castillo ibc at in.ilimit.es
Mon Jun 30 09:53:46 CEST 2008


El Monday 30 June 2008 03:16:30 Stagg Shelton escribió:
> Also,  the other reason why I want to do this is because I have many
> hundreds of DIDs that are assigned to many asterisk PBX's.  I am
> thinking that having asterisk register to OpenSER and then have the
> DIDs as aliases to the registration credentials would be easy because
> it's all contained in the database.

Asterisk allows just one registration to a server. If you have two incoming 
DID's then it's better if your Asterisk matches the "To" header.

In fact, I don't like using the "To" header for this purpose since it can be 
different if it comes from a SIP already diverted call (so "To" is no one of 
your DID's but the original destination has forwarded the call to some of 
your DID's). 

What I do is the following:

- When my OpenSer receives an incoming call from PSTN I convert the RURI to 
E164 format:
  RURI:
  0034999000111 -> E164 = +34999000111
  999000111 -> E164 = +34999000111

- Then I add a header to the INVITE:
  append_hf("X-E164-Called: $rU");

- Then I do the db_aliases to get the AoR of the local user associated to that 
E164 number.
  RURI:
  +34999000111 -> sip:user01 at mydomain.com

- And later a lookup in 'locaiton' table to get the real location of the 
registered user.
  RURI:
  sip:user01 at mydomain.com -> sip:s at IP_ASTERISK

- After that I just do the "t_relay" to send the INVITE.

- When it arrives to Asterisk it must check the header "X-E164-Called" to know 
which DID was called.


Regards.



-- 
Iñaki Baz Castillo
ibc at in.ilimit.es




More information about the Users mailing list