Hi,

I found my mistake.

I was using regex for *header *inside the <nop>, I guess it can be used
only in recv or send operation. However, I am not getting the regex
correct. I'll try it.

Thanks & Regards,
Suryaveer Singh Chauhan

On 18 October 2016 at 19:01, Suryaveer Chauhan <chauhan.suryav...@gmail.com>
wrote:

> Hi Pavel,
>
> Thanks for this. This is working but I have a problem still. I am not able
> to use regex.
>
> I tried hard-coding the values as below and that worked:
>
>
> *<nop hide="true" condexec="setdest_done" condexec_inverse="true">*
> *   <action>*
>
> *      <assignstr assign_to="host" value="172.17.0.4" />*
> *      <assignstr assign_to="port" value="5060" />*
> *      <assignstr assign_to="transport" value="UDP" />*
> *      <setdest host="[$host]" port="[$port]" protocol="[$transport]" />*
> *      <assignstr assign_to="setdest_done" value="any_string" />*
> *   </action>*
> *</nop>*
>
> But whenever I try any regex as simple as (.*) or even the ones given in
> the manual I get a segmentation fault.
>
> This is what I tried:
> <?xml version="1.0" encoding="UTF-8"?>
> <nop>
>    <action>
>       <ereg regexp=".*" search_in="hdr" header="Contact:" check_it="true"
> assign_to="1" />
>       <log message="Contact is [$1]." />
>       <ereg regexp=".*" search_in="hdr" header="Via:" check_it="true"
> assign_to="1" />
>       <log message="Via is [$1]." />
>       <ereg regexp="(.*)" search_in="hdr" header="Via:" check_it="false"
> assign_to="host" />
>       <log message="Via is [$host]." />
>       <ereg regexp=".* ([0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3});.*"
> search_in="hdr" header="Via: " check_it="false" assign_to="host" />
>       <log message="Host is [$host]." />
>    </action>
> </nop>
> <Reference variables="host" />
>
> I am not able to figure out what's the problem.
>
> Thanks & Regards,
> Suryaveer Singh Chauhan
>
> On 18 October 2016 at 04:16, sindelka <sinde...@ttc.cz> wrote:
>
>> Hi Suryaveer,
>>
>> I understand that the reponse is sent to the via header address and the
>> via on NOTIFY msg is of the presence server then why the response is
>> sent to dispatcher?
>>
>> Your understanding is correct in terms what RFC3261 requires. However,
>> SIPp does not follow these rules automatically - after all, it is a test
>> tool, so you want to be able to test various "what if this is incorrect"
>> scenarios.
>>
>> Therefore, SIPp sends all messages of a given call to the same IP address
>> and port until you use the <setdest> action to change that for that
>> particular call. The initial values common for all calls are given at the
>> command line.
>>
>> So before sending the first 200 to the NOTIFY, you have to use <setdest>
>> to change the peer's address and port. The manual recommends not to use
>> <setdest> too often because it is a resource-expensive operation, so I
>> would do something like
>>
>> <nop hide="true" condexec="setdest_done" condexec_inverse="true">
>>   <action>
>>     <setdest host="[$host]" port="[$port]" protocol="[$transport]"/>
>>     <assignstr assign_to="setdest_done" value="any_string" />
>>   </action>
>> </nop>
>>
>> between receiving the NOTIFY (from which you may eventually extract the
>> host and port using <ereg> necessary) and sending the 200 to it.
>>
>> P.
>>
>> Dne 18.10.2016 v 7:22 Suryaveer Chauhan napsal(a):
>>
>> Hi,
>>
>> I have  a simple presence test setup as below:
>>
>> Sipp --> opensips_dispatcher --> opensips_presence_server
>>
>>
>> The SUBSCRIBE request and its 200 response pass thru dispatcher while the
>> NOTIFY goes directly to the Sipp.
>>
>> The problem is, the 200 OK response to NOTIFY is sent to dispatcher
>> instead of the presence server, the dispatcher rejects the response as it
>> does not finds any transaction for it.
>>
>> I understand that the reponse is sent to the via header address and the
>> via on NOTIFY msg is of the presence server then  why the response is sent
>> to dispatcher?
>>
>> Below is the command I used:
>>
>> *./sipp 172.17.0.6 -sf ../SubscribeNotify.xml -m 1 -i 172.17.0.5*
>>
>> and the used scenario file:
>>
>> ------------------------------------------------------------
>> -------------------------------------
>> <?xml version="1.0" encoding="ISO-8859-1" ?>
>> <scenario name="subscribe">
>>   <send start_rtd="1">
>>     <![CDATA[
>>       SUBSCRIBE sip:[service]-[call_number]@opensipstest.org SIP/2.0
>>       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch
>> =[branch];rport
>>       Max-Forwards: 20
>>       From: <sip:[service]@opensipstest.org>;tag=[call_number]
>>       To: <sip:[service]-[call_number]@opensipstest.org:[remote_port]>
>>       Call-ID: [call_id]
>>       CSeq: 1 SUBSCRIBE
>>       Contact: <sip:[service]@[local_ip]:[loc
>> al_port];transport=[transport]>
>>       Expires: 3600
>>       Accept: multipart/related, application/rlmi+xml,
>> application/pidf+xml
>>       Event: presence
>>       Content-Length: 0
>>       User-Agent: Sipp v1.1-TLS, version 20061124
>>       Supporte: path
>>     ]]>
>>   </send>
>>
>>   <recv response="200">
>>   </recv>
>>
>>   <recv request="NOTIFY" rtd="1">
>>   </recv>
>>
>>   <send crlf="true">
>>     <![CDATA[
>>       SIP/2.0 200 OK
>>       [last_Via:]
>>       [last_From:]
>>       [last_To:]
>>       [last_Call-ID:]
>>       [last_CSeq:]
>>       User-Agent: Sipp v1.1-TLS, version 20061124
>>       Content-Length: 0
>>     ]]>
>>   </send>
>> <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 200"/>
>> ------------------------------------------------------------
>> -------------------------------------
>>
>>
>> If required I can provide pcap too.
>> Please help me understand the issue.
>>
>> Thanks & Regards,
>> Suryaveer Singh Chauhan
>>
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>>
>>
>>
>> _______________________________________________
>> Sipp-users mailing 
>> listSipp-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/sipp-users
>>
>>
>>
>> ------------------------------------------------------------
>> ------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Sipp-users mailing list
>> Sipp-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/sipp-users
>>
>>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Sipp-users mailing list
Sipp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sipp-users

Reply via email to