Return to LanScape's home page Go back a page...       Active TopicsActive Topics   Display List of Forum MembersMember List   Knowledge Base SearchSearch   HelpHelp  RegisterRegister  LoginLogin

LanScape VOIP Media Engine™ - Pre-Sales Technical Support
 LanScape Support Forum -> LanScape VOIP Media Engine™ - Pre-Sales Technical Support
Subject Topic: Sip Proxy Application + media engine authentication Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
zhuyin
Intermediate
Intermediate


Joined: December 11 2007
Location: Singapore
Posts: 10
Posted: December 11 2007 at 11:14pm | IP Logged Quote zhuyin

Dear Support,

We are going to use LanScape Media Engine to build the prepaid control applicaiton based on the SIP Porxy Model. The call flow is as follow:

Device 1 (Make Call) -> My Application -> Telephony Gateway -> Device 2 (Receive Call)

The My Application portion need to perform following functions:

1. Authentication;
2. Not allow call when authentication fail
3. Terminate Call by application when "connected" status;
4. Disconnect the call by application when "connecting" status;

May I know which events & commands I need to use for the above four functions?

Thank you very much.
Back to Top View zhuyin's Profile Search for other posts by zhuyin
 
support
Administrator
Administrator


Joined: January 26 2005
Location: United States
Posts: 1666
Posted: December 12 2007 at 7:22am | IP Logged Quote support

Hi zhuyin,

Thanks for your post to this forum. The Software Developer’s reference for the VOIP Media Engine should have all the information you need. Please get familiar with this document as much as possible. If there are any omissions in the developer’s reference, please let us know.

Note: Items appearing below that are in bold text can be found in the software developer’s reference.


Item 1: Authentication – The basics

Authentication can be separated into two groups – incoming and outgoing authentication. MD5 digest authentication is supported by the media engine. Incoming authentication may seem complicated but it really is not.

Incoming authentication:
Your voip application can use the media engine to challenge SIP devices so that they authenticate with your media engine developed VOIP “server” application. In other words, all SIP messages received by your media engine VOIP application can be challenged.

1)
To allow the media engine to challenge incoming SIP messages, you must call the SetChallengeAuthenticationState() API procedure to enable incoming SIP message challenges. Do this sometime after starting the media engine and before you expect your first SIP messages to be received.

2)
Once you call the SetChallengeAuthenticationState() API procedure, you will receive the SipIncomingAuthentication immediate event in your main media engine event handler any time a new SIP message is received.

3)
When the SipIncomingAuthentication event is sent to your application, you will get the address of a CHALLENGE_AUTHENTICATION structure. This structure contains information that relates to the incoming SIP message. The first time a SIP message is received (that needs to be challenged) the “Operation” member of the CHALLENGE_AUTHENTICATION structure will be set to AUTHENTICATE_INCOMING_MESSAGE. The media engine basically is telling your application that it needs your applications input to determine if the incoming (received) SIP message should be challenged. If your application wants to challenge the SIP message, it must set the ChallengeMode member of the CHALLENGE_AUTHENTICATION structure to either CHALLENGE_MODE_WWW_AUTHENTICATE or CHALLENGE_MODE_PROXY_AUTHENTICATE. Because your VOIP application is a server type application, you should set the CHALLENGE_MODE_PROXY_AUTHENTICATE value. Once you set the above value, allow the main event handler to return to the media engine. The media engine will then send a challenge to the far end SIP device.

4)
Assuming the far end SIP device responds to the previous challenge, it will send another SIP message – but this time the SIP message will contain authentication credentials.

5)
Your VOIP application will again receive the SipIncomingAuthentication immediate event in your main media engine event handler and the address of the CHALLENGE_AUTHENTICATION structure. The “Operation” member of the structure will be set to AUTHENTICATE_VERIFY_CREDENTIALS. The media engine basically is telling you that it has received a challenge response and needs your voip application to verify the authentication credentials that the far end SIP device has offered.

6)
To verify the challenge credentials, your voip application should use the hChallenge handle value in the challenge structure and call the VerifyChallengeResponse() API procedure. This API procedure will do all the dirty work of computing and comparing the MD5 digest values. If the VerifyChallengeResponse() API procedure returns SipSuccess, then the SIP message has been authenticated and your application should set the AuthorizationGranted member of the CHALLENGE_AUTHENTICATION structure to TRUE (non zero) and allow the media engine event handler to return.

At this point the incoming Sip message has been fully authenticated.



Outgoing authentication:
Outgoing authentication for your VOIP application in much simpler. When your media engine based voip application send SIP messages, they may be challenged by other receiving SIP network elements.

To allow your voip application to automatically respond to outgoing SIP message challenges, your voip application needs to call the AddAuthorizationCredentials() API procedure. This procedure can be called any number of times to allow the media engine to handle all outgoing SIP message challenges automatically.


Item 2: Not allowing a call when authentication fails
Not exactly sure what you are asking here. Your server voip application should only continue a “call” if authentication succeeds. If your SIP end points do not authenticate properly with your media engine voip application, your application should not continue with its normal call handling logic.

Item 3 + 4:
Please be more specific. We are not sure what you are asking.

Thanks,


Support
Back to Top View support's Profile Search for other posts by support Visit support's Homepage
 
zhuyin
Intermediate
Intermediate


Joined: December 11 2007
Location: Singapore
Posts: 10
Posted: December 12 2007 at 9:38pm | IP Logged Quote zhuyin

Dear Support,

Thank you very much for your kindly reply. We greatly appreciate your timely help.

I think I know how to do with Item 2 now.

Item 3: Terminate Call by application when "connected" status

Our application is a prepaid billing system, so when amount is used up, we need to terminate the call even the call is still connected. I saw the TerminateCall procedure in the reference document. We only need this procedure to terminate the concurrent call or we need any other procedures?

Item 4: Disconnect the call by application when "connecting" status

We only allow customer to call certain countries, so we design a rate plan. If customer calls a country not in the rate plan, the application will disconnect the call. The logic is as below

1. Customer makes a call;
2. Device successfully authenticates with username & password;
3. Device sends the destination number to application;
4. Application try to match the destination number with country codes in the rate plan;
5.1. If the destination is a given country, applicaiton returns the event handle to Media Engine;
(Question: Shall application calls any other procedure (eg. MakeCall) to continue the call flow, or we only need to return the event handle and let Media Engine handle the rest?)
5.2. If the destination is not a given country, application needs to stop the call at this stage, the call will not be connected.
(Question: I am not sure which procedure I shall use for item 5.2. May I use TerminateCall proceudre at this stage? If can, I need to call TerminateCall procedure before I return the event handle, will system accept?)
Back to Top View zhuyin's Profile Search for other posts by zhuyin
 
support
Administrator
Administrator


Joined: January 26 2005
Location: United States
Posts: 1666
Posted: December 13 2007 at 6:41am | IP Logged Quote support

Hi zhuyin,

Item 3: Terminate Call by application when "connected" status
Yes. Jus call the TerminateCall() API procedure.

For step 5.1 in your description, it should read:
If the destination is a given country, application will make the call by calling the VOIP Media Engine MakeCall() or MakeCallUri() API procedures.

For step 5.2 in your description:
Simply call TerinateCall() API procedure on the incoming call.


Make sure to look at the C++ sample applications that come with the product. From those samples you should be able to figure out all that you need in order to develop your calling platform/application.

If you want or need us to help you design or possibly assist with your development, then we need to get you into a paid support contract.

Thanks,

Support
Back to Top View support's Profile Search for other posts by support Visit support's Homepage
 
zhuyin
Intermediate
Intermediate


Joined: December 11 2007
Location: Singapore
Posts: 10
Posted: December 13 2007 at 11:56pm | IP Logged Quote zhuyin

Dear Support,

Thank you very much for your prompt reply.
Back to Top View zhuyin's Profile Search for other posts by zhuyin
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum






Contact LanScape Hear what the Lawyers have to say How youm may use this site Read your privacy rights