[Freeswitch-users] originating a call from JS

John Wehle john at feith.com
Mon Jul 21 16:49:42 PDT 2008


Still fighting with our System 25 voice mail ports.

Turns out that sending DTMF to control the message waiting lights
only works when done while receiving a dialtone from the PBX ...
you can't just send the tones at the end of a voice mail call.

I have some JavaScript which looks like:

    function mwi_on (ext)
      {

      mwi_session = new Session();
      mwi_session.setCallerData ("caller_id_name", mwi_caller_name);
      mwi_session.setCallerData ("caller_id_number", mwi_caller_number);
      mwi_session.originate (session, mwi_device + "/#90" + ext, 15);
      mwi_session.execute("sleep", "1000");
      mwi_session.hangup ("NORMAL_CLEARING");
      }

    ...
    session.execute ("voicemail", "default " + domain + " " + to);

    mwi_on (to);
    ...

which sometimes works fine and other times fails with a trace similar to:


  [NOTICE] switch_channel.c:533 switch_channel_set_name() New Channel
    OpenZAP/4:4/#90482 [9d2980b4-7557-dd11-8fb6-001fc6ab49e2]
  [WARNING] zap_zt.c:356 zt_open() Echo training not available for 4:4
  [NOTICE] switch_ivr_originate.c:1263 switch_ivr_originate() Hangup
    OpenZAP/4:4/#90482 [CS_CONSUME_MEDIA] [NO_ANSWER]
  [WARNING] mod_spidermonkey.c:2824 session_originate() Cannot Create
    Outgoing Channel! [openzap/4/A/#90482]
  [ERR] inline:1 mod_spidermonkey()  You must call the session.originate
    method before calling this method!
  [NOTICE] switch_core_state_machine.c:157 switch_core_standard_on_execute()
    Hangup OpenZAP/1:1/551 [CS_EXECUTE] [NORMAL_CLEARING]
  [NOTICE] switch_core_session.c:754 switch_core_session_thread() Session 4
    (OpenZAP/1:1/551) Ended
  [NOTICE] switch_core_session.c:756 switch_core_session_thread() Close
    Channel OpenZAP/1:1/551 [CS_HANGUP]
  [NOTICE] switch_core_session.c:754 switch_core_session_thread() Session 5
    (OpenZAP/4:4/#90482) Ended

... the result of handling a voice mail from openzap span 1 extension
551 (a System 25 voice mail port) and attempting to original a call
using openzap span 4 (a System 25 loopstart line) to extension #90482
which, if successful, causes 482's message waiting light to go on (the
DTMF signals from the System 25 indicated to the JavaScript program that
the voice mail message was for ext 482).

So what's the correct, reliable way to pick up an openzap line, wait
for dial tone, and dial some digits / send some DTMF?

-- John
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john at feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------





More information about the FreeSWITCH-users mailing list