×
Namespaces

Variants
Actions

Creating new SIP profile programmatically

From Nokia Developer Wiki
Jump to: navigation, search


Article Metadata
Tested with
Devices(s): N85, N96, N97, Nokia 5800 XpressMusic
Compatibility
Platform(s): S60 3rd Edition FP2
S60 5th Edition
Article
Keywords: SIP, SIP profile
Created: juhanak (23 Jun 2009)
Last edited: hamishwillee (30 May 2013)

Overview

This snippet demonstrates how to create new SIP Profile using CSIPManagedProfileRegistry and CSIPManagedProfile classes. Snippet requires WriteDeviceData NetworkServices capabilities. Self-signing is not possible because of required capabilities.

MMP file

CAPABILITY WriteDeviceData NetworkServices

LIBRARY sipprofilecli.lib

Source file

#include <sipmanagedprofile.h>
#include <sipmanagedprofileregistry.h>
CSIPManagedProfileRegistry *profRegistry = CSIPManagedProfileRegistry::NewLC(*this);
 
TSIPProfileTypeInfo info;
info.iSIPProfileClass = TSIPProfileTypeInfo::EInternet;
info.iSIPProfileName = KSIPIETFProfileType;
 
//Instantiates new profile with default values
CSIPManagedProfile *profile = profRegistry->CreateL(info);
CleanupStack::PushL(profile);
 
//General SIP profile settings
profile->SetParameter(KSIPProviderName,_L8("Provider"));
profile->SetParameter(KSIPAccessPointId,2);
profile->SetParameter(KSIPSigComp,EFalse);
profile->SetParameter(KSIPSecurityNegotiation,EFalse);
profile->SetParameter(KSIPUserAor,_L8("user@example.com"));
profile->SetParameter(KSIPAutoRegistration,EWhenNeeded);
profile->SetParameter(KSIPDefaultProfile,ETrue);
 
//Registrar settings
profile->SetParameter(KSIPRegistrar,KSIPServerAddress,_L8("sip:example.com"));
profile->SetParameter(KSIPRegistrar,KSIPDigestUserName,_L8("username"));
profile->SetParameter(KSIPRegistrar,KSIPDigestRealm,_L8("realm"));
profile->SetParameter(KSIPRegistrar,KSIPDigestPassword,_L8("password"));
 
//Proxy settings
profile->SetParameter(KSIPOutboundProxy,KSIPServerAddress,_L8("sip:example.com;lr;transport=TCP"));
profile->SetParameter(KSIPOutboundProxy,KSIPDigestUserName,_L8("username"));
profile->SetParameter(KSIPOutboundProxy,KSIPDigestRealm,_L8("realm"));
profile->SetParameter(KSIPOutboundProxy,KSIPDigestPassword,_L8("password"));
 
profRegistry->SaveL(*profile);
CleanupStack::PopAndDestroy(2);

Postconditions

New SIP profile called Provider is added to the SIP profile registry. Existing SIP profiles can be found from:

 Settings > Connection > SIP Settings
This page was last modified on 30 May 2013, at 07:37.
56 page views in the last 30 days.