[OpenSIPS-Users] How to process destination set (exec_dset)

John Quick John.Quick at smartvox.co.uk
Mon Nov 23 11:38:49 CET 2009


The scenario is this: The route block receives a destination set by calling exec_dset. I then need to
perform further processing on each URI in the set. To be specific, I need to call lookup("location")
in case the destination is a locally registered device so the INVITE will be sent to the right IP and
port and will use the correct sub-route.

The essential parts of the script look like this:
 if (exec_dset("/usr/bin/myapp")) {
   xlog("L_WARN", "New destination set is $ds\n");
 } else {
   log(1, "exec_dset returns error\n");
 }

 if (lookup("location")) {
   xlog("L_WARN","Sending to registered UA at $ru\n");
   route(1);
 } else {
   xlog("L_WARN","Sending to peer $ru\n");
   route(2);
 }



More information about the Users mailing list