Menu

#642 lookup can only be called once

1.8.x
closed-invalid
modules (454)
5
2013-04-19
2013-04-12
Anonymous
No

If you have several contacts for the same user, and if you call lookup twice, then each request will be sent one time to the contact with the highest priority and twice to all other contacts.

If you call it three times, then t_relay will relay the same request three times to all contacts (except the first one).

Most probably opensips maintains an internal linked list with all branches and that list is not reset by lookup.

Discussion

  • Bogdan-Andrei Iancu

    Hi,

    This is not a bug, but rather a misusage of the lookup() function - the function is all the time uploading the contacts for the AOR from RURI. There is no intention (by design) to remove the existing branches - actually I know cases where the script is relying on this behaviour.

    If you call the lookup twice and you want no connection between the 2, simply purge all existing branches before doing the second lookup :
    while ( remove_branch(0) ) {xlog("removing branch");}

    Regards,
    Bogdan

     
  • Bogdan-Andrei Iancu

    • assigned_to: nobody --> bogdan_iancu
    • status: open --> open-invalid
     
  • Bogdan-Andrei Iancu

    • status: open-invalid --> closed-invalid
     

Log in to post a comment.