Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000381 [Yate - Yet Another Telephony Engine] engine major always 2015-02-13 07:36 2015-02-22 13:31
Reporter schorpp View Status public  
Assigned To
Priority normal Resolution open  
Status new   Product Version SVN
Summary 0000381: Script chan.attach with wave module always rejected with "no data channel!"; early media malfunction with fork/wave
Description lateroute fork wave announcement only works if called from inner lan peers,
chan.attach from php external module script always rejected with

early media malfunction.

1. This does only work if called from regfile user, not from accfile peer (SIP<->PSTN GW provider or AVM Box SIP "server"):

^nnnnnnnnnnnn$=fork;callto.1=wave/play/...
^nnnnnnnnnnnn$=fork;callto.1=wave/play/...
^6xx$=fork;callto.1=wave/play//usr/share/yate/sounds/this-call-may-be-monitored-or-recorded.gsm;\
callto.2=|;callto.3=lateroute/210;callto.4=lateroute/211;callto.5=lateroute/212;callto.6=lateroute/213;callto.7=lateroute/214;\
callto.1.fork.calltype=persistent;callto.1.fork.autoring=true;callto.1.fork.automessage=call.progress;fork.stop=busy;maxcall=20000
-Log1-

There's no doc how to fork route such par regfile without lateroute, or N/A because other like "fork;called=210;..." returns instantly with "failure".

2. using chan.attach fails with every script example from docs and maillist, tried attach on call.execute with and without dispatching a call.answered which implies an established rtp "data channel"? :

-2 of ~ 10 unsaved script versions -attached-

-Log2-

y
tom
Additional Information #!/usr/bin/php -q
<?php
require_once("libyate.php");

/* Always the first action to do */
Yate::Init();

/* Set tracking name for all installed handlers */
//Yate::SetLocal("trackparam","playearlymedia.php");

/* Uncomment next line to get output in rmanager, not just in logs */
Yate::Output(true);

/* Uncomment next line to get debugging messages */
Yate::Debug(true);

//Yate::SetLocal("restart",true);

$ourcallid = "playearlymedia/" . uniqid(rand(),1);

/* Install filtered handler for the wave end notify messages */
Yate::Install("chan.notify",100,"targetid",$ourcallid);

/* Install a handler for the call routing message */
Yate::Install("call.execute",90);

for (;;) {
    $ev=Yate::GetEvent();
    Yate::Output("playearlymedia msg type: " . $ev->type . " Msg name: " . $ev->name . " id: " . $ev->id);
     /* If Yate disconnected us then exit cleanly */
    if ($ev === false) {
        Yate::Output("playearlymedia event: none");
        break;
    }
    /* Empty events are normal in non-blocking operation.
       This is an opportunity to do idle tasks and check timers */
    if ($ev === true) {
        Yate::Output("playearlymedia event: empty");
        continue;
    }
    /* If we reached here we should have a valid object */
    switch ($ev->type) {
    case "incoming":
    switch ($ev->name) {
    case "call.execute":
    $ev->params["targetid"] = $ourcallid;
    $ev->handled = false;
        $ev->Acknowledge();
            
    $ch_id = $ev->params["id"];
    $ev = false;
            
        $m = new Yate("call.answered");
        $m->params["id"] = $ourcallid;
        $m->params["targetid"] = $ch_id;
        $m->Dispatch();

    $m = new Yate("chan.attach");
    $m->params["source"] = "wave/play//usr/share/yate/sounds/this-call-may-be-monitored-or-recorded.gsm";
    $m->params["notify"] = $ourcallid;
    $m->Dispatch();
        break;

        case "chan.notify":
// gotNotify($ev->GetValue("reason"));
            Yate::Output("notify reason: " . $ev->GetValue("reason"));
            $ev->handled = true;
            $ev->Acknowledge();
            $partycallid = $ev->GetValue("id");
            $peercallid = $ev->GetValue("targetid");
            $ev = false;
                    // send call.progress
                    $m = new Yate("call.progress");
                    $m->params["targetid"] = $partycallid;
                    $m->params["id"] = $ourcallid;
                    $m->params["earlymedia"] = true;
// $m->params["rtp_forward"] = true;
                    $m->Dispatch();
            break;
        }
        /* This is extremely important.
           We MUST let messages return, handled or not */
        if ($ev)
        $ev->Acknowledge();
        break;
    case "answer":
// Yate::Debug("playearlymedia Answered: " . $ev->name . " id: " . $ev->id);
        break;
    case "installed":
         Yate::Debug("playearlymedia Installed: " . $ev->name);
        break;
    case "uninstalled":
         Yate::Debug("playearlymedia Uninstalled: " . $ev->name);
        break;
    default:
         Yate::Output("playearlymedia Event: " . $ev->type);
    }
}



Yate::Output("playearlymedia: bye!");

?>
Tags No tags attached.
Attached Files log file icon yate-earlymedia-bug.01.log [^] (20,935 bytes) 2015-02-13 07:36
? file icon playearlymedia.php.03 [^] (3,288 bytes) 2015-02-13 09:33
? file icon playearlymedia.php.04 [^] (3,289 bytes) 2015-02-13 09:36
? file icon earlymedia-regexconf-lateroute-fork.01 [^] (127,330 bytes) 2015-02-13 20:57

- Relationships

-  Notes
(0000570)
schorpp (reporter)
2015-02-13 20:57

Attached sniffer/sip log of call from outside over AVM SIP server to

^6xx$=fork;callto.1=wave/play//usr/share/yate/sounds/this-call-may-be-monitored-or-recorded.gsm;\
callto.2=|;callto.3=lateroute/210;callto.4=lateroute/211;callto.5=lateroute/212;callto.6=lateroute/213;callto.7=lateroute/214;\
callto.1.fork.calltype=persistent;callto.1.fork.autoring=true;callto.1.fork.automessage=call.progress;fork.stop=busy;maxcall=20000

2 user ring once only, then busy state occurs but caller keeps ringing Line 2 of Twinkle until caller hangup.
(0000576)
schorpp (reporter)
2015-02-16 09:16

Removed fork.stop=busy, outside callers ring all phones now, but still no announcement, ringing tone only.
(0000585)
schorpp (reporter)
2015-02-22 13:31

1.) RESOLVED: FIXED

Resolution see 0000390, Note 4:
http://yate.null.ro/mantis/view.php?id=390&nbn=4#bugnotes [^]

- Issue History
Date Modified Username Field Change
2015-02-13 07:36 schorpp New Issue
2015-02-13 07:36 schorpp File Added: yate-earlymedia-bug.01.log
2015-02-13 09:33 schorpp File Added: playearlymedia.php.03
2015-02-13 09:36 schorpp File Added: playearlymedia.php.04
2015-02-13 20:57 schorpp Note Added: 0000570
2015-02-13 20:57 schorpp File Added: earlymedia-regexconf-lateroute-fork.01
2015-02-16 09:16 schorpp Note Added: 0000576
2015-02-22 13:31 schorpp Note Added: 0000585


Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker