Migration of WCS4/Asterisk/MeetMe project to WCS5

marcw

Member
Damn, you were right! The firewall was blocking port 8443. Adding port 8443 to the firewall made the trick. Just wandering why that port was not blocked before. Anyway, I can go on now. Thanx, Max!
 

marcw

Member
Okay, next problem. It is Asterisk related but I hope you can give me a hint anyway because the Asterisk configuration on my other server was coded by Alex. I am using the same configuration on the new server (adjusted where needed) but when now the callee pick up the phone and MeetMe put him into the conference the callee is confronted with the message that he have to enter the conference number. Obviously the reason for this is that the dstchannel is always empty.

Code:
- Executing [s@fun1:2] NoOp("SIP/mpapp2-00000000", "INIT_CHANNEL: SIP/mpapp2-00000000") in new stack
    -- Executing [s@fun1:3] Set("SIP/mpapp2-00000000", "SHARED(INIT_CHANNEL,)=SIP/mpapp2-00000000") in new stack
    -- Executing [s@fun1:4] Set("SIP/mpapp2-00000000", "SHARED(CONF,)=00491777000001") in new stack
Here are the extensions:

Code:
[fun1]
exten => s,1,NoOp(${CONF})
exten => s,n,NoOp(INIT_CHANNEL: ${CDR(channel)})
exten => s,n,Set(SHARED(INIT_CHANNEL,${CDR(dstchannel)})=${CDR(channel)})
exten => s,n,Set(SHARED(CONF,${CDR(dstchannel)})=${CONF})
exten => s,n,MeetMe(${CONF},Akmqd)
exten => s,n,Hangup

[fun2]
exten => s,1,NoOp(${SHARED(CONF)})
exten => s,n,Wait(0.5)
exten => s,n,NoOp(${SHARED(INIT_CHANNEL)})
exten => s,n,MeetMe(${SHARED(CONF)},kxqd)
exten => s,n,AGI(kill_channel.sh,${SHARED(INIT_CHANNEL)})
exten => s,n,NoOp("NOT_IN_THE_MEETME")
exten => s,n,Hangup
Do you have any idea what the reason could be?

Best
Marc
 

marcw

Member
Solved! It sounds stupid but it seems that the macros from the extensions.conf in Asterisk 11 only worked due to a bug. The dest channel normally is not overgivable if setting the G option.
Anyway, if someone should find this thread anywhen in the future here is my solution. Please compare it with the code I entered above:
Code:
[separator]
exten => s,1,Goto(fun1,s,1)
exten => s,2,Goto(fun2,s,1)


[fun1]
exten => s,1,NoOp(Data 1: CONF=${CONF} INIT_CHANNEL=${INIT_CHANNEL})
exten => s,n,MeetMe(${CONF},Akmqd)
exten => s,n,Hangup

[fun2]
exten => s,1,NoOp(Data 2: CONF=${CONF} INIT_CHANNEL=${INIT_CHANNEL})
exten => s,n,Wait(0.5)
exten => s,n,MeetMe(${CONF},kxqd)
exten => s,n,AGI(kill_channel.sh,${INIT_CHANNEL})
exten => s,n,NoOp("NOT_IN_THE_MEETME")
exten => s,n,Hangup
Also an adjustment in another part was necessary:
exten => _0049ZX.,1,NoOp(Starting Dialout Procedure app_sound_voippro INT ${EXTEN}) same => n,SIPAddHeader(P-Preferred-Identity: <sip:+4917683869864@locophono.com>) same => n,Set(__CONF=${EXTEN}) same => n,Set(__INIT_CHANNEL=${CDR(channel)}) same => n,Set(FILE(/var/lib/asterisk/conferences/${SIPCALLID})=${CONF}) same => n,Dial(SIP/${EXTEN}@sipout_voippro,30,rG(separator,s,1)) same => n,NoOp("Call should not end here") same => n,Hangup()
The underline char made also a difference.

Best regards
Marc
 

marcw

Member
Hi Max!
Here I am back. Like old shoes you cannot throw away. ;)
I have set up now my calling proccess as you mentioned in this thread a longer time ago. So I

1. start a phone call with the client2/examples/demo/sip/phone/phone.html
2. find the conference-id in the asterisk conferences folder
3. create a .call file containing i.E.
-----
Channel: Local/s@inject-sound
Application: Playback
Data: 15_14
Archive: Yes
Set: CONF=cde54620-d931-11e8-a543-4303c23be106
----
4. move the created file into the asterisk outgoing folder

The funny thing is that all seems to work fine and also the asterisk console tells me that the sln file is played but nothing is hearable. I can hear the callee's voice in the phone.html but not the sln file I move to the outgoing folder.

#codecs
codecs =opus,alaw,ulaw,g729,g722,mpeg4-generic,telephone-event,h264,vp8,flv,mpv
codecs_exclude_sip =mpeg4-generic,flv,mpv
codecs_exclude_streaming =flv,telephone-event
codecs_exclude_sip_rtmp =opus,g729,g722,mpeg4-generic,vp8,mpv

#websocket ports
ws.port =8080
wss.port =8443

rtp_force_synchronization=true
rtp_activity_detecting=false,0
generate_av_for_ua=all
stun_freshness_timeout=1000000000
streaming_video_decoder_fast_start=false
add_register_auth_headers=false
mixer_video_enabled=false
rtp_receive_buffer_size=131072
rtp_send_buffer_size =131072
function call() {
var session = Flashphoner.getSessions()[0];

var constraints = {
audio: false,
video: false
};

//prepare outgoing call
var outCall = session.createCall({
callee: $("#callee").val(),
visibleName: $("#sipLogin").val(),
localVideoDisplay: localDisplay,
remoteVideoDisplay: remoteDisplay,
constraints: constraints,
receiveAudio: true,
receiveVideo: false,
stripCodecs:"SILK"
}).on(CALL_STATUS.RING, function(){
[...]
Of course I tried to change out the stripCodec value with PCMU, PCMA and G722 but without any success.

from Asterisk console
-- Executing [00491777000001@sipout_app_sound_voippro:1] NoOp("SIP/mpapp2-00000024", "Starting Dialout Procedure app_sound_voippro INT 00491777000001") in new stack
-- Executing [00491777000001@sipout_app_sound_voippro:2] SIPAddHeader("SIP/mpapp2-00000024", "P-Preferred-Identity: <sip:+4917683869864@locophono.com>") in new stack
-- Executing [00491777000001@sipout_app_sound_voippro:3] Set("SIP/mpapp2-00000024", "__CONF=00491777000001") in new stack
-- Executing [00491777000001@sipout_app_sound_voippro:4] Set("SIP/mpapp2-00000024", "__INIT_CHANNEL=SIP/mpapp2-00000024") in new stack
-- Executing [00491777000001@sipout_app_sound_voippro:5] Set("SIP/mpapp2-00000024", "FILE(/var/lib/asterisk/conferences/00491777000001)=cde54620-d931-11e8-a543-4303c23be106") in new stack
-- Executing [00491777000001@sipout_app_sound_voippro:6] Dial("SIP/mpapp2-00000024", "SIP/00491777000001@sipout_voippro,30,rG(separator,s,1)") in new stack
== Using SIP RTP CoS mark 5
-- Called SIP/00491777000001@sipout_voippro
-- SIP/sipout_voippro-00000025 is making progress passing it to SIP/mpapp2-00000024
-- SIP/sipout_voippro-00000025 answered SIP/mpapp2-00000024
-- Executing [s@separator:1] Goto("SIP/mpapp2-00000024", "fun1,s,1") in new stack
-- Executing [s@separator:2] Goto("SIP/sipout_voippro-00000025", "fun2,s,1") in new stack
-- Goto (fun1,s,1)
-- Goto (fun2,s,1)
-- Executing [s@fun1:1] NoOp("SIP/mpapp2-00000024", "Data 1: CONF=00491777000001 INIT_CHANNEL=SIP/mpapp2-00000024") in new stack
-- Executing [s@fun2:1] NoOp("SIP/sipout_voippro-00000025", "Data 2: CONF=00491777000001 INIT_CHANNEL=SIP/mpapp2-00000024") in new stack
-- Executing [s@fun2:2] Wait("SIP/sipout_voippro-00000025", "0.5") in new stack
-- Executing [s@fun1:2] MeetMe("SIP/mpapp2-00000024", "00491777000001,Akmqd") in new stack
-- Created MeetMe conference 1023 for conference '00491777000001'
-- Executing [s@fun2:3] MeetMe("SIP/sipout_voippro-00000025", "00491777000001,kxqd") in new stack
-- Attempting call on Local/s@inject-sound for application Playback(15_14) (Retry 1)
-- Called s@inject-sound
-- Executing [s@inject-sound:1] MeetMe("Local/s@inject-sound-00000024;2", "cde54620-d931-11e8-a543-4303c23be106,qd") in new stack
-- Local/s@inject-sound-00000024;1 answered
> Launching Playback(15_14) on Local/s@inject-sound-00000024;1
-- <Local/s@inject-sound-00000024;1> Playing '15_14.slin' (language 'en')
-- Created MeetMe conference 1022 for conference 'cde54620-d931-11e8-a543-4303c23be106'
[2018-10-26 17:14:32] NOTICE[14085]: pbx_spool.c:460 attempt_thread: Call completed to Local/s@inject-sound

Output from ARC http://locophono.com:8081/rest-api/call/find_all
(just for debugging purposes):
{
"callId": "cde54620-d931-11e8-a543-4303c23be106",
"incoming": false,
"status": "ESTABLISHED",
"caller": "mpapp2",
"callee": "00491777000001",
"localAudioCodec": "PCMU",
"remoteAudioCodec": "PCMA",
"remoteVideoCodec": "H264",
"createDate": 1540566856382,
"hasAudio": true,
"hasVideo": false,
"visibleName": "mpapp2",
"mediaProvider": "WebRTC",
"sipStatus": 200,
"holdForTransfer": false,
"id": "cde54620-d931-11e8-a543-4303c23be106_null",
"msrp": false,
"history": false
}


What am I doing wrong? (WCS 5.1.3546)

Best regards
Marc
 
Last edited:

Max

Administrator
Staff member
Hello Marc.
"localAudioCodec": "PCMU",
"remoteAudioCodec": "PCMA",
It seems like Asterisk uses PCMA (alaw) codec. So check if file that you try to playback on Asterisk uses this codec too.
Of course I tried to change out the stripCodec value with PCMU, PCMA and G722 but without any success
stripCodec forces WCS do not use codecs listed. For example if Asterisk wants to use PCMA you can exclude other codecs like this:
Code:
stripCodecs: "opus,OPUS,PCMU,G722,G729"
 

marcw

Member
This implementation must be the hell's prove for me. I never felt so stupid like in the past weeks (no: months! :( ) Whatever I do, whatever I try, I fail. So I ask you politely to log into my server to find out why I cannot simply play an audio file by moving the .call file into the outgoing folder. The Asterisk log tails me that the file is playing correctly but nothing is to hear. Also localAudioCodec and remoteAudioCodec are both PCMA now. I send my login data and the testing setup to support@flashphoner.com . Feel free to charge me something for your effort.

Best regards
Marc
 

Max

Administrator
Staff member
Hello
Could you make a test.
Call from Xlite or another softphone to your number.
Then place call-file manually.
Do you hear sound?
Is MeetMe conference installed on this server?
Is it configured properly?
 

Max

Administrator
Staff member
Good day, Marc.
We have reproduced the problem using softphone and found solution. You should change one string in your PHP script from
Code:
exec('echo "Set: CONF='.$output.'" >> /tempcids/'.$cidf);
to
Code:
exec('echo "Set: CONF='.$cid.'" >> /tempcids/'.$cidf);
and Asterisk sound injection will work, playback is hearable both in softphone and browser. We have changed it for you.
In this case, Asterisk 1234567890.call file looks such as
Code:
Channel: Local/s@inject-sound
Application: Playback
Data: /path/to/sound/file
Archive: Yes
Set: CONF=1234567890
where 1234567890 is callee number (and conference number too).
 

marcw

Member
OH MY GOD!! THAT IS WORKING!!! I'm real happy now! Thank you very much for your investigations, Max! Can I pay a fee for your work?
I cannot belive that I just mixed up two variables in my own php script. Oh boy...

Best regards
Marc

P.S. And also the Firefox works now after founding again the tweak you posted earlier
Code:
if(Browser.isFirefox()) {
    var audioContext = new AudioContext();
    var emptyAudioStream = audioContext.createMediaStreamDestination().stream;
    constraints.customStream = emptyAudioStream;
}
And Edge as well. Seems that I can start now building my project! :)
 
Last edited:
Top