[OpenSIPS-Users] multiple subscribers per alias

Erik Dekkers erik.dekkers at wvds.nl
Sun May 29 22:08:43 CEST 2011


Hi Dave,

Sorry for my late response. I see how to do such things. It's clear for me now.
Thank you very very much!

Regards,

Erik 

-----Oorspronkelijk bericht-----
Van: users-bounces at lists.opensips.org [mailto:users-bounces at lists.opensips.org] Namens Dave Singer
Verzonden: Thursday, May 26, 2011 1:59 AM
Aan: OpenSIPS users mailling list
Onderwerp: Re: [OpenSIPS-Users] multiple subscribers per alias

Erik,

Just typed this up so probably has some mistakes. :-) This form pulls all alias db results into an avp which are looped though to do a lookup for each that only a user alias. You could do the append branch mode for alias_db but then lookup would have to be in branch route and Im not sure if branches created by lookup would run through another round of branch route to handle last minute per branch message settings.

So for what it is worth:

  if( alias_db_find("dbaliases" , "$ru", "$avp(s:ru_alias)", "d") {
    $var(append_next) = 0;
    $var(i) = 0;
    while( $(avp(s:ru_alias)[$var(i)]) != null ) {
       if ( $var(append_next) == 1 )
         append_branch();
       else
         $var(append_next) = 1;
       $ru = $(avp(s:ru_alias)[$var(i)]);
       if ( rui == myself ) {
         if ( ! lookup("locaion") )
           # lookup failed
           $var(append_next) = 0;
       }
       $var(i) = $var(i) + 1;
    }
    if ( $var(append_next) == 0 ) {
      # user not registered, sent to VM server or reply not found
      sl_send_reply("404", "User not found");
      exit;
    }
    t_on_branch("branch_changes");
    route("1");
  }
  else
  {
  if ( lookup("location") ) {
     ....

Hope this helps.
Dave

On Wed, May 25, 2011 at 1:17 PM, Erik Dekkers <erik.dekkers at wvds.nl> wrote:
> Hi folks,
>
> I am having trouble finding the best way of solving this situation;
>
> Customer can login via a webinterface to change his/her settings like 
> usernames of sip-accounts, passwords, etc.
> The customer would like to change his/her aliasses too. So they can 
> configure themself wich sip-account(s) should be used for a specifice 
> inbound phonenumber.
>
> In this case it can happen a customer would like to have two sip 
> accounts behind one alias (e.g. phonenumber 12345 let ring phones 
> registered with account sip1 and sip2).
> The most logical way for me is to configure this within the alias_db 
> module, but I can't put in two alias-records with different subscribers.
>
> How should I make this possible without hardcode it in the script?
>
> Kind regards,
>
> Erik Dekkers
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>



--
David Singer

_______________________________________________
Users mailing list
Users at lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



More information about the Users mailing list