-->
🏠 🔍
SHAREOLITE

SOLVED - Seagull - How to use restore-from-external for dynamic import

In this post we share how to use Seagull restore-from-external feature which is useful in using values from a external source when used in scenarios.

Say for example if we need to import session ID and IP from a CSV file and use it in a Diameter scenario , below steps to be followed

Step1 : Create a  CSV file in the below template

"string"; "string";
# FIELD 0  ; FIELD 1
"0x09070101" ; "1235676777" ;
"0x09070102" ; "1235676778 ;
"0x09010103" ; "1235676779" ;

Above CSV file has 3 records . Field 0 for IP and Field 1 for Session ID values . Note the datatype and comment to be included in the CSV file


Step 2 : Include the CSV file destination path in seagull configuration file

In the seagull config directory under the specific protocol , add below entry

<define entity="traffic-param" name="external-data-file" value="/opt/seagull/diameter/scenario/test.csv"></define>

Step 3 : Include restore-from-external in scenario file

 <send channel="channel-1">
            <action>
              <!-- For each new call, increment the session-ID counter-->
              <inc-counter name="HbH-counter"> </inc-counter>
              <inc-counter name="EtE-counter"> </inc-counter>

             <restore-from-external field="0" entity="Session-Id"> </restore-from-external> 

             <restore-from-external field="1" entity="IP"> </restore-from-external> 

Above entries indicate that Session ID field is to be imported  from file from column field 0 , IP is to be imported from file from column field 1 . When the scenario is executed the records are read one by one from the file.


 

Hope this post is useful for those in need.

Comments

–>