How to get sip session?

58 views
Skip to first unread message

Hatke Özlem

unread,
Sep 3, 2012, 7:17:26 AM9/3/12
to mobicent...@googlegroups.com
Hello all,

I am trying to create a sip session between two clients that are using different protocols. One client uses SIP (Client A) and other one uses Restful (Client B). Signalling is shown below. Whenever INVITE message is received, it is converted to CallReceivedEvent for term side. This event includes :
  1. SipApplicationSession ID (used SipApplicationSession->getId() method),
  2. session information of SipServletRequest object (used SipServletRequest ->getSession() method).
  3. SDP of INVITE message.

After that Client B sends AnswerCallEvent to answer call. This event includes:

  1. SipApplicationSession ID (used SipApplicationSession->getId() method),
  2. session information of SipServletRequest object (used SipServletRequest ->getSession() method).
  3. Client B's SDP


Please note that Step 1-2 are same data. It is used to get existing sip session on Application server. AnswerCallEvent is converted to 200 OK SIP response by using this information.

Problem:

The length of data which is conveyed with Step 1-2 is long about 196 chars.

  • Is there a way to minimize it under 100 chars?
  • Is there another way to get sip session on Application Server?
  • Step 1 is created based on CallID header of incoming INVITE message. Step 2 is created by mobicents. Is it possible to get longer data in next releases of mobicents for SipApplicationSession ID? How is it generated?

Signalling is as below:




Thank you,
Hatke

Jean Deruelle

unread,
Sep 5, 2012, 7:11:40 AM9/5/12
to mobicent...@googlegroups.com
Hi,

Please see inline

Jean


On Mon, Sep 3, 2012 at 1:17 PM, Hatke Özlem <hat...@gmail.com> wrote:
Hello all,

I am trying to create a sip session between two clients that are using different protocols. One client uses SIP (Client A) and other one uses Restful (Client B). Signalling is shown below. Whenever INVITE message is received, it is converted to CallReceivedEvent for term side. This event includes :
  1. SipApplicationSession ID (used SipApplicationSession->getId() method),
  2. session information of SipServletRequest object (used SipServletRequest ->getSession() method).
  3. SDP of INVITE message.

After that Client B sends AnswerCallEvent to answer call. This event includes:

  1. SipApplicationSession ID (used SipApplicationSession->getId() method),
  2. session information of SipServletRequest object (used SipServletRequest ->getSession() method).
  3. Client B's SDP


Please note that Step 1-2 are same data. It is used to get existing sip session on Application server. AnswerCallEvent is converted to 200 OK SIP response by using this information.

Problem:

The length of data which is conveyed with Step 1-2 is long about 196 chars.

  • Is there a way to minimize it under 100 chars?
Which data is 196 chars long ? Why is this a problem ?
 
  • Is there another way to get sip session on Application Server?
Show me the code you use ? Why do you need another way to get the sip session ?
 
  • Step 1 is created based on CallID header of incoming INVITE message. Step 2 is created by mobicents. Is it possible to get longer data in next releases of mobicents for SipApplicationSession ID? How is it generated?


Signalling is as below:


You forgot to paste the signalling or attach the file ?
 
 


Thank you,
Hatke


Hatke Özlem

unread,
Sep 6, 2012, 8:45:04 AM9/6/12
to mobicent...@googlegroups.com
Hi Jean,

Sorry i forgot to add signalling. It is attached.

See inline.

On 5 September 2012 14:11, Jean Deruelle <jean.d...@gmail.com> wrote:
Hi,

Please see inline

Jean


On Mon, Sep 3, 2012 at 1:17 PM, Hatke Özlem <hat...@gmail.com> wrote:
Hello all,

I am trying to create a sip session between two clients that are using different protocols. One client uses SIP (Client A) and other one uses Restful (Client B). Signalling is shown below. Whenever INVITE message is received, it is converted to CallReceivedEvent for term side. This event includes :
  1. SipApplicationSession ID (used SipApplicationSession->getId() method),
  2. session information of SipServletRequest object (used SipServletRequest ->getSession() method).
  3. SDP of INVITE message.

After that Client B sends AnswerCallEvent to answer call. This event includes:

  1. SipApplicationSession ID (used SipApplicationSession->getId() method),
  2. session information of SipServletRequest object (used SipServletRequest ->getSession() method).
  3. Client B's SDP


Please note that Step 1-2 are same data. It is used to get existing sip session on Application server. AnswerCallEvent is converted to 200 OK SIP response by using this information.

Problem:

The length of data which is conveyed with Step 1-2 is long about 196 chars.

  • Is there a way to minimize it under 100 chars?
Which data is 196 chars long ? Why is this a problem ?
 Data that i use to get session which is created by invite message is as below:
(a1-1eec-1854-ffffffff:c3f1f36993e734f13d6...@47.168.85.97:102cb364-2d24-47bb-acdb-ba1a98c4963f:base-sipt)$(102cb364-2d24-47bb-acdb-ba1a98c4963f:base-sipt)$base-sipt

$ is separator. Based on that first token is SipSession object, second token is SipApplicationSession object and last one is my servlet name.

It is problem since it is conveyed in Restful URI.

The specs do not impose a maximum length, however HTTP spec raises a warning  that we should be careful not to go beyond 255 characters. According to Hypertext Transfer Protocol – HTTP/1.1 section 3.2:

 

“…Servers ought to be cautious about depending on URI lengths above 255 bytes, because some older client or proxy implementations might not properly support these lengths.”

 
  • Is there another way to get sip session on Application Server?
Show me the code you use ? Why do you need another way to get the sip session ?
I need another way since maybe this data can be longer and i can have bigger value than 255 chars.
Code is:
  public StatusCode sendAnswer(String sipApplicationSessionId, String sessionId, String sdpData) {
      SipApplicationSession appSession = null;
      SipServletRequest req = null;
      SipServletResponse res = null;

      appSession = sipSessionsUtil.getApplicationSessionById(sipApplicationSessionId);
      SipSession sipSession = appSession.getSipSession(sessionId);
      req = (SipServletRequest) sipSession.getAttribute(sessionId);
      res = req.createResponse(SipServletResponse.SC_OK)
      res.setContent(contents, "application/sdp");
      res.send();
      return StatusCode.SC_SUCCESSFUL;
}

 
  • Step 1 is created based on CallID header of incoming INVITE message. Step 2 is created by mobicents. Is it possible to get longer data in next releases of mobicents for SipApplicationSession ID? How is it generated?

Thank you for reference.
untitled.bmp

Jean Deruelle

unread,
Sep 11, 2012, 4:57:48 AM9/11/12
to mobicent...@googlegroups.com
Why don't you use POST instead of GET you wouldn't have this limitation ?

Jean

Hatke Özlem

unread,
Sep 11, 2012, 7:20:42 AM9/11/12
to mobicent...@googlegroups.com
POST and PUT methods are used. Related limitation is applicable for them.

Jean Deruelle

unread,
Sep 11, 2012, 7:51:09 AM9/11/12
to mobicent...@googlegroups.com
Most browsers have a limit of 2048 characters for URL so you should be fine.
If you use POST then don't put those into the URL query parameters but as body of the request, you'll extend your limit to 2GB. 

Jean
Reply all
Reply to author
Forward
0 new messages