Hi Guys,
Need your urgent help.
I need to take different actions based on the content of the NOTIFY
message.(specifically on the basis of whats in "Subscription-State:"
header).
1) if I receive normal notifys with SUBSCRIPTION-state:Active,keep receiving
them.
2) if I receive NOTIFY with subscription terminated, then renew the
subscription(without de-registering the client)
Here is the flow I need,
===============
Register
200 OK
*<label 1 > * # to create a new subscription
SUBSCRIBE (presence)
202 Accepted
*<label 2> * # Basically keep receiving the normal active
state notify and keep responding with 200 OK.
NOTIFY(Subscription-State:active)
200 OK
*<Go to Label :2 >*
NOTIFY(Subscription-State:terminated;reason=deactivated)
200 OK
*<Go to Label :1 >*
======================
This is what I have tried .
REGISTER
200 OK
*<label id="1"/>
*
<send retrans="5000">
<![CDATA[
SUBSCRIBE sip:[fiel...@company.lab;list=rls-services SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
Record-Route: <sip:[fiel...@[local_ip]:[local_port];lr>
Route:[$1]
From: [field0] <sip:[fiel...@company.lab>;tag=[call_number]
To: [field0] <sip:[fiel...@company.lab;list=rls-services>
Call-ID: 1002///[call_id]
CSeq: 20 SUBSCRIBE
Contact: <sip:[fiel...@[local_ip]:[local_port]>
P-Access-Network-Info: N-ACTIVE
P-Visited-Network-Id: company.lab
P-Asserted-Identity: <sip:[fiel...@company.lab>
Accept: message/external-body, application/pidf+xml,
application/rlmi+xml, multipart/related
Max-Forwards: 70
User-Agent: SIPP
Expires: 300
Supported: eventlist
Event: presence
Content-Length: 0
]]>
</send>
<recv response="202" >
</recv>
<label id="2"/>
<recv request="NOTIFY">
<action>
<ereg regexp="terminated;reason=deactivated" search_in="hdr"
header="Subscription-State:" check_it="true" assign_to="3"/>
</action>
</recv>
<send next="1" test="3" >
<![CDATA[
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:[fiel...@[local_ip]:[local_port]>
Content-Length: 0
]]>
</send>
<nop next="2">
</op>
But the problem I am facing is that, once the variable "3" is set ,I can NOT
UNset it.
So when after looping again, it comes back to the same condition, it is
already set ,( irrespective of what is received in the NOTIFY message.)
Ideally , if I could base my the decision on the value of the variable
instead of "making it on the basis of if variable is set or not" , that
would be the best thing. but I cant seem to find any such thing in SIP
reference guide.
Could you guys guide me here?
Thanks a lot in anticipation.
Thanks,
Rajnish
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Sipp-users mailing list
Sipp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sipp-users