Things hard and not so hard.... RSS 2.0
# Tuesday, September 22, 2009

I thought I’d share a few interesting SAP tales.

I’ve been working on a project lately of integrating with not 1 SAP Server, but 2 and the 2nd one is across the seas accessible via a SAP Router (which is similar to Proxy Servers for the internet). I’ve got to thank Rohit Singh (MS) and his team for some great feedback, as well as Scotty and Kent Weare whom were helping me to nut out where half these settings go.

Specifically I needed BTS to be a ‘remote RFC server’ for the two SAP Servers.

What does a Router string look like I hear you ask - “/H/devapp1/S/3300/H/acmesaprouter.acme/S/3300/H/sapdb01.acme”. Something like that, and the user’s type this into the SAP Client UI to connect…my chances of being able to ‘stick’ this somewhere in the BizTalk world was diminishing.

So I had to get my BizTalk box to talk through the ‘SAP Router’ out with the right credentials to another SAP Server 1200KMs away…”good luck” little adapter I thought. ("good luck” Mick I though too)

Here’s the low down:

  1. Use a saprfc.ini file – scarce documentation, but do able.
  2. Set a RFC_INI System Environment variable.
  3. Turn on Rfc Tracing
  4. Get on well with the SAP teams.
  5. Get on well with the SAP teams…oh I mentioned that one already.

Here’s how you do it – after you’ve installed and setup the prereqs for the SAP Adapter (don’t forget to add the SAP Adapter property schema to BizTalk)

Starting out:

- I jumped in and used the 'Consume Service Adapter' Wizard to work out connection details and look at the IDOCs schemas.

The problem is - as time goes by, you want to see debugging and other details to tweak as trying to establish a connection. The Receive Location (WCF-Custom, sapBinding) SAP URI get's horribly long.

 

I was happy to put up with this when I got the first connection to the SAP Server1 (local).

 

This *didn't* work for SAP Server2(remote) - trust me, it's a square peg in a round hole.

 

Using SAPRFC.INI :(generally the MS Docs will get you started, but I found they had incomplete settings so I had to go elsewhere - a Siebel->SAP 2001 document served the purpose)

  1. Create a System Environment Variable called RFC_INI  and point it to where you want your saprfc.ini file to live.
    e.g. SET RFC_INI=d:\BizTalk_Dev\SAP\saprfc.ini
    (the MS documentation doesn't say *exactly* where to put the saprfc.ini - I tried it in the bts folder, windir...many places)
  2. Set the Receive Location to use the saprfc.ini - e.g. sap://client=110;lang=en;@D/SAPSERVER?LISTENERDEST=BTS_INBOUND&RfcTraceSdk=true
  3. Using the SAPRFC.INI file

Sample SAPRFC.INI - for local SAP connection

DEST=SAPSERVER
TYPE=A
ASHOST=DEVAPP1
GWHOST=DEVDB1
GWSERV=sapgw00
SYSNR=00
RFC_TRACE=0
ABAP_DEBUG=0
USE_SAPGUI=0

DEST=BTS_INBOUND
TYPE=R
GWHOST=DEVDB1
GWSERV=sapgw00
PROGID=BizTalkDev_Inbound  (<-- this is allocated from SAP)
SYSNR=00
RFC_TRACE=0
ABAP_DEBUG=0
USE_SAPGUI=0

Connecting to a SAP Server via a SAP Router String - sample saprfc.ini
e.g. router string -/H/devapp1/S/3300/H/acmesaprouter.acme/S/3300/H/sapdb01.acme

ListenerURI (BTS Receive Location) = sap://client=110;lang=en;@D/ACMESAP?LISTENERDEST=ACMESAP_INBOUND&RfcTraceSdk=true

DEST=ACMESAP
TYPE=A
ASHOST=/H/devapp1/S/3300/H/acmesaprouter.acme/S/3300/H/sapdb01.acme
GWHOST/H/devapp1/S/3300/H/acmesaprouter.acme/S/3300/H/sapdb01.acme

GWSERV=sapgw00
SYSNR=00
RFC_TRACE=0
ABAP_DEBUG=0

DEST=ACMESAP_INBOUND
TYPE=R
GWSERV=sapgw00
GWHOST=/H/devapp1/S/3300/H/acmesaprouter.acme/S/3300/H/sapdb01.acme
PROGID=BizTalkDev2_Inbound
SYSNR=00
RFC_TRACE=0
ABAP_DEBUG=0

 

 

HTH folks and saves you guys some time - :)

Tuesday, September 22, 2009 9:42:18 PM (AUS Eastern Standard Time, UTC+10:00)  #    Comments [2] -
2009 | BizTalk Adapter Pack | SAP
# Sunday, September 20, 2009

Hi folks, came across a great article that talks about WebServices(WCF Services) and Security.

The most common starting point in improving security, is to use TLS (Transport Layer Security of which SSL is a subset). I once spent 9 months working out digital signatures and passing several documents through out of band of envelopes…long story.

There’s a whole bunch of How-To’s also – very good!

With over 26000 downloads since August 1, I think this is a much needed area.
Well done guys – big congrats for your efforts.

Enjoy -

http://wcfsecurityguide.codeplex.com/

---- snip ----

SecurityLogo.jpg patterns & practices Improving Web Services Security - Now Released

Welcome to the patterns & practices Improving Web Services Security: Scenarios and Implementation Guidance for WCF project site! This guide shows you how to make the most of WCF (Windows Communication Foundation). With end-to-end application scenarios, it shows you how to design and implement authentication and authorization in WCF. Learn how to improve the security of your WCF services through prescriptive guidance including guidelines, Q&A, practices at a glance, and step-by-step how tos. It's a collaborative effort between patterns & practices, WCF team members, and industry experts. This guide is related to our WCF Security Guidance Project.
Parts
Part I, "Security Fundamentals for Web Services"
Part II, "Fundamentals of WCF Security"
Part III, "Intranet Application Scenarios"
Part IV, "Internet Application Scenarios"
Forewords
Chapters
Part I, Security Fundamentals for Web Services
Part II, Fundamentals of WCF Security
Part III - Intranet Application Scenarios
Part IV - Internet Application Scenarios

Checklist
Sunday, September 20, 2009 12:28:13 PM (AUS Eastern Standard Time, UTC+10:00)  #    Comments [0] -
BizTalk | 2009 | Insights
# Saturday, September 19, 2009

Like me you may have received this lately – it was all working before (and especially on the developers machine :-) .

It turns out the VS2008 loves to update a registry key post installation, any sort of new VS.NET version, e.g. VS.NET Test tools etc, will overwrite this key.

BTS specific information is wiped away…..fortunately we set the registry key back as follows:

http://blogs.msdn.com/biztalkcrt/archive/2009/08/21/visual-studio-2008-fails-to-create-open-biztalk-projects.aspx
(x86 and x64 scenarios)

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Projects\{FAE04EC0-301F-11d3-BF4B-00C04F79EFBC}]

"PossibleProjectExtensions"="csproj"   - Original VS install reg value. "PossibleProjectExtensions"="csproj;btproj" - Post Biztalk installation reg value

Saturday, September 19, 2009 8:58:53 AM (AUS Eastern Standard Time, UTC+10:00)  #    Comments [2] -
2009
# Friday, September 11, 2009

Hi guys, thought I’d let you know about the rfid operations guide Microsoft recently released.

Covers things like HA, RFID Mobile and best practices… yours truly was one of the authors so I’m happy to take any feedback you’ve got.

Enjoy – here’s a snippet of what to expect.

Welcome to the first edition of the Microsoft® BizTalk® Server RFID Operations Guide. We created this guide to be a valuable resource for anyone involved in the implementation and administration of a BizTalk Server RFID solution.

To download a copy of this guide in .chm or .docx form, go to http://go.microsoft.com/fwlink/?LinkId=158724.

  Which Versions of BizTalk Server RFID Does the Guide Cover?

This guide is primarily for the BizTalk Server RFID product that is released as part of Microsoft BizTalk Server 2009. Even though most of the guidance applies to BizTalk Server RFID that was released as part of BizTalk Server 2006 R2, the guide uses the new platform changes wherever applicable.

  What’s in It?

This document applies to the operational readiness phase in the solution life cycle management of the project. The operational readiness phase precedes deployment to production. It consists of a set of tasks for ensuring a stable operating environment. It is targeted toward system administrators responsible for BizTalk Server RFID (server computers and RFID devices), DBAs responsible for the SQL servers used by BizTalk Server RFID, and developers involved with maintaining the infrastructure and solution. This document assumes that the BizTalk Server RFID solution has already been validated in a Pilot stage and is prepared for deployment to production.

Key portions of this guide are new; however, a considerable portion consists of documentation taken from BizTalk Server RFID Help, white papers, Knowledge Base articles, and other sources. It has been reviewed and evaluated by experts from the community of BizTalk Server IT professionals and members of the product development team, whom we gratefully acknowledge at the end of this topic. We believe that the information presented here will help BizTalk Server RFID users solve—and above all, avoid—many of the common problems that can occur while deploying and maintaining a BizTalk Server RFID installation.

  Interesting! Where Do I Start?

We organized the guide according to the functional aspects of planning, deploying, and managing a BizTalk Server RFID installation. You can therefore read it according to these functional aspects. If you are performing the following tasks, you can start with the related sections:

  • Evaluating operational readiness. If you are focused on assessing and evaluating the operational readiness of a BizTalk Server RFID deployment, then start by reading the Operations Checklists section.
  • Becoming operationally ready. To ensure that your BizTalk Server RFID infrastructure and applications become operationally ready, refer to the Planning the Environment for BizTalk Server RFID section.
  • Managing the operational environment. Most of the topics in this operations guide assist you in managing and maintaining an operational BizTalk Server RFID environment. You will find best practices, key concepts, and procedures for maintaining an operational environment in Managing BizTalk Server RFID and Monitoring BizTalk Server RFID.

Author: Rama Ramani (Microsoft)

Editor: Mary Browning (Microsoft)

Contributors

  • Mark Simms (Microsoft)
  • Rohan Makhija (Microsoft)
  • Ravi Vankamamidi (S3Edge)
  • Clint Tennill (Xterprise)
  • Damir Dobric, Andreas Erben (daenet)
  • Mick Badran (Breeze, BizTalk Server MVP)

Reviewers

  • Petr Kratochvil (Microsoft)
  • Ewan Fairweather (Microsoft)
  • Quoc Bui (Microsoft)
  • Douglas Trimble (The Boeing Company)
  • Robert Auston (Vail Resorts Management Company)
  • Luke Rennells (Bank of America N.A.)

Microsoft BizTalk Server 2009 RFID Operations Guide

Friday, September 11, 2009 9:56:50 PM (AUS Eastern Standard Time, UTC+10:00)  #    Comments [0] -
2009 | RFID | Tips | Training

At Teched this year I thought I’d catch up on a couple of exams…always lots to do (still didn’t do all of them) but I discovered a little tool on the MCP site – logo builder.
(I’m sure it’s been there for years :)

MCAD MCSD MCT Mick_MCTS

Notice the different colours – don’t know how that happened, but maybe I’ll plaster them up next to my ‘learn to swim’ and ‘tread water for 2mins’ certs.

Have a great weekend all – and hopefully see you sometime soon.

Mick.

Friday, September 11, 2009 9:41:23 PM (AUS Eastern Standard Time, UTC+10:00)  #    Comments [0] -
General
# Thursday, September 10, 2009

Last night we had an exam cram, where keen and interested delegates bunkered down and got their neurons firing.

I went through this exam with them giving them tips and sharing my general SharePoint knowledge around this.

Today – the good news was that I passed three delegates whom took the exam *today* and all passed!!! Well done guys!

Here’s the ppt deck that I used – enjoy and well done all!

70-630 MCTS- Microsoft Office SharePoint Server 2007- Mick Badran

Thursday, September 10, 2009 11:12:42 PM (AUS Eastern Standard Time, UTC+10:00)  #    Comments [0] -
Events | TechEd | 2009 | Training

We’re in the thick of TechEd 2009 here in Australia on the Gold Coast (tough place to have a conference ;) Sun, sand and a beach that stretches for miles 1 block away)

Big thanks to those of you that attended my session – great turn out and all my demos worked like a charm…that doesn’t happen every day :)

Here’s the powerpoints and demo files:

SOA314 BizTalk RFID Mobile - Mick Badran

PowerPoints  -


Thursday, September 10, 2009 10:50:01 PM (AUS Eastern Standard Time, UTC+10:00)  #    Comments [0] -
2009 | RFID | Events | TechEd | 2009
# Friday, September 04, 2009

Great to see some public information surfacing around SharePoint 2010 and development.

To get started (if you’re not already) here’s the SDK with a CHM file and PDF/XPS on “how to customise the ribbon”.
http://www.microsoft.com/downloads/details.aspx?familyid=94AFE886-3B20-4BC9-9A0D-ACD8CD232C24&displaylang=en

Doing a little digging in the CHM file, you can see (below) all the different Content categories with some special areas to note:

  1. There appears to be a Visio Server – I guess like InfoPath + Excel Services as they currently stand in 2007.
  2. AJAX + JSON seem to make an appearance at the foundational core – yay! less page reloads.
  3. WCF Services used (*.SVC) as expected and simplified. Also it appears that BDC systems are accessible via a SharePoint custom WCF Binding, making it possible to work on BDC based data from various applications within SharePoint. SharePoint might become the hub ‘repository’ for this sort of information.

Bear in mind *alot* of this information is ‘subject’ to change.

Certainly going fwd it should be very exciting to see what actually ships and whether some of the immediate constraints are dealt with.

Looks like we’re up for another Ribbon experience in this Version of SharePoint from within the Browser.

image

Friday, September 04, 2009 12:54:21 AM (AUS Eastern Standard Time, UTC+10:00)  #    Comments [0] -
.NET Developer | MOSS | Office | Deployment | 2010
# Tuesday, August 25, 2009

Folks I recently came across this site on codeplex - http://btsazureadapters.codeplex.com

Where a hard working Danny(not sure of further details) has created a send and receive adapter for the cloud.

The adapter surface and publish the required information into the cloud so for e.g. your endpoints show up publically in the .NET Servicebus domain – we can do this through the apis, but it’s nice to have them all wrapped up.

There’s even some great piccys as well (just over look the ‘Microsoft Confidential’ at the bottom :-| - I did ping him over this.)

BizTalk Adapter for Live Framework.jpgBizTalk Adapter for .NET Services.jpg

The adapters are WCF based adapters, meaning they will run in or outside of BizTalk using the .NET LOB Adapter SDK Framework.

As a Plan B to this – you can always use a Custom WCF Adapter with the basicHttpRelayBinding or netTcpRelayBinding to punch through to the cloud.

I reckon this will be a very exciting area going forward…keep your eyes peeled.

Go and grab the bits and start playing… :)

Tuesday, August 25, 2009 11:06:07 AM (AUS Eastern Standard Time, UTC+10:00)  #    Comments [0] -
Azure | BizTalk | 2009 | BizTalk Adapter Pack
# Tuesday, August 11, 2009

A handy couple of articles that have been updated for Biztalk 2009, full article attached at the bottom.

Enjoy

image

image

Tuesday, August 11, 2009 12:18:30 PM (AUS Eastern Standard Time, UTC+10:00)  #    Comments [0] -
BizTalk | 2009 | BizTalk Adapter Pack
# Saturday, August 01, 2009

I’ve been through many integration projects and I think now I’ve found a product more complicated than BizTalk.

For the last 6 weeks internally we’ve been ‘rolling out’ (more like dragging through the mud) an OCS/UM setup – it now finally works!!!! (Inbound/outbound and UM Voicemail).

OCS – goes from 1 sever to 3!

In this post I’ll aim to take you through linking a working OCS system to a Trixbox connected to MyNetFone (SIP Trunk provider). After countless weeks, forum posts and beyond weird error messages – I’ll simplify it for you.

Me – no OCS, SIP, Trunk, Asterisk expert – great developer, can look at network packets if I *really* have to.

I’m assuming you have OCS setup for IM and A/V between Communicator clients. The OCS Mediation Server is where we are going to focus a little bit also.

Ok – what I wanted to do…this sounds simple.

The Aim:

  1. OCS (Mediation Server) connecting to my Virtual PBX ‘PSTN’ so phone calls can go inbound and outbound.
  2. Create SIP Trunk ‘connection’ to our SIP Trunk ‘provider’ – in our case MyNetFone.
    SIP Trunks are similar to regular VOIP Accts, but a trunk allows you to have multiple voip numbers running over it. Similar to Proxy Servers for ‘http’ connections.

    Generally speaking the SIP Trunks going externally need some form of authentication with the external SIP Trunk provider. This can come in many forms from username/pass, to special ‘secrets’ being passed in certain packets.

    This took me some time to get right.
  3. Each user will be assigned a phone number (from the SIP Trunk) and all devices/phones/users will be managed by OCS.

The Problem(s):

  1. OCS talks SIP/TCP and ‘the rest of the world’ talks SIP/UDP. Some translator is needed here – raging debates about this, but essentially we’re dealing with the last 40 odd years of the evolution of telephony systems.

    In short – get Trixbox 2.8… based on Asterisk 1.6 this DOES the translation.
    (Trixbox performs a huge array of functions, but with OCS in place we really need it only to do about 5% of it’s feature set – hence alot of the menu items we needed worry about)
  2. The bits you’ll need before you start:
    1. IP:X = IP address of your Mediation Server (if your server has multiple IP Addresses select the IP Addr that will be sending out (eventually) your Trixbox
    2. IP:Y = IP address of your new Trixbox Server (to install)
    3. External SIP Trunk Details (or VOIP acct details)
    4. OCS 2007 R2 Resource Kit Tools installed on the Mediation Server - http://www.microsoft.com/downloads/details.aspx?familyid=9E79A236-C0DF-4A72-ABA6-9A9602A93ED0&displaylang=en
      - great log analyser tool called snooper.exe
    5. Putty.exe – this allows you to ‘rdp’ onto your new Trixbox (as this is a linux box)
      http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

  3. Plan of Attack – what I’ll walk you through below.
    1. Installing Trixbox – taking a fresh install and configuring.
    2. Turning on SIP/TCP support in Asterisk 1.6
    3. Creating 2 SIP Trunks in Asterisk 1.6
    4. Configuring the Next Hop Properties in OCS Mediation Server
    5. Check the Settings in the Asterisk World.
    6. Creating the Routing between the 2 Trunks by editing the Extensions_Custom.conf file.
    7. Sample successful outputs.

  4. Installing Trixbox
    This piece is pretty simple – for our test case I installed this onto a Virtual Machine (in practice it’s generally advisable to install this on a physical machine, as the trixbox needs to use codecs and encode/decode which a typically time dependent)

    It’s an ISO so install it as you would any other ISO – it in a unix box but don’t be nervous, the Trixbox guys have put a great web interface over alot of the underlying stuff.

    Important to note:
    Seeing Trixbox is open source and is based on another product called ‘Asterisk’, which in turn has components such as FreePBX and others, sometimes reference material for FreePBX may be applicable to your Trixbox.

    NOTE: I called my trixbox = xlator

    Installation Complete:
    Once initial installation is complete (if installing to a VHD the size is around 6GB), you should be able to go a browser and do:

    (at some point you’ll probably want to change your ‘root’ password and also a user called ‘maint’ which is used in the webinterface to perform admin tasks)

    http://xlator (the default install will also setup https://xlator for you)

    image
    As shown, we’re interested in switching to ‘maintenance mode’ clicking switch in the top left hand corner.
  5. Configuring the Trixbox environment
    1. As I mentioned earlier, we’ll only use about 5% of what Trixbox does. There’s some really key areas to make sure are setup and I’ll show you what they are.
    2. Turning on SIP/TCP capabilities for Asterisk
      Currently this isn’t a web interface checkbox, we need to modify a file called sip_general_custom.conf found in the /etc/asterisk directory.
      (the web interface has web config editor which we’ll use later with so many config files we can edit, *unfortunately* SIP.CONF isn’t one of them.
      1. Fire up Putty.exe (from your windows client) and type the address of your Trixbox in
      2. image and hit OK, (you may be asked to OK a Security Token with the remote machine – part of SSH, just OK that)
      3. Login with root and the password you setup during the install. (welcome to the world of command lines – brings back the uni days, grep, ls, chmod…. gee how I missed it)
      4. cd to the /etc/asterisk directory as follows
        image
      5. Type nano sip_general_custom.conf and add the following lines:
      6. image
        Press Ctrl-X then Y then press return to complete the save (pretty simple here really)
      7. Type cd /root to return back to your home directory.
      8. Listen to Asterisk with the Command Line Interface. This is sort of the interactive debugger in Asterisk.

        type asterisk –r

        this will show you what asterisk is doing when it receives calls and trys to dial them out.

        sip set debug on – lets you see what’s happening with SIP packets.
        sip set debug off – turns if off.

        *** VERY VERY HANDY when trying to establish connectivity ***

      9. (another folder of interest is the LOGS directory /var/log/asterisk – handy to keep in mind, but the web interface lets you see the logs)
    3. Add your OCS ‘Connection’ or SIP TRUNK
      1. From the Admin Web Interface select PBX Settings (this and PBX Status are the 2 main areas we’ll go into)
        image
      2. On the next page under Basic (on the LHS Menu) select Trunks
      3. Select Add Trunk –> Sip Trunk and fill in as follows:
      4. Leave everything blank or default except for the following sections:
      5. image
      6. Key information above:
        1. Trunk Name – Connect-with-OCS. This name is used later to basically ‘route’ incoming calls from our ‘external’ SIP trunk to internal. (you can call it your own name if you like – just keep things simple)
        2. context=from-Super-OCS. In all my troubles, contexts in Asterisk are the solution. This I set so that it won’t conflict with any other ‘system’ contexts (e.g. from-pstn, from-internal).

          When a call is received via the trunk, in our case from OCS mediation server sending out, Asterisk will associate a context with it (if not, you’ll get ‘received number from an unknown peer’)

          The key here is that we will create a section in a config file that will allow us to define *exactly* what happens around this context. (this piece took another week)
        3. host=10.1.1.30 – this should be the IP Address of YOUR MEDIATION server. Asterisk will use the IP address of the incoming SIP request to try and associate it to a context, without this entry, your request will come from unknown.

        4. Inbound/Outbound – inbound messages are messages received at Trixbox FROM OCS. Outbound Messages are messages send to OCS FROM Asterisk. They are then given a context and any other details needed.
      7. Save the above configuration by going to the bottom of the page and clicking Submit Changes.
      8. You should have your first Trunk (don’t apply changes yet, we’re creating another Trunk)
      9. image
        Notice these names above (I’ve got the 2nd one added too, you’ll have 1 at this point)

        Later we will ‘Dial’ calls out to these trunks with syntax like:
        Dial(SIP/<the number/extension>@Connect-with-OCS)

        (took me 2 days to find that gem)


    4. Creating your External Trunk – MyNetFone (in my case)
      This is where alot of the magic happens for the REGISTER SIP packets – if you have trouble with your external provider, sit with SIP SET DEBUG ON in the ‘asterisk –r’ interface in the PUTTY app to try and make heads or tails of it.

      Also you can see failures in the logs and your SIP Trunk won’t be registered in the PBX Status screen.
      1. Click on Add Trunk –> SIP Trunk
      2. Fill it in as follows (for MyNetFone) (took me a bit of trial and error)
        1. General Settings
          1. Outbound CallerID: "61555555555" <sip:61555555555@<your public IP>

            the 6155… number *should* be replaced with your own number allocated to your TRUNK.

            Your public IP is potentially NAT-ed from your Trixbox to the outside world. The web admin will show you your Public IP in the Top RH Corner.
          2. Never Override CallerID=checked
            (I’m currently still playing with this setting, but this works for now)
        2. Rest defaults until
        3. Outgoing Settings
          1. Trunk Name=MyNetFone (important to remember your name)
          2. PEER DETAILS

              disallow=all
              allow=alaw&ulaw
              authname=61555555555
              canreinvite=yes
              dtmfmode=rfc2833
              host=sip20.mynetfone.com.au
              insecure=very
              nat=yes
              pedantic=no
              qualify=yes
              type=peer
              username=61555555555
              fromdomain=sip20.mynetfone.com.au
              context=from-MyNetFone

            1. Note the context=from-MyNetFone which is one of the most important things here.

              Also the ‘canreinvite=true’

              Note: 61555555555= should be replaced with <your user name or phone number>
            2. In honesty this section took me about a week to work out – nat on, off?? tweaks here and there. You’ll see other posts that include ‘secret=…’.
              My setup didn’t require this.
          3. Incoming Settings
            1. User Context=from-MyNetFone
            2. USER DETAILS

                canreinvite=yes
                fromuser=61555555555
                insecure=very
                qualify=no
                type=peer
                username=61555555555
                host=sip20.mynetfone.com.au
                context=from-MyNetFone

                 

              Note: 61555555555= should be replaced with <your user name or phone number>

          4. Registration
            1. Register String = 61555555555@sip20.mynetfone.com.au/61555555555

        4. Click Submit Changes to save your work.
        5. Click Apply Changes to apply changes
        6. image
        7. You may get a warning – continue with Reload.
    5. Well done – at this point we’ve setup 2 trunks and we now need to ‘route’ calls between the two.

      Trawling the forums, if you set the context to from-internal any call received on the Trunk, Asterisk will examine all other trunks for a possible match. Let’s not confuse the issue right now :)
    6. Let’s Config OCS Mediation at this point – we can really do this any time, but the screen shots I’m showing you shortly will have OCS Mediation plugged in. So let’s do it.
      1. Jump onto your OCS Mediation Server and open up the OCS Server Admin tool as follows:
      2. image
      3. Points to Note here: we’re interested in the next hop settings.
      4. Right Click on your Mediation Server and select Properties.
      5. Configure as follows:
        image
      6. Under PSTN Gateway next hop – the address: xlator
        (you should have internal DNS resolution to your trixbox)
      7. Click OK and restart the Mediation Service (right click on the server and select stop, then start)
      8. Let’s flick back to the Web Admin of the Trixbox to see how things are going.
    7. Check that all things are setup and working – mainly your Registrations.
      1. The Web Admin in Trixbox gives a detailed view of what’s going on, also your Putty.exe session should be chatting away nicely – what it means, is another story!
      2. From the Web Admin –> PBX –> PBX Status to see something like…
      3. image 
        The Key areas that you need to keep an eye on are:
        1. SIP Peers – make sure that under Hosts there are no Unknown(s), as call routing won’t work the way I’ve outlined.
        2. Our connection with OCS doesn’t need to be registered.
        3. Our External Registration *should* be Registered by now – if not, go back to your trunk and configure the Outbound Settings and the Register String at the bottom of that page. ** DON’T MOVE ON UNTIL THIS IS COMPLETE **
      4. If you’ve set your dialing rules up in OCS on the Mediation Side, you should be able to dial a number and see activity in the Trixbox logs and in your Putty Terminal.
      5. Almost there…..


    8. Setting up Call Routing between our two worlds.
      At this point we could setup a bunch of extensions, inbound routes, outbound routes etc – and I did do that the first time through (10 users, 10 numbers, inbound routes etc etc – just pain).

      I thought there’s got to be a better way and here something that took 1 week to figure out – Trixbox forums are a great place to start with all of this, but they tend to be focused around building Trixbox out as the ‘OCS equivalent’, setting up receptionists, etc etc. I found I was spinning my wheels alot here, make a tweak, doesn’t work, read the forum, make another change, go back and redo a change etc.

      Here’s the simplest solution I’ve found: (for the code syntax – this was a great place to start)
      1. From the Web Admin select PBX –> Config File Editor and select extensions_custom.conf
      2. image
        (you will have to scroll down this list, but it’s there)
      3. Scroll to the bottom of this file until you find the line
        #include extensions-away-status.conf
      4. Insert this code above that line.
        1. Setup OCS/Communicator clients Dialling OUT

            [from-Super-OCS]
            exten => _X.,1,Answer
            exten => _X.,2,Dial(SIP/${EXTEN}@MyNetFone,,tr)

          1. What does this do??? yeah good question…had to ask myself that as well.

            Ok – hopefully you recognise the from-Super-OCS text in []. Remember from our OCS Trunk, anything that Asterisk/Trixbox receives FROM OCS via that Trunk was associated with this Context.

            So what we’re saying here is that “If you have a message from from-Super-OCS do the following steps”
            1. exten => _X.,1,Answer

              exten = something to do with when Asterisk goes searching for the right extension that matches the one that it has been given.

              _X. = saw this on a few other config files, it’s part of a dialing plan, X=any digit, . = any number of following digits.

              This will match *all* numbers dialled.

              _ = no idea (maybe some pattern match)

              ,1 = believe it or not, this is how we say “run me 1st”

              Answer = predefined function or application that will pickup the call. We can then work out what to do with the call.
            2. exten => _X.,2,Dial(SIP/${EXTEN}@MyNetFone,,tr)

              _X. = match all numbers.

              ,2 = run me 2nd

              Dial(SIP/${EXTEN}@MyNetFone,,tr) = here we’re dialling a SIP trunk – called SIP/MyNetFone. Later if you look at your SIP TRUNKS page, you’ll see your Trunks listed this way.

              What I wanted was SIP/<number to dial>@<outgoing trunk name>

              ${EXTEN} = variable that holds the ‘extension’ dialled from the communicator client. This is the phone number.

              NOTE: sometimes parties at the other end of the trunk want a certain dial prefix e.g. +61…
              you could use something like:
              Dial(SIP/+61${EXTEN}@MyNetFone)

              The '+61’ & ${EXTEN} get appended together in the above line.

              ,,tr = something to do with allowing the calls to be transferred.

              I originally didn’t have this, and my inbound calls to OCS worked, then when I tried to transfer them the Exchange UM Voicemail, they hung up.

              I added this in for inbound and Exchange Voicemail worked, so I figured it can’t hurt for outgoing.

              How fiddley is all this stuff!!!
        2. Setup External Calls Coming to OCS

          According to my OCS Expert buddy Dan, our internal OCS setup is such that all extensions have a +61… appended to them. the ‘+’ in ‘+61’.

          Checking on the ‘asterisk –r’ interface, MyNetFone will pass 02… and not +612…. So I needed to do a little tweaking of these numbers.

          Here’s the result :)
          1. Below the code you’ve added above add this.

            [from-MyNetFone]
            exten => _0X.,1,Set(numDialled=+61${EXTEN:1})   ;get all but the first digit from the Extension dialled.
            exten => _0X.,2,Set(__FROM_DID=${EXTEN})       ;sets a global variable.
            exten => _0X.,3,Answer
            exten => _0X.,4,Dial(SIP/${numDialled}@Connect-with-OCS,,tr)

            exten => _X.,1,Set(numDialled=+61${EXTEN})
            exten => _X.,2,Set(__FROM_DID=${EXTEN})
            exten => _X.,3,Answer
            exten => _X.,4,Dial(SIP/${numDialled}@Connect-with-OCS,,tr)

            Note: firstly from-MyNetFone in the above code, once again this is the context from our corresponding Trunk.

            exten=> _0X.,1,Set(…) = the _0X. here will match all the numbers passed to us from MyNetFone with a ‘0’ at the front.
            e.g. 02… – so I need to strip the ‘0’ off and add +61(0)2…

            Here I created a local variable called ‘numDialled’ to hold the translated number. You can see the ‘+61’ added to ${EXTEN:1}.

            ${EXTEN:1} = give me all numbers except the first.

             

        3. Your file should look like this now:

            [from-Super-OCS]
            exten => _X.,1,Answer
            exten => _X.,2,Dial(SIP/${EXTEN}@MyNetFone,,tr)

            [from-MyNetFone]
            exten => _0X.,1,Set(numDialled=+61${EXTEN:1})   ;get all but the first digit from the Extension dialled.
            exten => _0X.,2,Set(__FROM_DID=${EXTEN})       ;sets a global variable.
            exten => _0X.,3,Answer
            exten => _0X.,4,Dial(SIP/${numDialled}@Connect-with-OCS,,tr)

            exten => _X.,1,Set(numDialled=+61${EXTEN})
            exten => _X.,2,Set(__FROM_DID=${EXTEN})
            exten => _X.,3,Answer
            exten => _X.,4,Dial(SIP/${numDialled}@Connect-with-OCS)

            #include extensions-away-status.conf

      5. Click on Update to save the file.
      6. Click on ReRead Configs from the top menu. You may need to scroll to the top.
      7. image
      8. You’re Asterisk/Trixbox is ready to go!

    9. What Successful Calls Look like here: (you can get these from your Putty session, running ‘asterisk –r’
      1. OCS client going OUT
        1. image
          I’ve scrubbed the actual number dialled, but you can see where the number appears, the fact we Answer, and then Dial.

          Also where the ‘Contexts’ appear.
      2. Inbound to OCS
        1. image

 

 

 In conclusion:

Hopefully this will help unravel the huge mystery on how to connect these systems together. There’s many other ways this can be achieved, and I’d love to say it’s the silver bullet for this, but there’s just so many factors in your solutions.

This should certainly get you a large step down that path.

Good luck.

Mick.

Saturday, August 01, 2009 12:55:26 AM (AUS Eastern Standard Time, UTC+10:00)  #    Comments [3] -
OCS
Archive
<September 2009>
SunMonTueWedThuFriSat
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910
Blogroll
 AppFabric CAT
AppFabric Windows Server Customer Advisory Team - New Blog.
[Feed] BizTalk 2006 - Windows SharePoint Services adapter
BizTalk 2006 Sharepoint adapter!!
 Breeze SharePoint 2010 Bootcamp
Breeze SharePoint 2010 Bootcamp
[Feed] BTS 2006 R2/EDI
[Feed] Chris Vidotto (MS BTS Legend)
Needs no intro....
 Mark Daunt
BTS/SPS/.NET GURU!!!
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2014
Breeze
Sign In
Statistics
Total Posts: 606
This Year: 10
This Month: 3
This Week: 0
Comments: 270
All Content © 2014, Breeze