How use Linphone SDK with Asterisk?
Work I did yet,
- Install asterisk in Ubuntu(Guest OS)
- Install Linphone exe on my Host OS(Windows)
- Use PJSIP for creating an extension
- Register those extensions(Only 2 extension for test only) in Linphone
- Make a call and check audio is coming and going clearly, And It is perfect
What I have to do now,
- Now as I can see on Linphone(http://www.linphone.org/technical-corner/linphone) we can use sdk for making a custom app
- I want to make python script using that I can take stream audio
- So using Linphone app I make calls using Asterisk server but to take audio stream I want python script
See also questions close to this topic
-
How to generate multiple Dash App (and URLs) programmatically?
I have a simple Dash app with a choropleth map along with a simple dropdown. The data is sourced from a pandas dataframe and contains a few different metrics for each US state.
I'd like to reproduce this standard layout for each of the US state but here's the problem:
- I'd like to avoid having to create 50 different dash apps (it doesn't look really practical neither scalable)
- I don't want to have a dropdown for users to select the state: the goal is to have multiple URLs, one for each state (mostly for search engine purposes).
I was thinking of passing the US state as a URL parameter: I'd use this variable to filter the dataframe (limiting the dataframe scope will automatically make the choropleth zoom to the relevant state). However this is problematic since:
- Dash doesn't allow to set a default base URL for the app (at least as far as I could tell)
- The df cleaning/filtering happens before I can call the flask instance in Dash (this would be easily solvable though) as well as the app URL.
I wanted to do this all within Dash for practicality but I guess I'd need to rely on Flask/Django for the actual scaffolding and pull in Dash content from there?
-
Enumerate out of range?
here's the image that shows the X and i variable
for i, x in enumerate(X): #print(i) #print(x) w = som.winner(x)
here's the code
-
Converting large CSV to JSON in AWS Lambda using python
I have a lambda function which takes an incoming csv file and converts it to JSON. But this is only working on a small file. When I tested with a large file (1GB) it failed with an out of disk space error. I've been searching for ways around this and have read about the boto streaming option. But I'm struggling with how to code for this, since I'm very new to python. Can anyone give me some pointers with this?
Are there any better ways to accomplish my task...converting a large csv to json in lambda using python. Thanks!!
s3_object = s3.get_object(Bucket=bucket, Key=key) data = s3_object['Body'].read() contents = data.decode('utf-8') print(type(filename_csv)) print(type(key)) with open(filename_csv, 'a') as csv_data: csv_data.write(contents) with open(filename_csv) as csv_data: csv_reader = c1.DictReader(csv_data) with open(filename_json, 'a') as output_file: for csv_row in csv_reader: json.dump(csv_row, output_file) output_file.write('\n') with open(filename_json, 'r') as json_file_contents: response = s3.put_object(Bucket=bucket, Key=keyname_s3, Body=json_file_contents.read())
-
what should my extension code sequence if I want answer in live calling?
Hello I am implementing speech to text in asterisk 16. I will use python for AGI program. I know some little bit about asterisk, but My current task is to convert audio into text using Google SPEECH to TEXT API which I'll integrate in my python code.
But before I start my python code what should my extensions.conf code if I have to transcribe on live call.
;Simple speech recognition exten => 1234,1,Answer() exten => 1234,n,agi(speech-recog.agi,en-US) exten => 1234,n,Verbose(1,The text you just said is: ${utterance}) exten => 1234,n,Verbose(1,The probability to be right is: ${confidence}) exten => 1234,n,Hangup()
I got one this reference but my doubt is once answer() executed and It'll transfer from asterisk to my agi script/external program then How can I get audio/raw data in real time?
the above script is reference of this repository https://zaf.github.io/asterisk-speech-recog
so my question is simple I need raw data as audio or I'll convert them into audio once I get into agi script and send that audio to Google Speech to Text api. But for real time or live call what should my extension.conf code.
-
Can I create new SIP account in JSSIP without going into the asterisk server?
I am a beginner creating a WebRTC app using JsSIP.
How can I create a new SIP account without going to the asterisk server?
Is it the
UserAgent.register()
ornew JsSip.Uri
-
Asterisk sip trunk peer NIC
I'm working with Asterisk 14.7.6 and Freepbx 14.0.13.23 in a ec2 instance on AWS
At this moment I have a sip trunk with 3CX server working, I need to make another one with the same one.
I have had an idea of add another NIC in the asterisk and add
externip
parameter in the sip.conf file to add anocher sip trunk and I did it. When I puted sip show peers in the asterisk console, it shows "Status OK (100 ms)" but in 3CX the traffic incoming was from the first trunk.It's possible create this kind of sip trunk? or I need to launch another machine create a kind of bridge between my asterisk and 3CX?
Thanks,
-
How to extract call history and sms in jailbroken iPhone using swift app?
I want to see jailbroken iPhone call history and sms details inside a swift app. I have searched through many sites, still not showing any relevant answer. When I checked whether this file path exists, "private/var/wireless/Library/CallHistory/call_history.db" showing the false result.
My iPhone is jailbroken. Disabled sandbox in entitlements. Xcode using is 12.2
-
Making a phone call without changing the activity inside my application
I am making a voice driven Android application. I just need to allow the users to place an outgoing call through my application in the same activity without changing the activity. I have seen applications with its own UI while on the call. But they still change the activity to ACTION_CALL while call is triggered. Is it possible to make a phone call without changing the activity inside my application?
-
Using Link control with JSON (SwiftUI)
I'm trying to use the Link control in my SwiftUI View, that takes data from a JSON file.
Here's the code:
import SwiftUI import URLImage struct ContactsDetail: View { var busso: BussoModel var body: some View { ScrollView { URLImage(URL(string: busso.fotoUrl) ?? furl) .resizable() .aspectRatio(contentMode: .fit) .clipped() .padding(.bottom) Text(busso.testo) .font(.body) .padding(.bottom) Link(busso.extra1, destination: URL(string: busso.extra1)!) .font(.headline) .foregroundColor(Color(red: 133.0/255.0, green: 114.0/255.0, blue: 159.0/255.0)) .padding(.bottom) Link(busso.extra2, destination: URL(string: busso.extra2)!) .font(.headline) .foregroundColor(Color(red: 133.0/255.0, green: 114.0/255.0, blue: 159.0/255.0)) } .padding(.top, 8) .navigationTitle(busso.titolo) .navigationBarTitleDisplayMode(.large) } } struct ContactsDetail_Previews: PreviewProvider { static var previews: some View { ContactsDetail(busso: BussoModel.init(id: String(), titolo: String(), autore: String(), testo: String(), data: String(), extra1: String(), extra2: String(), foto: String(), fotoUrl: String())) } }
If I set Link the way you see in the code, the selected JSON fields ("extra1" and "extra2", respectively phone number and mail) appears in the View and I can tap on them, but they don't work...so I changed the code in this way:
Link(busso.extra1, destination: URL(string: "tel:busso.extra1")!) Link(busso.extra2, destination: URL(string: "mailto:busso.extra2")!)
Now I can tap on them...and they work, but not correctly: in fact, tapping on "extra1" I can call "busso.extra1" and not the phone number (a string) contained in that JSON field...same thing for "extra2", I can send a mail to "busso.extra2" and not the mail address (also a string) contained in that JSON field...
It is obvious that something in the code is wrong, what changes should I make? Thanks!
-
Setting displayname for existing account on linphone iOS
What I wanted is to change displayname of already saved account without need of going to settings view controlelr. Say for example a button placed on dialerview . I am trying to get existing auth information and set displayname and create new auth and proxy and clear old .
Can you suggest if there is an easy way or a single line call to set diplayname . I tried below . It is changing display name but I have to visit settings account page and come back in order to make call otherwise it says Request Time out after changing display name .
NSString *tmpusr = [self getCurrentUsername]; NSString *tmppwd = [self getCurrentPassword]; NSString *tmpdom = [self getCurrentDomain]; int tmpport = [self getPort]; NSLog(@"current_user:%@ current_password:%@ current_domain: %@ current_Port: %d",tmpusr,tmppwd,tmpdom,tmpport); LinphoneProxyConfig *new_config = linphone_core_get_default_proxy_config(LC); if (new_config != NULL) { NSLog(@"Found existing proxy configuration and attempt to remove"); const LinphoneAuthInfo *auth = linphone_proxy_config_find_auth_info(new_config); linphone_core_remove_proxy_config(LC, new_config); if (auth) { linphone_core_remove_auth_info(LC, auth); } } LinphoneProxyConfig *config = linphone_core_create_proxy_config(LC); LinphoneAddress *addr = linphone_address_new(NULL); LinphoneAddress *tmpAddr = linphone_address_new([NSString stringWithFormat:@"sip:%@",tmpdom].UTF8String); if (tmpAddr == nil) { [self displayError]; return; } linphone_proxy_config_set_server_addr(config,[NSString stringWithFormat:@"sip:%s:%s",tmpdom.UTF8String,[NSString stringWithFormat:@"%i", tmpport].UTF8String].UTF8String); linphone_proxy_config_set_route( config, [NSString stringWithFormat:@"%s;transport=%s", tmpdom.UTF8String, @"udp".lowercaseString.UTF8String] .UTF8String); linphone_address_set_username(addr, tmpusr.UTF8String); linphone_address_set_port(addr, linphone_address_get_port(tmpAddr)); linphone_address_set_domain(addr, tmpdom.UTF8String); linphone_address_set_display_name(addr, textField.text.UTF8String); linphone_proxy_config_set_identity_address(config, addr); linphone_proxy_config_enable_publish(config, FALSE); linphone_proxy_config_enable_register(config, TRUE); LinphoneAuthInfo *info = linphone_auth_info_new(tmpusr.UTF8String, // username NULL, // user id tmppwd.UTF8String, // passwd NULL, // ha1 linphone_address_get_domain(addr), // realm - assumed to be domain linphone_address_get_domain(addr) // domain ); linphone_core_add_auth_info(LC, info); linphone_address_unref(addr); //linphone_address_unref(tmpAddr); if (config) { [[LinphoneManager instance] configurePushTokenForProxyConfig:config]; if (linphone_core_add_proxy_config(LC, config) != -1) { linphone_core_set_default_proxy_config(LC, config); // reload address book to prepend proxy config domain to contacts' phone number // todo: STOP doing that! // [[LinphoneManager.instance fastAddressBook] fetchContactsInBackGroundThread]; } } //tried if sync settings may fix issue but it didnt // LinphoneCoreSettingsStore *settingsStore; // [settingsStore synchronizeAccounts];
-
Is there Java Desktop Wrapper for Linphone SIP client?
I want to use Linphone API for my softphone, is there a java desktop wrapper available for this platform. Not android java. Thanks
-
SIP Registration Not working in linphone - ios
We used linphone ios for the SIP register and VOIP calls. we used the below code for the SIP Registration but "onRegister"(Registration State Functions) not called. we are using compiled linphone SDK not used pod of linphone.
- (BOOL)sipConnect { BOOL returnVal; NSString *domain = hostName; NSString *domain_proxy = hostName_proxy; NSString *username = sip_username; NSString *displayName = sip_username; NSString *pwd = sip_password; LinphoneProxyConfig *config = linphone_core_create_proxy_config(LC); LinphoneAddress *addr = linphone_address_new(NULL); LinphoneAddress *tmpAddr = linphone_address_new([NSString stringWithFormat:@"sip:%@",domain].UTF8String); if (tmpAddr == nil) { return true; } linphone_address_set_username(addr, username.UTF8String); linphone_address_set_port(addr, linphone_address_get_port(tmpAddr)); linphone_address_set_domain(addr, linphone_address_get_domain(tmpAddr)); if (displayName && ![displayName isEqualToString:@""]) { linphone_address_set_display_name(addr, displayName.UTF8String); } linphone_proxy_config_set_identity_address(config, addr); if ([domain_proxy isEqualToString:@""] || domain_proxy == nil || domain_proxy.length == 0) { domain_proxy = domain; } else { } if(prtocolName) { if([prtocolName isEqualToString:@"UDP"]) linphone_address_set_transport(tmpAddr, LinphoneTransportUdp); else if ([prtocolName isEqualToString:@"TCP"]) linphone_address_set_transport(tmpAddr, LinphoneTransportTcp); else if ([prtocolName isEqualToString:@"TLS"]) linphone_address_set_transport(tmpAddr, LinphoneTransportTls); } const char *serverAndRoute = linphone_address_as_string_uri_only(tmpAddr); linphone_proxy_config_set_server_addr(config, serverAndRoute); linphone_proxy_config_set_route(config, serverAndRoute); linphone_address_unref(tmpAddr); if (prtocolName) { NSString *type = prtocolName; int linphone_set_route = linphone_proxy_config_set_route( config, [NSString stringWithFormat:@"%s;transport=%s", (char *)domain_proxy.UTF8String, type.lowercaseString.UTF8String] .UTF8String); int linphone_set_server_addr = linphone_proxy_config_set_server_addr( config, [NSString stringWithFormat:@"%s;transport=%s", domain_proxy.UTF8String, type.lowercaseString.UTF8String] .UTF8String); if (linphone_set_route == -1 || linphone_set_server_addr == -1) { NSDictionary *dict_obj = [[NSDictionary alloc] initWithObjectsAndKeys:str_Title_300,@"Title", @"Please enter valid proxy address",@"Description",nil]; [[NSNotificationCenter defaultCenter] postNotificationName:@"LoginError" object:dict_obj]; return NO; } } linphone_proxy_config_enable_publish(config, FALSE); linphone_proxy_config_enable_register(config, TRUE); LinphoneAuthInfo *info = linphone_auth_info_new(linphone_address_get_username(addr), // username NULL, // user id pwd.UTF8String, // passwd NULL, // ha1 linphone_address_get_domain(addr), // realm - assumed to be domain linphone_address_get_domain(addr) // domain ); linphone_core_add_auth_info(LC, info); linphone_address_unref(addr); linphone_address_unref(tmpAddr); if (config) { [[LinphoneManager instance] configurePushTokenForProxyConfig:config]; if (linphone_core_add_proxy_config(LC, config) != -1) { linphone_core_set_default_proxy_config(LC, config); [[LinphoneManager.instance fastAddressBook] fetchContactsInBackGroundThread]; if (linphone_core_get_default_proxy_config(LC)) { linphone_core_refresh_registers(LC); returnVal = FALSE; goto returnhere; } } else { [self clearProxyConfig]; [self sipDisconnect]; } } else { } returnhere: return returnVal; }
so please help me to resolve this SIP registration issue and if anything missing from my side then ask me. Currently using the above code SIP registration not working.
Thank you.