u:p:
Extreme Support > Support Forums

  TICKET INFORMATION
Ticket Home  >  All Tropo General Discussion  >  #1380975 - Two signalsSearch
Author/Date
Account Ticket #1380975:  Two signals
Charly

Posted on:
3/13/2011 1:05 PM (EDT)
hello, how can I recognize what signal was sent?

I have in my call:

call(LEAD, array(
        "callerID" => ID,
        "allowSignals"          => array("exit", "message"),
        "onSignal" => "CALLsignal",
        "onAnswer" => "CALLanswer",
        "onCallFailure" => "CALLfailure",
        "onTimeout" => "CALLtimeout",
        "onError" => "CALLerror"
        )
    );

and function:

function CALLsignal($event) {
// if "message" do something
// if "exit" do something else

}

I send "message" or "exit" signal and I don't know which was sent.
kazokanishi

Posted on:
3/13/2011 4:01 PM (EDT)
Hi,

I will pass this to Tropo engineers to see if they can provide you answers for how to identify
signals.

Best regards,

Kaz O.
Voxeo Support
mheadd

Posted on:
3/14/2011 10:11 AM (EDT)
The value of the event returned from the Tropo action will contain te name of the signal that was sent.

So, for example:

call(LEAD, array(
        "callerID" => ID,
        "allowSignals"          => array("exit", "message"),
        "onSignal" => "CALLsignal",
        "onAnswer" => "CALLanswer",
        "onCallFailure" => "CALLfailure",
        "onTimeout" => "CALLtimeout",
        "onError" => "CALLerror"
        )
    );

and function:

function CALLsignal($event) {
if($event->value == "message") {
  // do something
} else {
  // do something else
}
}


That should work for you.  Let us know if you run into any additional issues.
Charly

Posted on:
3/14/2011 2:23 PM (EDT)
Thank You.
I've done this other way, but this examle can help me in other scripts.
Charly

Posted on:
3/14/2011 6:12 PM (EDT)
I tried this, but it won't work, $event->value is NULL. I checked this in debugger, and signal was ok, but $event->value was empty.
MattHenry

Posted on:
3/14/2011 8:06 PM (EDT)


Hello Charly,

Would it be possible to test our suggestions with the debug log open, and then send us the output that is generated when you make a test call?

Thanks so much,

~Matthew Henry
Charly

Posted on:
3/15/2011 7:08 AM (EDT)
In debug.txt I've attached the most important part from debugger.
As You can see signal is correct, but when I log $event->value "-------------------------- event->value:" it's null, and script executes part from else (<speak>Thank you, bye!</speak>)

My code:
        conference(ID, array(
                "terminator" => "*",
                "playTones" => true,
                "allowSignals"  => array("message", "exit"),
                "onSignal"      => "CALLsignal"
          )
        );

    function CALLsignal($event)  {
        _log("-------------------------- CALLsignal");
        _log("-------------------------- event->value: " . $event->value);
        if($event->value=="message") {
            // "We are sorry but our representative has technical problems."
            say(MESSAGE);
        } else {
            // "Thank you, bye!"
            say(GOODBAY);
        }
        return true;
    }

And my signal URL: http://api-internal.tropo.com/1.0/sessions/648...2ac/signals?action=signal&value=message


Attached Files:
3/15/2011 7:08 AM (EDT) - debug.txt
mheadd

Posted on:
3/15/2011 1:27 PM (EDT)
Here is a simple test app that I used to verify this behavior (this is in JavaScript, but can be easily adapted to PHP if that is what you are using):

[code]
log("************Session ID is  " + currentCall.sessionId +"  ************");
$result = say("http://hosting.tropo.com/9178/www/audio/asterisk_sounds/en/holdmusic.mp3", {
� �allowSignals: ["exit", "message"]
});
log("*** Call interrupted by " + $result.value + " ***");;
{/code]

You can grab the session ID from the debugger and then interrupt the playing of the audio file.  You should see a log statement like this in the debugger:

*** Call interrupted by exit ***

If you continue to have issue, or have additional question just let us know.

Thanks!
Charly

Posted on:
3/15/2011 2:53 PM (EDT)
That works for say, but don't work for conference.

I tried Your code and it was ok, but when I edited it to:

log("************Session ID is  " + currentCall.sessionId +"  ************");
say("Welcome to the geek hotline!");
$result = conference("1337", {
    terminator: "*",
    mute: false,
    playTones: true,
    allowSignals: ["exit", "message"]
    });
say("We hope you had fun, call back soon!");
log("*** Call interrupted by " + $result.value + " ***");


I've recived log in debugger like this in attachment.


Attached Files:
3/15/2011 2:53 PM (EDT) - debug.txt
mheadd

Posted on:
3/15/2011 5:01 PM (EDT)
We're investigating this issue further to determine the root cause.

We'll update this ticket with more information just as soon as we've determined the issue.

Thanks!
voxeojeff

Posted on:
5/4/2011 11:43 AM (EDT)
Hi Charly,

I wanted to update you and let you know that this bug appears to have been fixed internally, however it is still undergoing rigorous QA testing before it is deployed to our Staging environment.  We'll keep you posted as to our progress on this front.

Stay tuned,
Jeff Menkel
Voxeo Support
voxeoTonyT

Posted on:
6/16/2011 1:53 PM (EDT)
Hello,

We just got notification that the fix has been made available.  Can you try testing this again and let us know how it goes?  In the meanwhile we will place this ticket in a pending status awaiting your response.

Regards,

Tony Taveras
Customer Engineer
Voxeo Support