我在海鸥直径工作,这是我的海鸥服务器和海鸥客户端的场景
客户端服务器
---- CER ---->
<--- CEA ----
---- AAR ---->
<--- AAA ----
---- STR --->
<--- STA ----
但结果:
Array .reduce()
所以它不符合我的情况,请帮助我如何配置服务器和客户端可以同步?
这是Client Scenario
<?xml version="1.0"?><scenario>
<init>
<send channel="channel-1">
<command name="CER">
</command>
</send>
<receive channel="channel-1">
<command name="CEA"> </command>
</receive>
</init>
<traffic>
<send channel="channel-1">
<command name="AAR">
<avp name="Session-Id" value="trandeptrai"> </avp>
</command>
</send>
<receive channel="channel-1">
<command name="AAA"> </command>
</receive>
<send channel="channel-1">
<command name="STR">
<avp name="Session-Id" value="trandeptrai"> </avp>
</command>
</send>
<receive channel="channel-1">
<command name="STA"> </command>
<action>
<store name="Session-Id" entity="Session-Id"> </store>
</action>
</receive>
</traffic>
</scenario>
客户端配置:
<?xml version="1.0"?>
<configuration name="jpT DIAMETER client">
<define entity="transport" name="trans-ip-v4" file="libtrans_ip.so" create_function="create_cipio_instance" delete_function="delete_cipio_instance" init-args="type=tcp"> </define>
<define entity="channel" name="channel-1" protocol="diameter-v1" transport="trans-ip-v4" open-args="mode=client;dest=134.138.249.41:12340"> </define>
<define entity="traffic-param" name="call-timeout-ms" value="10000"> </define>
<define entity="traffic-param" name="files-no-timestamp" value="true"> </define>
<define entity="traffic-param" name="call-rate" value="1"> </define>
</configuration>
服务器场景:
<?xml version="1.0"?><scenario>
<init>
<receive channel="channel-1">
<action>
</action>
<command name="CER">
</command>
</receive>
<send channel="channel-1">
<command name="CEA"> </command>
<action>
</action>
</send>
</init>
<traffic>
<receive channel="channel-1">
<command name="AAR"> </command>
<action>
<store name="Session-Id" entity="Session-Id"> </store>
</action>
</receive>
<send channel="channel-1">
<action>
<restore name="Session-Id" entity="Session-Id"> </restore>
</action>
<command name="AAA">
<avp name="Session-Id" value="1"> </avp>
</command>
</send>
<receive channel="channel-1">
<command name="STR"> </command>
<action>
<store name="Session-Id2" entity="Session-Id"> </store>
</action>
</receive>
<send channel="channel-1">
<action>
<restore name="Session-Id2" entity="Session-Id"> </restore>
</action>
<command name="STA">
<avp name="Session-Id" value="1"> </avp>
</command>
</send>
<!-- <wait-ms value="100"> </wait-ms> -->
</traffic>
</scenario>
服务器配置:
<?xml version="1.0"?>
<configuration name="jpT DIAMETER client">
<define entity="transport" name="trans-ip-v4" file="libtrans_ip.so" create_function="create_cipio_instance" delete_function="delete_cipio_instance" init-args="type=tcp"> </define>
<define entity="channel" name="channel-1" protocol="diameter-v1" transport="trans-ip-v4" open-args="mode=client;dest=134.138.249.41:12340"> </define>
<define entity="traffic-param" name="call-timeout-ms" value="10000"> </define>
<define entity="traffic-param" name="files-no-timestamp" value="true"> </define>
<define entity="traffic-param" name="call-rate" value="1"> </define>
</configuration>
答案 0 :(得分:2)
E2E和H2H对于发送请求的主机必须是唯一的(答案包含相同的E2E和H2H)。以此官方指南为例(您可以在scenario / sar-saa.client.xml中找到它):
<traffic>
<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>
<inc-counter name="session-counter"> </inc-counter>
<set-value name="HbH-id"
format="$(HbH-counter)"></set-value>
<set-value name="EtE-id"
format="$(EtE-counter)"></set-value>
<set-value name="Session-Id"
format=".;1096298391;$(session-counter)"></set-value>
</action>
<command name="SAR">
<avp name="Session-Id" value="value_is_replaced"> </avp>
<avp name="Vendor-Specific-Application-Id">
<avp name="Vendor-Id" value="11"></avp>
<avp name="Auth-Application-Id" value="167772151"></avp>
<avp name="Acct-Application-Id" value="0"></avp>
</avp>
<avp name="Auth-Session-State" value="1"> </avp>
<avp name="Origin-Host" value="seagull"> </avp>
<avp name="Origin-Realm" value="ims.hpintelco.org"> </avp>
<avp name="Destination-Realm" value="ims.hpintelco.org"> </avp>
<avp name="Server-Name" value="seagull"> </avp>
<avp name="Server-Assignment-Type" value="3"> </avp>
<avp name="User-Data-Request-Type" value="0"> </avp>
<avp name="Public-Identity" value="sip:olivierj@ims.hpintelco.org"> </avp>
<avp name="Destination-Host" value="hss.ims.hpintelco.org"> </avp>
</command>
<action>
<start-timer></start-timer>
</action>
</send>
<receive channel="channel-1">
<action>
<stop-timer></stop-timer>
</action>
<command name="SAA">
</command>
</receive>
</traffic>
action
之前和之后有command
个send SAR
,它们将在<init>
之前和之后运行。现在你的这些条款相同,这会导致“腐败”。并且难以从包捕获中识别/识别,我相信这是他们的序列混乱的原因。这是我使用SEAGULL的经验:
receive
中定义的任何命令只会运行一次。这意味着对于unrecognized xxx
,第二次收到数据包会导致日志received unrecognized CER
。例如,在示例中,如果收到第二个CER,则日志显示为receive
。如果发生这种情况,我通常会重新启动ksh或将traffic
CER放入receive CER
。使用序列运行场景。例如,如果方案按顺序send CEA
receive DWR
send DWA
received unrecognized DWR
定义,则没有CER的DWR将导致send
。当人们查找为什么没有从seagul服务器收到DWA时,这将是最常见的情况。
receive
中定义了init
或data=$(mysql --user=$DB_USER --password=$DB_PASSWD $DB_NAME -se "SELECT * FROM $TABLE WHERE fname='$fname' AND lname='$lname';")
echo "$data"
OUTPUT
Alex George 990070070 alex.george@gmail.com
Desired OUTPUT
Alex George : 990070070 : alex.george@gmail.com
,否则它将继续提及&#34; ping-pong&#34; .` 答案 1 :(得分:1)
您可以尝试将同时呼叫设置为1,这样您的客户端将等到当前呼叫结束以启动另一个呼叫。 将此行添加到您的服务器和客户端配置:
<define entity="traffic-param" name="max-simultaneous-calls" value="1"></define>
此属性的默认值为100,因此肯定是您的捕获显示不匹配的请求和答案的原因。