Rest Api Issue

Max

Administrator
Staff member
Hello

What is your server version?
Example:
Code:
cat /usr/local/FlashphonerWebCallServer/conf/WCS.version
5.0.2921
Please share your settings WCS_HOME/conf/flashphoner.properties and logs WCS_HOME/logs/server_logs/flashphoner.log
You can send any sensitive information to logs@flashphoner.com
 

Parvej

New Member
Hello

What is your server version?
Example:
Code:
cat /usr/local/FlashphonerWebCallServer/conf/WCS.version
5.0.2921
Please share your settings WCS_HOME/conf/flashphoner.properties and logs WCS_HOME/logs/server_logs/flashphoner.log
You can send any sensitive information to logs@flashphoner.com
-----------------------------------------------------------------------------------------------------
My current version is
5.0.2884
------------------------------------------------------------------------------------------------------
flashphoner.properties
ip =192.168.1.73
ip_local =192.168.1.73
port_from =30000
port_to =31000
media_port_from =31001
media_port_to =32000
waiting_answer =60
user_agent =Flashphoner/1.0
balance_header =balance
cost_header =cost
video_enabled =true
domain =
outbound_proxy =
outbound_port =
log_level =5
enable_context_logs =false
rtp_activity_detecting =true,60
sip_msg_listener =com.flashphoner.sdk.sip.ChangeCallIdListener
call_record_listener =com.flashphoner.server.client.DefaultCallRecordListener
dtmf =rfc2833
auto_login_url =/usr/local/FlashphonerWebCallServer/conf/account.xml
get_callee_url =/usr/local/FlashphonerWebCallServer/conf/callee.xml
codecs =opus,alaw,ulaw,g729,speex16,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
on_record_hook_script =on_record_hook.sh
--------------------------------------------------------------------------
Server logs:-
18:05:33,769 INFO WSClients - WSClientsKeepaliveThread-47 Websocket ping/pong timeout us detected. Removing channel and disconnect client. channel: [id: 0x065dd02e, /192.168.1.128:35476 => /192.168.1.73:8443] client: WSClient{channel=[id: 0x065dd02e, /192.168.1.128:35476 => /192.168.1.73:8443], handler=com.flashphoner.server.client.handler.DelegateHandler@2fb14d8b, closed=false, pageUrl='null', countUnansweredPing=11} countUnansweredPing: 11
18:05:33,781 INFO WSClient - WSClientsKeepaliveThread-47 Close connection for channel [id: 0x065dd02e, /192.168.1.128:35476 => /192.168.1.73:8443] with status code: 1000 ; reason: Disconnected by keep alive
18:05:33,781 INFO WCS4Handler - DISCONNECT-CLIENT-pool-22-thread-16 Disconnect client: com.flashphoner.server.client.MediaWCSClient@900a0c6
18:05:33,782 INFO WCS4Handler - DISCONNECT-CLIENT-pool-22-thread-16
[-- BEGIN CLIENT LOG --]
CONF: ClientConfig{rtspMedia=false, wsTunnel=false, login='jn5h4as2jcs09aknakghsclvv1', authenticationName='null', password='null', domain='null', outboundProxy='null', localPort=-1, port=0, visibleName='null', regRequired=false, applicationName='null', swfUrl='null', useProxy=true, qValue='null', pAssociatedUri='null', contactParams='null', authDate=Mon Mar 19 15:31:27 IST 2018, authToken='/192.168.1.128:35476/192.168.1.73:8443', logsFolderName='null', clientVersion='0.5.27', clientOSVersion='5.0 (Linux; Android 5.1.1; 2014818 Build/LMY47V) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.109 Mobile Safari/537.36', clientBrowserVersion='Mozilla/5.0 (Linux; Android 5.1.1; 2014818 Build/LMY47V) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.109 Mobile Safari/537.36', wsTunnelPacketization2='false', custom='{origin=https://192.168.1.73:8888}'}
IMPL: WSClient{channel=[id: 0x065dd02e, /192.168.1.128:35476 => /192.168.1.73:8443], handler=com.flashphoner.server.client.handler.DelegateHandler@2fb14d8b, closed=true, pageUrl='null', countUnansweredPing=11}
LOGS:
Client didn't pushed logs to server, try to enable push_log at client side.
[-- END CLIENT LOG ----]
18:05:33,839 INFO WCS4Handler - DISCONNECT-CLIENT-pool-22-thread-16 Report client-jn5h4as2jcs09aknakghsclvv1-2018.03.19.18.05.33-1521462933815.report is submitted
 

Max

Administrator
Staff member
1. Make sure your Youtube stream name is set as publishing stream name.
https://forum.flashphoner.com/attachments/youtube-streaming-wcs-publishing-jpg.763/
2. Make sure you have correct REST command
https://forum.flashphoner.com/attachments/youtube-streaming-rest-api-command-jpg.764/
3. Checkout our docs to see REST command format:
https://forum.flashphoner.com/attachments/youtube-webrtc-push-startup-jpg.765/
https://flashphoner.com/docs/wcs5/wcs_docs/html/en/wcs-rest-api/index.html?examples.htm
4. Make sure RTMP prefix is disabled in flashphoner.properties (line is commented)
Code:
#rtmp_transponder_stream_name_prefix =rtmp_
https://forum.flashphoner.com/attachments/youtube-streaming-flashphoner-properties-jpg.767/
 

Max

Administrator
Staff member
From your screenshots we can see that the demo server was unavailable during your testing.
Please try again. If it does not work please deploy WCS server on a public static IP. We will check over SSH.
You can send SSH details to logs@flashphoner.com
 

Rahul Prasad

New Member

Max

Administrator
Staff member
But issue is we couldn't able to live stream simultaneously to facebook and youtube. If we are going to use stream name of either facebook or youtube . How we are going to live stream to both.
You can't stream to youtube and facebook simultaneously because by default WCS server publish the same stream name as received.
So if you published name / stream key as 'xyz', it will be used both for youtube and facebook and obviously it is incorrect because yt and fb have different stream keys.

Solution
Add setting in flashphoner.properties
Code:
rtmp_transponder_full_url=true
This setting allows re-publishing with full RTMP URL
https://flashphoner.com/docs/wcs5/w...f_directory-flashphoner_properties_config.htm

Then use full url in /push/startup method.
Example for YouTube:
Code:
http://wcs5-eu.flashphoner.com:9091/rest-api/push/startup
{
"streamName": "123",
"rtmpUrl":"rtmp://a.rtmp.youtube.com/live2/sdfz-r4g5-z7cf-frh7"
}
Example for Facebook
Code:
http://wcs5-eu.flashphoner.com:9091/rest-api/push/startup
{
"streamName": "123",
"rtmpUrl":"rtmp://rtmp.facebook.com/live2/xyz-zxc"
}
Here
123 - stream name publishing to WCS server
rtmp://a.rtmp.youtube.com/live2/sdfz-r4g5-z7cf-frh7 - youtube full url including stream key
rtmp://rtmp.facebook.com/live2/xyz-zxc - facebook full url including stream key
 

Max

Administrator
Staff member
It has been confirmed that stream can be pushed simultaneously to YouTube and Facebook both with 2884 and latest 2940. If the issue with streaming to Facebook is reproducible, please send credentials for ssh access and to the dashboard to logs@flashphoner.com.
 

Max

Administrator
Staff member
Hello,

The dashboard can't be reached.
Please verify that the required ports are open on a firewall or NAT.

Test
Code:
telnet host 8443
telnet host 8888
telnet host 8080
telnet host 9091
The ports should be reachable.

Also, for server configuration ssh access is required.
 

Parvej

New Member
We have checked your framework and as well as the demo application by following link, it is working when we are directly running it (by installing pod and following your instructions)

Link:

Framework: https://flashphoner.com/downloads/builds/flashphoner_client/wcs-ios-sdk/WCS-iOS-SDK-2.5.0.tar.gz

Demo code: https://github.com/flashphoner/wcs-ios-sdk-samples



But as per recent technology we are using swift 4,

  1. when we have added your framework directly to swift by (import FPWCSApi2) we can not import your framework, we are getting this “No such module 'FPWCSApi2'”
  2. When we are trying by bridging header we are getting following error:


CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler

cd /Users/manabkumarmal/Desktop/TempProjects/LiveStream

export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer

export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"

export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -incremental -module-name LiveStream -Onone -enforce-exclusivity=checked -DDEBUG -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk -target arm64-apple-ios10.0 -g -module-cache-path /Users/manabkumarmal/Library/Developer/Xcode/DerivedData/ModuleCache -Xfrontend -serialize-debugging-options -embed-bitcode-marker -enable-testing -index-store-path /Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Index/DataStore -Xfrontend -report-errors-to-debugger -swift-version 4 -I /Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Products/Debug-iphoneos -F /Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Products/Debug-iphoneos -F /Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Products/Debug-iphoneos/JSONModel -F /Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Products/Debug-iphoneos/SocketRocket -F /Users/manabkumarmal/Desktop/TempProjects/LiveStream -c -j4 /Users/manabkumarmal/Desktop/TempProjects/LiveStream/LiveStream/ViewController.swift /Users/manabkumarmal/Desktop/TempProjects/LiveStream/LiveStream/AppDelegate.swift -output-file-map /Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Intermediates.noindex/LiveStream.build/Debug-iphoneos/LiveStream.build/Objects-normal/arm64/LiveStream-OutputFileMap.json -parseable-output -serialize-diagnostics -emit-dependencies -emit-module -emit-module-path /Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Intermediates.noindex/LiveStream.build/Debug-iphoneos/LiveStream.build/Objects-normal/arm64/LiveStream.swiftmodule -Xcc -I/Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Intermediates.noindex/LiveStream.build/Debug-iphoneos/LiveStream.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Intermediates.noindex/LiveStream.build/Debug-iphoneos/LiveStream.build/LiveStream-generated-files.hmap -Xcc -I/Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Intermediates.noindex/LiveStream.build/Debug-iphoneos/LiveStream.build/LiveStream-own-target-headers.hmap -Xcc -I/Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Intermediates.noindex/LiveStream.build/Debug-iphoneos/LiveStream.build/LiveStream-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Intermediates.noindex/LiveStream.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Intermediates.noindex/LiveStream.build/Debug-iphoneos/LiveStream.build/LiveStream-project-headers.hmap -Xcc -I/Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Products/Debug-iphoneos/include -Xcc -I/Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Intermediates.noindex/LiveStream.build/Debug-iphoneos/LiveStream.build/DerivedSources/arm64 -Xcc -I/Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Intermediates.noindex/LiveStream.build/Debug-iphoneos/LiveStream.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -DCOCOAPODS=1 -emit-objc-header -emit-objc-header-path /Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Intermediates.noindex/LiveStream.build/Debug-iphoneos/LiveStream.build/Objects-normal/arm64/LiveStream-Swift.h -import-objc-header /Users/manabkumarmal/Desktop/TempProjects/LiveStream/LiveStream-Bridging-Header.h -pch-output-dir /Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Intermediates.noindex/PrecompiledHeaders -Xcc -working-directory/Users/manabkumarmal/Desktop/TempProjects/LiveStream



<unknown>:0: error: generate-pch command failed with exit code 1 (use -v to see invocation)

Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1

So, our humble request is please guide us how to import your framework in Swift 4 instead of Objective C. Also if you can provide demo application made in Swift 4, then it will help to make my desired feature with your framework.



We are using this:
IDE: Xcode (9.2)

Language: Swift 4.0

Project Name: LiveStream

Bridging Header Name(when we are using bridging header): LiveStream-Bridging-Header.h
 

Max

Administrator
Staff member
Hello
Could you please create a new thread and provide a Swift sample with step-by-step building description?
 

Manab Kumar Mal

New Member
Hi Team,

We have checked your framework and as well as the demo application by following link, it is working when we are directly running it (by installing pod and following your instructions)

Link:

Framework: https://flashphoner.com/downloads/builds/flashphoner_client/wcs-ios-sdk/WCS-iOS-SDK-2.5.0.tar.gz

Demo code: https://github.com/flashphoner/wcs-ios-sdk-samples



But as per recent technology we are using swift 4,

  1. when we have added your framework directly to swift by (import FPWCSApi2) we can not import your framework, we are getting this “No such module 'FPWCSApi2'”
  2. When we are trying by bridging header we are getting following error:


CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler

cd /Users/manabkumarmal/Desktop/TempProjects/LiveStream

export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer

export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"

export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -incremental -module-name LiveStream -Onone -enforce-exclusivity=checked -DDEBUG -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk -target arm64-apple-ios10.0 -g -module-cache-path /Users/manabkumarmal/Library/Developer/Xcode/DerivedData/ModuleCache -Xfrontend -serialize-debugging-options -embed-bitcode-marker -enable-testing -index-store-path /Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Index/DataStore -Xfrontend -report-errors-to-debugger -swift-version 4 -I /Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Products/Debug-iphoneos -F /Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Products/Debug-iphoneos -F /Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Products/Debug-iphoneos/JSONModel -F /Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Products/Debug-iphoneos/SocketRocket -F /Users/manabkumarmal/Desktop/TempProjects/LiveStream -c -j4 /Users/manabkumarmal/Desktop/TempProjects/LiveStream/LiveStream/ViewController.swift /Users/manabkumarmal/Desktop/TempProjects/LiveStream/LiveStream/AppDelegate.swift -output-file-map /Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Intermediates.noindex/LiveStream.build/Debug-iphoneos/LiveStream.build/Objects-normal/arm64/LiveStream-OutputFileMap.json -parseable-output -serialize-diagnostics -emit-dependencies -emit-module -emit-module-path /Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Intermediates.noindex/LiveStream.build/Debug-iphoneos/LiveStream.build/Objects-normal/arm64/LiveStream.swiftmodule -Xcc -I/Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Intermediates.noindex/LiveStream.build/Debug-iphoneos/LiveStream.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Intermediates.noindex/LiveStream.build/Debug-iphoneos/LiveStream.build/LiveStream-generated-files.hmap -Xcc -I/Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Intermediates.noindex/LiveStream.build/Debug-iphoneos/LiveStream.build/LiveStream-own-target-headers.hmap -Xcc -I/Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Intermediates.noindex/LiveStream.build/Debug-iphoneos/LiveStream.build/LiveStream-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Intermediates.noindex/LiveStream.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Intermediates.noindex/LiveStream.build/Debug-iphoneos/LiveStream.build/LiveStream-project-headers.hmap -Xcc -I/Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Products/Debug-iphoneos/include -Xcc -I/Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Intermediates.noindex/LiveStream.build/Debug-iphoneos/LiveStream.build/DerivedSources/arm64 -Xcc -I/Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Intermediates.noindex/LiveStream.build/Debug-iphoneos/LiveStream.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -DCOCOAPODS=1 -emit-objc-header -emit-objc-header-path /Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Intermediates.noindex/LiveStream.build/Debug-iphoneos/LiveStream.build/Objects-normal/arm64/LiveStream-Swift.h -import-objc-header /Users/manabkumarmal/Desktop/TempProjects/LiveStream/LiveStream-Bridging-Header.h -pch-output-dir /Users/manabkumarmal/Library/Developer/Xcode/DerivedData/LiveStream-frzcojdevuuthchewhsviuofoqeb/Build/Intermediates.noindex/PrecompiledHeaders -Xcc -working-directory/Users/manabkumarmal/Desktop/TempProjects/LiveStream



<unknown>:0: error: generate-pch command failed with exit code 1 (use -v to see invocation)

Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1

So, our humble request is Please guide us how to import your framework in Swift 4 instead of Objective C. Also if you can provide demo application made in Swift 4, then it will help to make my desired feature.



We are using this:
IDE: Xcode (9.2)

Language: Swift 4.0

Project Name: LiveStream

Bridging Header Name(when we are using bridging header): LiveStream-Bridging-Header.h
 

Parvej

New Member
For demo, wcs5-eu.flashphoner.com currently has the latest version (2948) and rtmp_transponder_full_url property set to true: push to Facebook is working.
We have to show a demo to the client we are almost done with the application please reopen your rtmp_transponder_url other wise we are not able to show the demo. This is our final demo after this we will purchase the yearly package.
 
Top