'Voice Portal/SIP'에 해당되는 글 13

  1. 2010/04/08 [sip] The main SIP INVITE Header Fields explained(8)
  2. 2010/04/06 [sip] 401 Unauthorized, 200 OK(1)
  3. 2010/04/05 [sip] 401 Unauthorized(3)
  4. 2010/04/03 [sip] SIP method Register(5)
  5. 2010/03/30 [sip] Using Dialog
  6. 2010/03/30 [sip] SipLayer
  7. 2010/03/30 [sip] MessageProcessor
  8. 2010/03/30 [sip] TextClient(4)
  9. 2010/03/22 [sailfin] What is SailFin
  10. 2010/03/09 [sip] SailFin with softphone(2)
2010/04/08 18:31 Voice Portal/SIP
크리에이티브 커먼즈 라이선스
Creative Commons License

흠.. 흠.. 흠..

역시 제가 삽질하나는 잘 하나 봅니다. ㅎ

일단 프로그래밍 잠시 중단하고 공부부터 해야겠습니다.

이거 코딩 하다가 문제가 생겨도 뭐 때문에 그런 것인지 모르겠습니다.


The main SIP INVITE Header Fields explained

내용 출처 : http://www.3cx.com/blog/voip-howto/sip-invite-header-fields/


프로그래밍을 하면서 패킷 캡쳐를 하는데 이거 도대체 어떻게 생겨먹은건지 ㅎ

일단 이것부터 공부해야겠다는 생각이 들더군요.

이미지 출처는 상위 링크.

누가 영어 해석 좀 ㅎ


SIP messages explained.

http://www.3cx.com/blog/voip-howto/sip-messages/


http://www.3cx.com/blog/category/voip-howto/

'Voice Portal > SIP' 카테고리의 다른 글

[sip] The main SIP INVITE Header Fields explained  (8) 2010/04/08
[sip] 401 Unauthorized, 200 OK  (1) 2010/04/06
[sip] 401 Unauthorized  (3) 2010/04/05
[sip] SIP method Register  (5) 2010/04/03
[sip] Using Dialog  (0) 2010/03/30
[sip] SipLayer  (0) 2010/03/30
posted by 조금까칠한남자
2010/04/06 14:43 Voice Portal/SIP
크리에이티브 커먼즈 라이선스
Creative Commons License

우헤헤~ ^________^ 인증 성공했습니다.

흠 기본적인 것부터 안되어 있으니 삽질만 했네요..

SIP의 동작 원리도 알아야 하지만...

REGISTER하는 방법도 알아야 할 것 같네요...

'Voice Portal > SIP' 카테고리의 다른 글

[sip] The main SIP INVITE Header Fields explained  (8) 2010/04/08
[sip] 401 Unauthorized, 200 OK  (1) 2010/04/06
[sip] 401 Unauthorized  (3) 2010/04/05
[sip] SIP method Register  (5) 2010/04/03
[sip] Using Dialog  (0) 2010/03/30
[sip] SipLayer  (0) 2010/03/30
posted by 조금까칠한남자
2010/04/05 15:02 Voice Portal/SIP
크리에이티브 커먼즈 라이선스
Creative Commons License

우헤헤~ 드디어 Sip server로부터 Return값을 받았습니다. ㅠㅠ

비록 401 unauthorized 이지만 많은 발전을 ㅠㅠ

401 unauthorized 는 인증이 되지 않은 유저이기 때문에 그렇습니다.

저희 sip server 사용하려면 비밀번호 입력해야하더라고요...

뭐 오늘의 목표는 return 값 받는 것이므로 오늘 목표 완료!!


오늘은 SDP도 설정해보고 Message header에 제가 만든 header도 넣어봤습니다.

제가 만든 header를 넣으니까 "Unrecognised SIP header" 라고 나오는데.....뭔가 규약이 있는듯...

이 부분은 나중에 차차 공부하고!!

오늘 아직 시간이 많으니까 password 넣고 200ok 받을 때까지 고고싱~

'Voice Portal > SIP' 카테고리의 다른 글

[sip] The main SIP INVITE Header Fields explained  (8) 2010/04/08
[sip] 401 Unauthorized, 200 OK  (1) 2010/04/06
[sip] 401 Unauthorized  (3) 2010/04/05
[sip] SIP method Register  (5) 2010/04/03
[sip] Using Dialog  (0) 2010/03/30
[sip] SipLayer  (0) 2010/03/30
posted by 조금까칠한남자
2010/04/03 17:31 Voice Portal/SIP
크리에이티브 커먼즈 라이선스
Creative Commons License

eyeBeam의 설정 UI를 비슷하게 해서 JAVA Swing으로 구현한 이미지 입니다.




Register 할 때 보내는 패킷을 캡쳐했습니다.

대략 SIP 동작원리는 공부했는데 프로그래밍 하려니 머리가 어질어질하더군요....

역시 대충 공부하면 되는게 없네요 ㅎ

이미지 제일 위에 보면은 REGISTER method를 사용했습니다.

그리고 Message Body에 "Kim TaeJung SIP Phone Registering..." 이라고 넣어두었습니다. 크크  일종의 기념샷(?) ㅎㅎ

근데 중요한것은 200 ok가 안옵니다. ㅋ.ㅋ

문서에 의하면 REGISTER request하면은 200 ok가 와야 하는데 아무런 반응이 없더라고요... 흠흠..

이부분은 좀 더 공부해 봐야할 것 같습니다.

일단 오늘은 주말이니까 REGISTER 보낸 것으로 만족해야겠어요 ㅎ


eyeBeam은 어떻게 동작하나 sip server에 붙여봤는데... SIP protocol이 안 잡히네요... ㅡㅡ^

이거 원... 괜히 붙여봤어~~ 괜히 붙여 봤어~~ 더 머리만 복잡해졌어~



추가내용 :

포스팅을 하고 다시 읽어 보니까 왜 200ok가 안 올지 감이 오네요... ㅠㅠ

일단 테스트 환경을 다 off하였으므로... 나중에 테스트 해보고 다시 올리겠습니다. ㅎ


이거 보니까 감이 오네요 ㅎ

http://www.siptutorial.net/SIP/registration.html

'Voice Portal > SIP' 카테고리의 다른 글

[sip] 401 Unauthorized, 200 OK  (1) 2010/04/06
[sip] 401 Unauthorized  (3) 2010/04/05
[sip] SIP method Register  (5) 2010/04/03
[sip] Using Dialog  (0) 2010/03/30
[sip] SipLayer  (0) 2010/03/30
[sip] MessageProcessor  (0) 2010/03/30
posted by 조금까칠한남자
2010/03/30 22:03 Voice Portal/SIP
크리에이티브 커먼즈 라이선스
Creative Commons License

내용 출처 :

http://www.oracle.com/technology/pub/articles/dev2arch/2007/10/introduction-jain-sip2.html


Sending Messages Inside a Dialog

You're sending our message outside a dialog. That means messages are not related to each other. This works well for a simple instant-messaging application like the TextClient.

An alternative would be to create a dialog (sometimes called a session) using an INVITE message, and then send messages inside this dialog. The TextClient doesn't use this technique. However, I think it's something worth learning. So as a compromise, this subsection describes how it's done.

Sending a message inside a dialog requires the creation of Dialog and Transaction objects. On the initial message (that is, the message that creates the dialog), instead of using the provider to send out the message, you instantiate a Transaction and then get the Dialog from it. You keep the Dialog reference for later. You then use the Transaction to send the message:

ClientTransaction trans = sipProvider.getNewClientTransaction(invite);
dialog = trans.getDialog();
trans.sendRequest();

Later when you wish to send a new message inside the same dialog, you use the Dialog object from before to create a new request. You can then massage the request and, lastly, use the Transaction to send out the message.

request = dialog.createRequest(Request.MESSAGE);

request.setHeader(contactHeader);
request.setContent(message, contentTypeHeader);

ClientTransaction trans = sipProvider.getNewClientTransaction(request);
trans.sendRequest();

Essentially, you're skipping the "create main elements" step when sending a message inside an existing dialog. When you use an INVITE to create a dialog, don't forget to clean it up by sending an in-dialog BYE message at the end. This technique is also used to refresh registrations and subscriptions.

Previously, you've seen the SipListener interface, which contains the processDialogTerminated() and processTransactionTerminated() methods. These are called automatically at the end of a dialog and transaction, respectively. Typically, you implement these methods to clean things up (for example, discard the Dialog and Transaction instances). You'll leave these two methods empty as you don't need them in TextClient.

'Voice Portal > SIP' 카테고리의 다른 글

[sip] 401 Unauthorized  (3) 2010/04/05
[sip] SIP method Register  (5) 2010/04/03
[sip] Using Dialog  (0) 2010/03/30
[sip] SipLayer  (0) 2010/03/30
[sip] MessageProcessor  (0) 2010/03/30
[sip] TextClient  (4) 2010/03/30
posted by 조금까칠한남자
2010/03/30 19:00 Voice Portal/SIP
크리에이티브 커먼즈 라이선스
Creative Commons License

내용출처 :

http://www.oracle.com/technology/pub/articles/dev2arch/2007/10/introduction-jain-sip.html


SIP Stack Preparation

Let's start writing the SipLayer class. TextClient must be able to receive asynchronous messages coming from other SIP end points. The observer pattern is used for this: The class implements the SipListener interface to process incoming messages:

public class SipLayer

    implements SipListener {


The methods of this interface are:

    void processRequest(RequestEvent evt);

    void processResponse(ResponseEvent evt);

    void processTimeout(TimeoutEvent evt);

    void processIOException(IOExceptionEvent evt);

    void processTransactionTerminated(TransactionTerminatedEvent evt);

    void processDialogTerminated(DialogTerminatedEvent evt);


In this example, the most important methods evidently are processRequest() and processResponse() for processing incoming messages. I'll look at those a bit later.

Next are two fields to store objects needed later. These are not directly related to the SIP API, but you'll need them for the example. The first is a MessageProcessor object as discussed before. You also need to keep the username handy. These two fields have getters and setters which, for brevity, I'm not showing in this article.

private MessageProcessor messageProcessor;

private String username;


Next is the constructor. A typical way to start a JAIN SIP API application and TextClient follows this pattern is to set up a bunch of objects that will be useful later on. I'm talking about a number of factories, and a single SIP stack instance, initialized.

private SipStack sipStack;

private SipFactory sipFactory;

private AddressFactory addressFactory;

private HeaderFactory headerFactory;

private MessageFactory messageFactory;

private SipProvider sipProvider;



public SipLayer(String username, String ip, int port) throws

        PeerUnavailableException, TransportNotSupportedException,

        InvalidArgumentException, ObjectInUseException,

        TooManyListenersException {

  setUsername(username);

  sipFactory = SipFactory.getInstance();

  sipFactory.setPathName("gov.nist");

  Properties properties = new Properties();

  properties.setProperty("javax.sip.STACK_NAME", "TextClient");

  properties.setProperty("javax.sip.IP_ADDRESS",  ip);

  sipStack = sipFactory.createSipStack(properties);

  headerFactory = sipFactory.createHeaderFactory();

  addressFactory = sipFactory.createAddressFactory();

  messageFactory = sipFactory.createMessageFactory();

  ...

The SIP factory is used to instantiate a SipStack implementation, but since there could be more than one implementation, you must name the one you want via the setPathName() method. The name "gov.nist" denotes the SIP stack you've got.

The SipStack object takes in a number of properties. At a minimum, you must set the stack name. All other properties are optional. Here I'm setting an IP address to use by the stack, for cases where a single computer has more than one IP address. Note that there are standard properties, which all SIP API implementations must support, and non-standard ones that are dependent on the implementation. See the References section for links to these properties.

The next step is to create a pair of ListeningPoint and SipProvider objects. These objects provide the communication functionality of sending and receiving messages. There's one set of these for TCP and one set for UDP. This is also where you select the SipLayer (this) as a listener of incoming SIP messages:

...

  ListeningPoint tcp = sipStack.createListeningPoint(port, "tcp");

  ListeningPoint udp = sipStack.createListeningPoint(port, "udp");



  sipProvider = sipStack.createSipProvider(tcp);

  sipProvider.addSipListener(this);

  sipProvider = sipStack.createSipProvider(udp);

  sipProvider.addSipListener(this);

}

And this is how the constructor ends. You've just used the JAIN SIP API to create a SipStack instance, a bunch of factories, two ListeningPoints, and a SipProvider. These objects will be needed in the upcoming methods to send and receive messages.

'Voice Portal > SIP' 카테고리의 다른 글

[sip] SIP method Register  (5) 2010/04/03
[sip] Using Dialog  (0) 2010/03/30
[sip] SipLayer  (0) 2010/03/30
[sip] MessageProcessor  (0) 2010/03/30
[sip] TextClient  (4) 2010/03/30
[sailfin] What is SailFin  (0) 2010/03/22
posted by 조금까칠한남자
2010/03/30 18:13 Voice Portal/SIP
크리에이티브 커먼즈 라이선스
Creative Commons License

내용출처 :

http://www.oracle.com/technology/pub/articles/dev2arch/2007/10/introduction-jain-sip.html


Message Processor

To decouple the SIP layer from the GUI layer, you use a callback interface that allows sending information from the former without having to know the signature of the latter. The interface is shown below:

public interface MessageProcessor

{

    public void processMessage(String sender, String message);

    public void processError(String errorMessage);

    public void processInfo(String infoMessage);

}

The SipLayer constructor will take an implementation of this interface (that is, the TextClient object) as a parameter and will hold on to it. Later you'll be able to use this object to send information back to the GUI.

'Voice Portal > SIP' 카테고리의 다른 글

[sip] Using Dialog  (0) 2010/03/30
[sip] SipLayer  (0) 2010/03/30
[sip] MessageProcessor  (0) 2010/03/30
[sip] TextClient  (4) 2010/03/30
[sailfin] What is SailFin  (0) 2010/03/22
[sip] SailFin with softphone  (2) 2010/03/09
posted by 조금까칠한남자
2010/03/30 17:19 Voice Portal/SIP
크리에이티브 커먼즈 라이선스
Creative Commons License

SIP를 이용한 TEXT Client 실행 완료.

흠... 그냥 누가 만들어 놓은 TextClient라는 sample 프로그램을 실행하기는 했는데...

이게 도대체 어떻게 돌아가는지는 잘 모르겠군요 :")


Manual에는 TextClient소스를 다운 받으라고 되어 있는데... 소스가 없어서 구글링으로 이곳 저곳에서 모아서~!!!!

실행 완료했습니다.


이제 소스를 분석하면서 공부를 해야겠습니다.


요새 신규 프로젝트 업무 회의에...

기존 프로젝트 유지 보수...

Case open한거 진행하랴...

다른 팀으로 전배가시는 분 사이트 백업 받느랴....

이거 공부하랴... (지금 바쁜척 하고 있는 중 >_< ㅋㅋㅋ)


암튼 뭔가 하나씩 되어가니 기쁘군요 :")

'Voice Portal > SIP' 카테고리의 다른 글

[sip] SipLayer  (0) 2010/03/30
[sip] MessageProcessor  (0) 2010/03/30
[sip] TextClient  (4) 2010/03/30
[sailfin] What is SailFin  (0) 2010/03/22
[sip] SailFin with softphone  (2) 2010/03/09
[sip] JSR 116, JSR 289 SIP Servlet 1.1 Final Release  (0) 2010/03/09
posted by 조금까칠한남자
2010/03/22 18:43 Voice Portal/SIP
크리에이티브 커먼즈 라이선스
Creative Commons License
What is SailFin?

SailFin is a java.net project. The goal of the project is to develop a container for SIP Servlets, similar to a HTTP servlet container, that:

1. implements JSR-289,
2. interoperates with the other containers and services in the GlassFish server, and
3. leverages the infrastructure of the GlassFish server for high availability and clustering.

Where does the name "SailFin" come from?

"SailFin" is a variety of fish that is sail-like finned.

Why would someone use SailFin?

if you are developing a next generation telecommunication service, SIP Servlets are going to play a bigger part in that.

So, SailFin is a natural choice. By combining SIP Servlets and Java EE, you can add rich media interactions to enterprise applications.

SailFin supports high availability and load balancing of converged HTTP and SIP applications.

It augments the current GlassFish administration capabilities to SIP and Converged Applications.

So, you get "all of GlassFish", plus a highly available Sip Servlet Container.

'Voice Portal > SIP' 카테고리의 다른 글

[sip] MessageProcessor  (0) 2010/03/30
[sip] TextClient  (4) 2010/03/30
[sailfin] What is SailFin  (0) 2010/03/22
[sip] SailFin with softphone  (2) 2010/03/09
[sip] JSR 116, JSR 289 SIP Servlet 1.1 Final Release  (0) 2010/03/09
[voip] SIP workbench - SIP 전용 메시지 분석툴  (2) 2010/03/04
posted by 조금까칠한남자
2010/03/09 12:18 Voice Portal/SIP
크리에이티브 커먼즈 라이선스
Creative Commons License




SailFin 설치 후, softphone 등록 성공.

이제 슬슬 뭔가가 그려지는 듯합니다.

예전 SailFin을 이용하려고 했을 때는 안되서 고생을 했는데 ㅠㅠ

점점 더 재미있어지는군요 ㅎ

'Voice Portal > SIP' 카테고리의 다른 글

[sip] TextClient  (4) 2010/03/30
[sailfin] What is SailFin  (0) 2010/03/22
[sip] SailFin with softphone  (2) 2010/03/09
[sip] JSR 116, JSR 289 SIP Servlet 1.1 Final Release  (0) 2010/03/09
[voip] SIP workbench - SIP 전용 메시지 분석툴  (2) 2010/03/04
[voip] sip DTMF 전송방식  (3) 2010/02/26
posted by 조금까칠한남자
prev 1 2 next