SMcreateVMP
Previous Topic  Next Topic 

Synopsis:

       SMcreateVMP(module_id,[local_ip_addr])

Arguments:

       module_id                 The module number

       local_ip_addr        - Optional local IP address


Description:   This function creates a Virtual Media Processing port on the specified DSP module_id.    Modules are numbered from 0 in the order that they are opened when the CXACUDSP.DLL library initialises.      If an ACUCFG.CFG is supplied then this defines the order that the modules are opened, otherwise the acu_get_system_snapshot() will define the order that the cards (and thus the DSP modules) are opened.


The optional local_ip_addr argument allows a local ip address to be specified to identify a network adaptor within the system in the case when there are multiple network adaptors to choose from.


The function creates vmprx and vmptx virtual media processing end-points on the specified module to allow RTP data to be transmitted to and received from a remote ip destination.      This function maps to the Aculab  sm_vmprx_create() and sm_vmptx_create() functions.


Upon success the function will return a vmp_handle which can be used in subsequent calls that refer to this VMP channel.


For IP calls the VMP channel should be specified in call parameters for the  CCaccept() call as follows:


      port=0;  

      chan=1;

      vox_chan=1;

      module_id=0;

      vmp_chan=SMcreateVMP(module_id);


      // specify a codec on the vmp channel

      SMsetcodec(vmp_chan,0,G711_ALAW);

     

      ....


      while(1)

           x=CCwait(port,chan,WAIT_FOREVER,&state);

           if(state eq CS_INCOMING_CALL_DET)

                CCalerting(port,chan);   // send INCOMING_RINGING event

           else if(state eq CS_WAIT_FOR_ACCEPT)

                CCclrparms(port,chan,PARM_TYPE_ACCEPT);

                CCsetparm(port,chan,PARM_TYPE_ACCEPT,CP_IPTEL_VMPRXID,vmp_chan);

                CCsetparm(port,chan,PARM_TYPE_ACCEPT,CP_IPTEL_VMPTXID,vmp_chan);

                CCsetparm(port,chan,PARM_TYPE_ACCEPT,CP_IPTEL_CODECS,vmp_chan);

                CCaccept(port,chan);

           endif endif

      endwhile


      // make full duplex connection between VMP and a voice channel datafeeds

      SMfeedlisten(vmp_chan,TYPE_VMP,vox_chan,TYPE_VOX);

      SMfeedlisten(vox_chan,TYPE_VOX,vmp_chan,TYPE_VMP);

      SMplay(vox_chan,"TEST.VOX");

      etc...


Returns:   Upon success this function returns a VMP channel handle, otherwise it returns a negative error code..