the voice of technology - phonologies

27
The Voice of Technology

Upload: others

Post on 03-Feb-2022

1 views

Category:

Documents


0 download

TRANSCRIPT

������������ �������

������������

������������������� �� �����������

�����������

The Voice of Technology

������������ �����������������������������������

�� � �������������� � �����������!�����"� ��#������$�����

��

�����������

The Voice of Technology

�!�"����#���������

����$!%�&�!��$�!����!� ��' �������������������������������������������������������������������������������������������������������������������������������������� (

)��*%+�!,!�%,���������������������������������������������������������������������������������������������������������������������������������������������������������� (

(����!� ��'� ����$!,%-*,'.������������������������������������������������������������������������������������������������������������������������������������ �

(�����!��$!,% %,!,%������������������������������������������������������������������������������������������������������������������������������������������������������ � (�)���!��$,!������������������������������������������������������������������������������������������������������������������������������������������������������������������� / (�(���!�'%� ! ������������������������������������������������������������������������������������������������������������������������������������������������������������� �0 (�����!���1������������������������������������������������������������������������������������������������������������������������������������������������������������������ �2

����� �$,$!'��-���$!,% %,!,%����������������������������������������������������������������������������������������������������������������������������� �3

�����$ �!4�,�,������������������������������������������������������������������������������������������������������������������������������������������������������������� �5 ��)���! �!�4�,�,���������������������������������������������������������������������������������������������������������������������������������������������������������� �5 ��(�!+%,*&� ���6��������������������������������������������������������������������������������������������������������������������������������������������������������� �5 ����-,!+,%������������������������������������������������������������������������������������������������������������������������������������������������������������������� )� ��2�!%*$'�!��$�7*��&*!�%���������������������������������������������������������������������������������������������������������������������������������������������� )�

2���� �$,$!'��-��$,! �������������������������������������������������������������������������������������������������������������������������������������������� ))

2���!�%$*&������������������������������������������������������������������������������������������������������������������������������������������������������������������� )) 2�)�*+,��*$*1,%������������������������������������������������������������������������������������������������������������������������������������������������������� )) 2�(�*'6$�-,!+,%��������������������������������������������������������������������������������������������������������������������������������������������������������� ))

/���� �$,$!'��-�'%� !,%������������������������������������������������������������������������������������������������������������������������������������ )(

3��!+,��$!,1%*!��$�8*��!+%��1+������������������������������������������������������������������������������������������������������������������������ )(�

������������ �����������������������������������

%� � �������������� � �����������!�����"� ��#������$�����

��

�����������

The Voice of Technology

��

�� �������9���������������� ���

��������� ��������&&�'�����(()$�������������������(���'�������������*����������������������+��$�������#����(����(�����������+��(�����������������,%-�������(����*����������+��+���(()$��!.���������"��

/������(�$�������(��'���#�������(�$���������+���������� ���������������������+�(������#�����'�������������+�(��*����#���������������������+��$���/������(�$�����������#�����������������������*����������������������� ���*��������������������+��$����������������+�(���� ��#���������(�������������*�������0�������

)� *�9����9�����

������������ �����������������������������������

�� � �������������� � �����������!�����"� ��#������$�����

��

�����������

The Voice of Technology

(� ��������� ��������#�9��.��(�� ����������������

����������������������������+�(�������+�(���������������(�����'��*���� ���+��$���������(()$����������������+���������+��$�*����������������1������������������(()$��������������������(�1����$���������������������������������+�(����/���+����*�����������������+�+��(���������#�����'������������+�(���

�����������:��

static bool Initialize(OktoLog * log, OutputQueue **output, EventThreadPolicy policy);

/����+��(�������������'������+��$������������2������������������������������2�����$���+�����������(����������+��������������������������3��������������������������+�(���/��������������������������������(�1�'��������+��(���������������������������������������/����

+��(��������(�������������(����

����������������$����������������������������������(�1����������+�����������������������(���+�������4����1���������!����� ���9;�*��(����������+��$�*��������������/���������3�������������'��������������������������(�$$�������*���������'��

�(���������'����������+��$��4������+�/����� ���(��(���'�������+� ���6<&,-*��!����� ���6< ���,&��5��(���������+�����

����(����(���'��+�������������������#�������������������

/����+��(��������(�������������(��*������������+��$���������2�����

)��&���������:��

��

/����+��(�������������'����������+��$����������*�������������������/����+��(������������������������3�����(������*����������������������(��(��(�������/����+��(������������������$�������������+�����������4���������(������*������������������������*�������

����������2���/����+��(�������������(�������������(��*������������+��$���������������*���

static void Deinitialize(OutputQueue *output );

������������ �����������������������������������

6� � �������������� � �����������!�����"� ��#������$�����

��

�����������

The Voice of Technology

�(�������������9��

static OktoInterpreter *CreateInstance();

/����+��(���������� ���+��$�(�������������������(���+��������������������$�$���������������������$���������������������������������(�������������(���+��������������

���&�����;������9��

static void DestroyInstance( OktoInterpreter *interp );

/����+��(���������� ���+��$������������������(���+������������������������������$�����������������+���������������������������(����������+��$�*�������������������

2��%���

virtual Result Run( const VXIchar * initialURI, const VXIchar * sessionid, const VXIchar * fetchid , const VXIMap * args , Resources * resources )

/����+��(�����������������������(���������������������������+��(��������(()$��+�������(�+����'����������7�����������1������((����������������������������(���������������8��������+����#�������(��������

/����+��(������������������$����������������������%���+���(()$����(�$���1������0�������������+��������(()$��9������1��������������#��9������#��%�������� �����+�(()$����(�$����+��(�����������1����������������4������������������������������������(���+�����(�����%�����9��1�*��(����������������(��������������������������������9��������/���+����������$����4�����:��������������������'��������������������������++�(��������������'���#�������������������*������'����������+��$������������������������������

����(�������������������������'�������#����1�'������(���'�������+�����������������(���������������������������������'�������#������

������������ �����������������������������������

;� � �������������� � �����������!�����"� ��#������$�����

��

�����������

The Voice of Technology

�/�� ���, ����

virtual Result PostEvent( VXIMap *event, VXIunsigned delay )

/����+��(������������������+��$�����������������#��������������0������+������������������������������$�������������+�����4�����*��(��(�������������#�����������������$������(����1����������(�+�������������#����+����*��(����������+��$�*�����������#�������'��

���(��������

3����9��, �����

virtual bool CancelEvent(int sendid)

/����+��(������������������+��$�(��(������������+�����#����*��(��*��������������<����=��/�������+��$�������������(��>#���������+�������3�����(��(��������������������$�#��������#����$��(�����������������+��$�����0������+��#��������'���)�(�������

(�) ���������

��������������+�(�����'������������+��$����������(��*��������?��(��(�$��������+����������������������+�(�����������*����������+���������(�����������������8�����������(����������������'��������(���������������(��������+��(�����������+�����+����*����$�������

���-��9���

virtual InetResult Fetch( const VXIchar * fetchid, const VXIchar * uri, const VXIMap * properties, VXIMap ** event )

@�+����(������������+��(�����������������+��������4���������������1������������������(�����������������+���*����������*������/����+��(������������������$�����������������#��9���1����������+�����+�������*��������+��(�������������������4�����(���������������������!+���������'�+���"1��������������������������+���4������ �����,��������+��(������������1�����$���� ��������

������������ �����������������������������������

A� � �������������� � �����������!�����"� ��#������$�����

��

�����������

The Voice of Technology

��������#��9����������������#��9�����������(������������#��9�����������*�����(��������B���������������+�����$��������+����4����������������*���C�

• �������

• >�(�������/����

• /�$�����

• ��(����

• ��).���

• ��)9�����

• -,!+*��=*���

�������(���'���������D>/���� �9/�!�����B// "����).���������)9�����������������(�����������(�(���'���#�����+������������(�����).������(�+�������������#����+����*��(����(�(�����������������'��(�������������'���)���������)9��������������������������������

*��(������)������������(���'���������

-,!+*��=*�����������#���������(�+��(������#�����$�������1��������������*���'��*��(����������+��$�(�����+��$��������������'����(�$���������+���+��(���#�����?�������������+��$������������+������+��(����������+����*���C�

?����*����������������������+�+��(�����$�?��(����@�(������+��$�����������������$���$������+��(��������������������+��(������������+�������������������9�������'��������������������������������1��������������4�����+��(�>#�����������������������

� void myFetchCallBack(VXIchar* sessionId, VXIMap* fetchEvent);

������������ �����������������������������������

E� � �������������� � �����������!�����"� ��#������$�����

��

�����������

The Voice of Technology

� /*Now in the module which takes commands out from OutputQueues, platform should do something like following*/ VXIMap *myEvent = myEventQueue->GetCommand(); VXIString* evtName = (VXIString *) VXIMapGetProperty(myEvent,L"name"; VXIString* evtSessionId = (VXIString *) VXIMapGetProperty(myEvent,L"sessionid"); if(evtName==L"command.fetch") { VXIMap *properties; properties=VXIMapCreate(); //Get the pointer to interpreter session using this evtSessionId OktoInterpreter *myIntp = platform->getInterpreterFromSessionId(evtSessionId) /*In the VXIMap properties set the property FETCHCALLBACK to address of myFetchCallBack (Platform's version of fetchcallback)*/ VXIMapSetProperty(properties,L"FETCHCALLBACK", (VXIValue *) VXIPtrCreate((void*)Platform::myFetchCallBack)); /*In the VXIMap "properties" set the property "FETCHSESSIONID" to sessionid(value of sessionId of the Interpreter for which platform is doing this fetch.)*/ VXIMapSetProperty(properties,L"FETCHSESSIONID",(VXIValue *) VXIStringCreate(sessionid)); /*In this form Fetch will be called passing the VXIMap properties*/ myInet->Fetch(fetchid,myURL,properties,NULL); }

�,���������������'�����$�(�$���������������(�+��(�1��������+������������+��$�'��(�����������$�?��(����@�(��+��(������ ���+��$�

������������$���������$��������������������(����'�(��+��(�������

������������ �����������������������������������

F� � �������������� � �����������!�����"� ��#������$�����

��

�����������

The Voice of Technology

� void Platform::fetchCallBack(VXIchar* mysessionId, VXIMap* fetchEvent) { if (mysessionId != NULL) { OktoInterpreter *myInterpreter = platform->getInterpreterFromSessionId(mysessionId); if (myInterpreter != 0) { const VXIString *name = (VXIString *) VXIMapGetProperty(fetchEvent,NAME_FIELD); if (name != NULL) { Log("Posting %ls",VXIStringCStr(name)); myInterpreter->PostEvent(fetchEvent,0); // Interpreter instance handles the async fetch from here. It parses the // downloaded content and stores the parsed content in a local repository // called FetchList. This content can later be used by <goto> or <createccxml> Log("Posted %ls",VXIStringCStr(name)); } } } }

/�$��������(�+�������������#��������(������+����*��(������$������������'������*���+�������(�$����(�������'����*�����������

)����������:���

static InetResult Initialize(int maxAsync);

/����+��(�������������'������+��$������������2�����������������(�������������������$������������������(�+�����������$'����+�

����(����������*��������������������2����

(�������������9���

static OktoInet *CreateInstance();

������������ �����������������������������������

��� � �������������� � �����������!�����"� ��#������$�����

��

�����������

The Voice of Technology

��

/����+��(���������� ���+��$�(�������������������(���+�������������$�$���������������������$���������������������������������(�������������(���+�������

����&�����;������9���

static void DestroyInstance( OktoInet *inet );

/����+��(���������� ���+��$������������������(���+���������������������������$�����������������+��������������������(����������+��$�*������������������

2��&��������:���

static InetResult Deinitialize();

/����+��(�������������'����������+��$����������*�����������7�����(���������������(�������(����������

(�( ����'9�����

/�����������������0������������������������������)�(�������+�>�.9(�������/�������9(����������+�(��+�(���������������)�(�����������������������+��$�(�������(����������)�(������(����)���+��������(����������)�(�������$��?����*�����������������+�+��(��������#�����'������������+�(����

�����������:��

static OktoScript::Result Initialize(VXIunsigned diagBase, OktoLog * log, VXIlong runtimeSize, VXIlong contextSize, VXIlong maxBranches);

������������ �����������������������������������

��� � �������������� � �����������!�����"� ��#������$�����

��

�����������

The Voice of Technology

�/����+��(�������������'������+��$������������2����������9(�����������(�������������������$�������������������������������(�1�

$�)�$�$������$����2����������+��$�*�������������*1���2���+�(����)������+��$�*���������'�1�����$�)�$�$���$'����+�����*�����������(������/��������%�����$��������'�����������+��$����(����������������$������+�$����$�$��������9(�����������(��(���������

)�������������9���

static OktoScript *CreateInstance();

/����+��(���������� ���+��$�(�������������������(���+�����9(�����������(���������$�$���������������������$������������������

���������������(�������������(���+�����9(�������

(��&�����;������9��

static void DestroyInstance( OktoScript * );

/����+��(���������� ���+��$������������������(���+�����9(�����������(�������������������$�����������������+���������9(�����

������(����������+��$�*�������������������

���&��������:��

static OktoScript::Result Deinitialize();

/����+��(�������������'����������+��$����������*����������9(�����7�����(���������������(�������(���������

2�����������>���

virtual Result CreateContext(OktoScriptContext ** cxt)

/����+��(������������������+��$�(������������������2������*��(�����(����)���/����+��(������������������$�������������������������������

�'G�(���+�����'9��������>���,��������+��(�������������*������((���1�������(����������������+���*���(�������(����)����������#����'�����������������(����)�����(��������������������

������������ �����������������������������������

��� � �������������� � �����������!�����"� ��#������$�����

��

�����������

The Voice of Technology

�/��&�����;����>���

Result DestroyContext(OktoScriptContext ** cxt)

/����+��(���������*����������+��$����������������)�(������(����)��*����������(�������(��������/�����������������$�������������+�

�����������������)�������������(���+�����'9��������>�1����������������������������0������(���������

3�������7��,>���

virtual Result CreateVarExpr(OktoScriptContext * cxt, const VXIchar *name, const VXIchar *expr)

/����+��(������������������+��$�(��������#����'���������#������(���������������#���(����)�1������������������2�������#����'����/����

+��(������������������$�������������+���������'9��������>��������(�1�����*�������(��������#����'���*������������$���+�����#����'������'��(�������1���������)������������'���#�����������������������������������������#������������#����'�����+������������

����$��������$�������H���1�������������#������+�����#����'�������������,�*'9���������#�������

?�������7�7������

virtual Result CreateVarValue(OktoScriptContext * cxt, const VXIchar *name, const VXIValue *value)

/����+��(������������������+��$�(��������#����'���������#������(���������������#���(����)�1������������������2�������#����'����/����

+��(������������������$�������������+���������'9��������>��������(������*�������(��������#����'���*������������$���+�����#����'������'��(�������1��������7��������'��������������������������#�������+����������������$�������H���1�������������#������+�����#����'�������������,�*'9���������#�������

5��'��7��,>����

Result SetVarExpr(OktoScriptContext *cxt, const VXIchar * name, const VXIchar *expr)

������������ �����������������������������������

�%� � �������������� � �����������!�����"� ��#������$�����

��

�����������

The Voice of Technology

�/����+��(������������������+��$��������(�����#����'����������)���������������#�����(��������(�����/����+��(������������������$���1�

���������+���������9(��������)��������(������*�������(��������#����'���*������������$���+�����#����'������'�������������

>�.9(������)������������'���#����������������������������#����'����

�0��'��%������;��

virtual Result SetReadOnly(OktoScriptContext *cxt, const VXIchar *name)

/����+��(������������������+��$�������#����'�������I�����������#��������(�����/����+��(������������������$�������������+�����

����'9��������>��������(�1�����������$���+�����#����'���*����������(����)��*��(���������'�������������I�������

����'��7��7������

virtual Result SetVarValue(OktoScriptContext * cxt, const VXIchar *name, const VXIValue *value)

/����+��(������������������+��$��������(�����#����'����������)���������������#�����(��������(�����/����+��(������������������$���1�

���������+���������'9��������>��������(������*�������(��������#����'���*������������$���+�����#����'������'������������7�7��������'������������������#����'����

�)��1��7����

virtual Result GetVar(const OktoScriptContext *cxt, const VXIchar *name, VXIValue **value)

/����+��(������������������+��$���������#������+���#����'���������(�����(����)�������������������$�������������+�����

����9(��������)�������������#����'���+��$1���$���+�����#����'�����������������$����������������+���4�4�����������(��*��(����������������#������+�����#����'���*��������+��(���������������

�(����9�7����

virtual Result CheckVar(const OktoScriptContext *cxt, const VXIchar *name)

������������ �����������������������������������

��� � �������������� � �����������!�����"� ��#������$�����

��

�����������

The Voice of Technology

�/����+��(������������������+��$�(��(���+���#����'������������9(��������)�������+�������������/����+��(������������������$����

���������+��������9(�����������(������������$���+�����#����'�������*�������(��(��+�����+���#����'�����������#�����H����������

(�������������'����+�����������(�+�(�����,�*'9�����&�#�������

����, ����

virtual Result Eval(OktoScriptContext *cxt, const VXIchar * name, VXIValue ** res)

/����+��(��������'������������+��$�����)�(���������(��������������9(��������)�1�����������������������������+��)�(�������+���0�������

/����+��(������������������$�������������+���������9(��������)��������(������)�(���������(�����*������������$���+�����'�++���

*��(��(�������������(�������)���������������+���4�4��������������.+�����)�(�����������������������(���������������������$���1��+���������������������������H�����������'����������������������$�����

�2�� ���'9�����

virtual Result PushScope(OktoScriptContext *cxt, const VXIchar *name, const OktoScript::ScopeType type)

/����+��(������������������+��$���������������(��������������9(��������)���/����+��(������������������$�������������+���������9(��������)���������������*��(������1���$���+������(��������������+�9(�������'���������/�����$���+������(���������������

����*���+����(����#����'����+��$�����)���(����(����*�����������(����(����1���(�����J$��(����$�#��K�����((����J$�#��K�*��������

�(������$���J$��(���K��/�������������$����(�������������+���#������H./�4>L9� >����.��.9L9� >��H./�4>L9� >�������(�������+��(��������(��������

������(��������������������)��������(����(����1�*�����.��.9L9� >�������(�������+��(�����(���������������+�������(����������(��#���(�����

�/�� ��'9����

virtual Result PopScope(OktoScriptContext *cxt)

/����+��(������������������+��$�������(����)��+��$������(����(�����!��$�#������������(���"��/����+��(������������������$��������

���������+��������9(��������)��������$�#����������$������������(����+��$������

������������ �����������������������������������

�6� � �������������� � �����������!�����"� ��#������$�����

��

�����������

The Voice of Technology

��3������'9�����

virtual Result ClearScopes(OktoScriptContext *cxt)

/����+��(������������������+��$�7����������(����(���������������'����(���������������������$�������������+���������9(��������)����������(�����+��$��������������������������(�������

�?��1��$����

virtual std::string GetName() ;

/����+��(�������������������$���+����������+�(�8��'�����$�������'�����(���������!��������(��������9(����"��

��

(�� ��������

/����������������+�(�����'�������������������������������(��������������������������������9���

static OktoLog* CreateInstance();

/����+��(���������� ���+��$�(�������������������(���+���������������(���������$�$���������������������$��������������������������

�������(�������������(���+�����������

)��&�����;������9���

static void DestroyInstance(OktoLog *);

/����+��(���������� ���+��$������������������(���+���������������(�������������������$�����������������+�������������������(������

����+��$�*������������������

������������ �����������������������������������

�;� � �������������� � �����������!�����"� ��#������$�����

��

�����������

The Voice of Technology

�(��&��������9�

virtual void Diagnostic( const VXIchar * sessionID, const VXIchar * subtag, const VXIchar * format, ... ) = 0;

/���5��������(�+��(�����(���'�������'������+��$�������������������(�������@���(��������(���'����������������������*�����#�������������#���1�*�������������'�����������������*����������$�������(����������)�(��������(��/����+��(������������������$��������

�����������+�����������������������������������������1���'���1�����+��$�������������'�������������������+�����*���������������$��

������$�����������#�������+���$�����������#����'�������������$���+���������������9�1������+��(�����������#����'��������+�����$����������+��������+��$��������������(������(�+��������$����+�����#����'����+���*��(������*�������������#�������

���,������

virtual void Error(const VXIchar *sessionID, const VXIchar * moduleName, VXIunsigned errorID, const VXIchar * format, ... ) = 0;

������������ �����������������������������������

�A� � �������������� � �����������!�����"� ��#������$�����

��

�����������

The Voice of Technology

��� �����������#��������������

����

������������ �����������������������������������

�E� � �������������� � �����������!�����"� ��#������$�����

��

�����������

The Voice of Technology

� �

� � � � � � � � � � � � � � � &��������"��

������������ �����������������������������������

�F� � �������������� � �����������!�����"� ��#������$�����

��

�����������

The Voice of Technology

���� �����4�����

�����3���������������(��*�������������+��$����(������������������#��������*�������������������������������3����/������8�>B�./�����������������0�����������#�������������������/��������3���������+������, ���4����1*��(������'�����$���$����������� ������;�4����1�*��(�������!���������������������>�(��3�����������(���������+����, ���:�����!���'�����!��/����0��������������������(��������������+�������$��!/"��/����������$��*���������#����*�������������&��������������(�+����+���������#�������+�����!����� ���9;���� ���6<&,-*��!1���(�������3������������������!,+�*!�����"�$�������������*������+������!����� ���9;���� ���6< ���,&1�����$'����+������4����������$���������'������������������!����4����!�����"�� ������+�������������������������'I��(�����!����� ���9;��

��) �������4������

������3�����������������+�(��+������������(�$$������������'������������������,����#���������$���������(��������1�������(��#�������������(�$$��������������������������3������ ���+��$�����)��(�������$������������0����1������)�(��������(�$$�����+��$������0������

�9��������3���������������(��*���������������������(���9��������*��(�����*���������'���(���������'������#����������������������������(�����������@�99���A����$���������������������������$���1���������������)�(������1�����$����$���������������(�$$��������������������7������B9��������99���C��������(�������������������4�����H�*���������#����*������������+��$�������4�������������������������������������������(��!�����9� "����*����������(������������+����((���������(������

��( !������ ���9;�

/������ ���(���������������#����(���������+��������#����'����$���$�����������+�,+�*�/�����(��������++�(�������*��������4������������#�����+��$�����#������������*��������4�������#����������������������/�����������/����� ���(�����#����'��1� ���6<&,-*��!����� ���6< ���,&���+�����(������ ���6<&,-*��!�1������(����(������+������$���$���������*����'����������������������(�����+� ���6< ���,&����*����'�������&��������"���

������������ �����������������������������������

��� � �������������� � �����������!�����"� ��#������$�����

��

�����������

The Voice of Technology

� ���ML5>?.��/��

���(�����+� ���ML5>?.��/�������(����(������+���������������������&������������������(������(���������������������

�����4������������,+�*!������$�������������������3���������(������*���������+��/����������(�$$���������4�����+�������������(����+����������������������(������������������� ���, ���������� ���#�����������#������������

�����4������+�������������������������������9���>B�./�������+������������(���������������+��$������4������������(�����������#���1�((��������������(()$��+������������������������1!������������������'��������(������������������*������

���'��������'������#���"�,+�*!������*���������������������������4�����������������4����DA*��������������

���+��$������������������, ���!������*��(��(������������$������������������3����������������������$��(�$$����(�$���1������������������������(�������������4�����1�����������/����(�$$�����������������'����������+�����

(()$�������������'���������1�������� ���+��$�(������*�*��(���������������������������(�$$����'������������

��������(����+����#������*���������������������!�������+����#������*�9���"�����*���������������������*��(��$�����������������4������+�������#�������������+�(������������������(���'�����#�������+�����������#�����

�9�������������(���(���+������������*��������������������*��������+����#������*�(���1�����(������� ���6< ���,&����

�����!����� ���9;��

���ML ���>5��

���(�����+� ���6< ���,&�������(����(������+������$���$�����������������&�������"�����������(����*�����������#������#��������������+�����(��������������!������(�+�(����������4����"��,����������������2�������+�����������������*��

��������2����/����� ���1�,������(����(�$��������������������������*��(���������� ���DA*�������4�����

�������������E���/��������(������������#��������������-������3�����*���������+���������4����!��������+�!����� �����>�(�������4����!������$�����������������+�������������������������1�������$���������������3�������+�����

��������������������������$������������(��0��������(������������#��������������'�����(����������*���������������������������4�����+��$�*����� ���+��$��������������������, ��!�����������������������������(������@�(�������������

��������������1�������������(����������#�������*��(��(���'��(������'������ ���ML5>?.��/��$���$����������B�*�#�����������(���������3�����������������#����)�����+��*��>B�./������������#�(�1���������$��������$������$��!��$��$����

$������(����"������(�����#��������(�$��������������� ���ML5>?.��/��$���$�����������

������������ �����������������������������������

��� � �������������� � �����������!�����"� ��#������$�����

��

�����������

The Voice of Technology

��� -��9����

?��(���������������'���+�����*�������������(()$����(�$���������������������������������7��������������������+����;�9��������������;�9��������#��9�����+���(�$���������(�����+�����(��������+��(������������������(�$�����+����+��(���������$�������������������������+����������(�$����*��(��(���'���((���������������+��������������*�����������������������#��9�����+�������(�$�����

��2 !���������� ���������

5�����������������*��������#��������#���*����������(��(��*����������*������������������*����������+����������������������������������(������$��(�������������(�$'���������+������������#�����/�����������������'��/���������4����������

/����#������$�����������@����������A�(���'�������������)��������������/����*����������(�$�������������������)������������������*��$��(�����*���������������$����������+����������)��������������� ���������#��������!���������7����������$���$����������������$����$���$�2�������(�$����������9���#������$��*������/���������4������������+������$��(���������������1�+����*�������������������C�������(���+������1�#�������(��������������'�����+�����������������������$���1���������(�����������������$���(�������������

���/����(��(���+�����(���������������������$����������������'�������(��������+����1���������(���������*������(�$������������������)�����������������#��������'���������������������������(���������+��������������/������$��*�����������#�����(�$��������������)����������#������$��������#�������+�������+��������������������$������������������(�����1�*������������������

%�����(������(�$���������������)���������*��������(��������#������

������������ �����������������������������������

��� � �������������� � �����������!�����"� ��#������$�����

��

�����������

The Voice of Technology

�2� �����������#�������

2�� !�������

/���������$���$�������B// 8����(�����������������B// 8B// 98?��>������(������������������7��B// �(��������'�����+��������(�����#������������������������(���*�����(������������������$�2��+��(������

2�) �9�����������

�(���$��������������������*��������+������������(�����������������������������+���1��+IH��I����+���������(��I����������������+�����B// ����������������(����*���������+�����������'�����������+��$�(�(���������'����*��������+��$������������(���$���������������������$�)��������$�)����������$�����������0������'���������9��(�+�(�������

2�( *�;�9�-��9����

,������������'�����$������������2������(���������/������������+�5�*����������/�����$'����+�5�*���������(���'��(��+�������*������������2�������������������(���/�����5�*����������((����.���(�+��(����0������+��$�������������������������+���������������������������*��������+��(�����(�$�������.���(�?��(���������������(�����((������'�������������������@������������(���*���������$���$�������������+��$��������+������(�$���������+���+��(���

������������ �����������������������������������

�%� � �������������� � �����������!�����"� ��#������$�����

��

�����������

The Voice of Technology

���

/� �����������#�'9�������

9(����������'���(����������$���$����������+���������9(����������+�(���/�������'�����)�(�������+�G�#��(������������(()$�������(������������0������'��,%N�������(����*����������+��+�������/���9(����������������9������������O�#�9(�������������/�����������������$��������(���>�(��������(���+�������������(�����������*�9����>�1�����������������9����>�������������(������������*������������/������������$�������������$������+�$����$�$����������(�������(��������/����������(�+����*�������������2����9(�����������������'9����..��������:�����

3� !���������������8���!�������A�� ���+��$��$���$������������� ���+��$������+�(�����#�����'�������������A�� ���+��$����������������������������(�������������������:�����++������������(����������+��������������1�� //Instantiate OktoLog resource OktoLog* myLog=OktoLog::CreateInstance(); //Initialize OktoInet Resource with 2 async downloaders Oktonet::InetResult res = OktoInet::Initialize(2); //Initialize OktoScript resource with myLog as the Logging resource, //runtime size of 1024*1024 bytes,contextSize 128*1024 bytes ,and //maximum number of allowable branches set to 10. OktoScript::Initialize(myLog,1024*1024,128*1024,10); //Initialize Oktopous with myLog logging resource,outQ (the //OutputQueue to be sent commands to),and with thread policy //POLICY_DEFAULT OktoInterpreter::Initialize(myLog,&outQ,OktoInterpreter::POLICY_DEFAULT); OR //Initialize Oktopous with myLog logging resource,outQ (the OutputQueue to //be sent commands to),and with thread policy POLICY_POOLED OktoInterpreter::Initialize(myLog,&outQ, OktoInterpreter::POLICY_POOLED);

������������ �����������������������������������

��� � �������������� � �����������!�����"� ��#������$�����

��

�����������

The Voice of Technology

�A�% ���+��$���������$���$�������������*��(��*����(������������$�����������������4�����������+��$�����+��$�

�'������(�$����(�$$������ ���+��$��������������������������A�� H�*�����*�������(���+��������������������'��(�������1�*������(����(�$��1��������+��$�*������������(�����

���'�����(���1�'���'�+����(�������������������(������+��$������������������������������������(������������ OktoInterpreter::resources = new struct OktoInterpreter::Resources; //Instantiate OktoInet resource myInet = OktoInet::CreateInstance(); //Instantiate OktoScript resource myECMA = OktoScript::CreateInstance(); //Instantiate OktoInterpreter myInterpreter = OktoInterpreter::CreateInstance(); /*fill the resource structure of Platform*/ resources->inet = myInet; resources->jsi = myECMA; resources->log = myLog; resources->platform = this;

A�6 @�+�����������������#��� ��(����������������������������������������0��������������/������#���������*������'���'��������++����������'��*������++������(��������

//Generate a unique ID for this session and assign it to mySessionId VXIchar *mySessionId=genSessionId();

A�; @�+�����������������#��� ��(����������������������������������������0��������������/������#���������H�*���������>#���� ��(�������������1� �����������(()$����������������0��������������������������*��������������(������(�������������2��������������

������������ �����������������������������������

�6� � �������������� � �����������!�����"� ��#������$�����

��

�����������

The Voice of Technology

� /*Run the EventProcessing Thread,Pass it the ccxmlUrl "myurl",sessionid "mId" of this session,third argument is "NULL" becaues we are passing URL(either ccxml document URL or fetchId of a prefetched ccxml Document has to be passed), Fourth argument is "NULL" becuase this is not a child Interpreter session(Had it been a child session we would set a VXIMap,with the property "parentid" set as essionid of the parent" and a pass a pointer to this VXIMap here"),the last argument passed is a pointer to the structure "resource" which we filled earlier in step 4.*/ myInterpreter->Run(myUrl,mId,NULL,NULL,resources);

��

A�A ,����#�����������+��$�������������������#��������������(��������4����1���������������$���+������#����������������51��������������'�������0������'�������#���!�+���0�����"����������(���� ���>#�����?����)�$�����+�����+��$�*�������������B9����9�������������C1����*��������������+����*�C�

VXIMap* evt=VXIMapCreate(); VXIMapSetProperty(evt,L"connection",VXIValueClone((VXIValue*)connectionObject)); VXIMap *event=VXIMapCreate(); /*Set the "name" property of VXIMap "event" to VXIchar * "connection.alerting"*/ VXIMapSetProperty( event, L"name" , reinterpret_cast<VXIValue*> (VXIStringCreate(L"connection.alerting")) ); /*Set the "sessionid" property of VXIMap "event" to VXIchar * "sessionId"*/ VXIMapSetProperty( event, L"sessionId" , reinterpret_cast<VXIValue*> (VXIStringCreate(sessionId) )); /* Set the 'connectionid' property of VXIMap 'event' to VXIchar* 'connid' */ VXIMapSetProperty(event,L"connectionid", reinterpret_cast<VXIValue *> (VXIStringCreate(connid))); //Create a VXIMap for connection object VXIMap* connectionObject=VXIMapCreate(); //Set properties that need to be available inside session.connection //For example setting of 'local' and 'remote' properties is shown here

������������ �����������������������������������

�;� � �������������� � �����������!�����"� ��#������$�����

��

�����������

The Voice of Technology

� VXIChar* localStr=L"Some_value_for_local"; VXIChar* remoteStr=L"Some_value_for_remote"; VXIMapSetProperty(connectionObject, L"local",(VXIValue*) VXIStringCreate(localStrl)); VXIMapSetProperty(connectionObject,L"remote",(VXIValue*)VXIStringCreate(remoteStr)); //The connection object map should be inserted inside the event map VXIMapSetProperty(event,L"connection",VXIValueClone((VXIValue*)connectionObject)); //Post Event connection.alerting with zero delay myInterpreter->PostEvent(event,0); /* Note: * Assuming the connectionid value is 'c1' ,the connection object inside ccxml * script can be accessed as session.connections['c1']. * * The above discussion applies to dialog and conference objects as well. * The property local will be available as session.connections['c1'].local * For a list of properties supposed to be passed in connection/dialog/conference * maps please refer CCXML spec. */

A�E /�����������$���$������'������+��$�*��(��$������������������3�����(��������(�$$���������+��$�������3����1����������(�$$����������+������4����1����������������������������������4����D�� ��������(���'��������#���������4����9�� ���������H�*������������(�����#�������� ���+��$�+���+��������(����������������������������)�$�����+�(�$$�����((����!*��(������������������������������<�((���=����$�������(()$��+�����

VXIMap *event = myEventQueue->GetCommand(); VXIString* evtName = (VXIString *) VXIMapGetProperty(event,L"name"; VXIString* evtSessionId = (VXIString *) VXIMapGetProperty(event,L"sessionid"); if(evtName==L"command.accept") { /*Accept the call,this is implemented by platform and may depend upon telephony protocol in use and many other things.*/ platform->accept();

�� � 8:��������'�����((��������*1���������(����(�����(����(�����������������������9�������:8��

������������ �����������������������������������

�A� � �������������� � �����������!�����"� ��#������$�����

��

�����������

The Voice of Technology

� VXIMap *newEvent=VXIMapCraete(); /*set the "name" property of VXIMap "newEvent" to VXIchar * "connection.connected".*/ VXIMapSetProperty( newEvent, L"name" , reinterpret_cast<VXIValue *> (VXIStringCreate(L"connection.connected")) ); /*set the "sessionid" property of VXIMap "newEvent" to VXIchar * "sessionId"*/ VXIMapSetProperty( newEvent, L"sessionId" , reinterpret_cast<VXIValue *> (VXIStringCreate(sessionId) )); /*You need to know now which interpreter session this event should be posted to.This has to be implemented by platform, should take sessionId as input and return pointer to the Interpreter instance related to this sessionId.*/ OktoInterpreter* mInterpreter = platform->getInterpreterPointer(evtSessionId); //Post Event connection.connected with zero delay. mInterpreter->PostEvent(newEvent,0);

A�F ,����(()$�������(�������)���1������������������(��(�������������+��$����$�����!"���������+��$�(���+��������������(������������������(����I���������������

� /*CCXML session has exited,so its time to clean up everything*/ //This function is a virtual function in the class OktoPlatform // and must be defined by the platform implementor. platform->CCXMLComplete;