On Sat, May 16, 2009 at 4:16 AM, Murray Hooper <[email protected]> wrote: > <nop> > <action> > <test assign_to="2" variable="caller" compare="equal" value="486" > /> > </action> > </nop> > > <nop next="busy" test="2" /> > > Ok, I want to run a different send depending on caller. Is there a simpler > way to jump to different labels depending on value of variable? In this > case my nop next="busy" doesn’t seem to work as I have a log message after > it and before "busy" label and it gets logged.
The variable caller contains a string or a number? IIRC, you can only use compare with numeric values. For string comparison you should use strcmp. > > -----Original Message----- > From: mayamatakeshi [mailto:[email protected]] > Sent: Thursday, May 14, 2009 12:00 AM > To: Murray Hooper > Cc: [email protected] > Subject: Re: [Sipp-users] Multiple eregs on single header > > On Thu, May 14, 2009 at 10:04 AM, mayamatakeshi <[email protected]> > wrote: >> On Wed, May 13, 2009 at 9:58 PM, Murray Hooper <[email protected]> > wrote: >>> Hi >>> >>> What is proper way to handle branching on multiple values in same recv? >>> >>> I have >>> < recv request="INVITE" >>> <action> >>> <ereg regexp="486" search_in="hdr" header="To:" assign_to="busy" > >>> </action> >>> </recv> >>> >>> If I want to check for To = 503 and return 503 back does another ereg go > in >>> this INVITE section or do I build another separate the 503? >> >> Hello, >> it seems you want to use the username received as the response code to >> be sent to the client. >> If so, you could capture the username like this: >> >> <ereg regexp="sip:([...@])@" search_in="hdr" header="To:" >> assign_to="whole_thing,username" > > > Well, > actually, it should be: > > <ereg regexp="sip:([...@]+)@" search_in="hdr" header="To:" > assign_to="whole_thing,username" > > >> >> Then you could use username in the response to be sent >> >> <send> >> <![CDATA[ >> >> SIP/2.0 [$username] No No No >> [last_To:] >> [last_From:] >> [last_Call-ID:] >> [last_CSeq:] >> [last_Via:] >> Content-Length: 0 >> >> ]]> >> </send> >> >> Now, you might need to change the Response text to something different >> for each response code. If that's the case, you could get it from an >> injection file. >> >> regards, >> takeshi >> > > > > ------------------------------------------------------------------------------ > Crystal Reports - New Free Runtime and 30 Day Trial > Check out the new simplified licensing option that enables > unlimited royalty-free distribution of the report engine > for externally facing server and web deployment. > http://p.sf.net/sfu/businessobjects > _______________________________________________ > Sipp-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/sipp-users > ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ Sipp-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sipp-users
