johanlantz / pj-nat64 Goto Github PK
View Code? Open in Web Editor NEWHelpers for NAT64 handling pending official solutions from pjsip
License: MIT License
Helpers for NAT64 handling pending official solutions from pjsip
License: MIT License
Hi johanlantz,
Many thanks for your code. But can you give me some instructions to integrate your code with my client pjsip to solve ipv6 problems.
Thanks for your help !
We are not able to make a call to some networks on their LTE network.
Call-ID: CwFphy4PUdJxcLeCutjML81MSAB2Aj3a
CSeq: 5523 INVITE
Route: sip:udp9000.azhsbc.solint.net:9000;transport=udp;lr
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Supported: replaces, 100rel, timer, norefersub
Session-Expires: 7200
Min-SE: 90
User-Agent: CrexmoUA iOS v3.1.3
Proxy-Authorization: Digest username="3141", realm="486709.crexendo.com", nonce="39689fa8-22e6-450a-83b9-e4406d25a4af", uri="sip:[email protected]", response="92edb72701fc29ab2acf82a539de1145", algorithm=MD5, cnonce="BzzyCmhWkRkL4esDmhsgcFgBQIyVR9Ti", qop=auth, nc=00000001
Content-Type: application/sdp
Content-Length: 432
v=0
o=- 3823177254 3823177254 IN IP4 192.168.1.1
s=pjmedia
b=AS:117
t=0 0
a=X-nat:0
m=audio 11780 RTP/AVP 0 125 97 105 101
c=IN IP4 192.168.1.1
b=TIAS:96000
a=rtcp:11781 IN IP4 192.168.1.1
a=sendrecv
a=rtpmap:0 PCMU/8000
a=rtpmap:125 opus/48000/2
a=fmtp:125 useinbandfec=1
a=rtpmap:97 iLBC/8000
a=fmtp:97 mode=30
a=rtpmap:105 SILK/8000
a=fmtp:105 useinbandfec=0
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
ipv6_mod_on_tx
Outgoing INVITE or 200 OK. If it contains IPv6 addresses, we need to change to ipv4
Outgoing INVITE or 200 with IPv6 address***
Scanner syntax error at
error: Parsing of the outgoing INVITE/200 OK failed at . Leave incoming buffer as is
SIPUA_CallStateChanged sipstate=6 status=408
IPUA call state change from 1 to 7 on 0x<CallLogWrapper: 0x283130480>
This is what we are getting in logs. This happens only in some of the network providers (e.g TMobile) with rest of the network it works fine. Please help me to understand what went wrong.
2016-08-03 15:59:10.368 White Calling[1363:589121] void pjsua_log_cb(int, const char *, int) line 300 $ 4: 15:59:10.365 pjsua_core.c ....TX 1118 bytes Request msg INVITE/cseq=1296 (tdta0x13d988800) to TLS 64:ff9b::c308:60ac:5061:
INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/TLS [2001:2::aab1:4054:c5e0:9ec0:f674]:50099;rport;branch=z9hG4bKPjmsE4Ooa4hGK9AxKNRxeuqrXfingP-iBq;alias
Max-Forwards: 70
From: sip:[email protected];tag=4b07VI3HOfXQZK8A81.wlsAO7vY9liSk
To: sip:[email protected]
Contact: sip:2c0e447a7ac1b493bbbcd1a21_447800000005@[2001:2::aab1:4054:c5e0:9ec0:f674]:50099;transport=TLS;ob
Call-ID: PkuGH24FhF6BxkGpRL5y-he1vRnXdHn9
CSeq: 1296 INVITE
Route: sip:[64:ff9b::c308:60ac]:5061;transport=tls;lr
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Supported: replaces, 100rel, norefersub
Content-Type: application/sdp
Content-Length: 346
v=0
o=- 3679243150 3679243150 IN IP4 25.96.255.115
s=pjmedia
b=AS:84
t=0 0
a=X-nat:0
m=audio 4000 RTP/AVP 104 0 8 96
c=IN IP4 25.96.255.115
b=TIAS:64000
a=rtcp:4001 IN IP4 25.96.255.115
a=sendrecv
a=rtpmap:104 iLBC/8000
a=fmtp:104 mode=30
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:96 telephone-event/8000
a=fmtp:96 0-16
--end msg--
2016-08-03 15:59:10.371 White Calling[1363:589121] void pjsua_log_cb(int, const char , int) line 300 $ 4: 15:59:10.368 pj-nat64.c ....ipv6_mod_on_tx
2016-08-03 15:59:10.374 White Calling[1363:589121] void pjsua_log_cb(int, const char *, int) line 300 $ 4: 15:59:10.371 pj-nat64.c ....Outgoing INVITE or 200 OK. If it contains IPv6 addresses, we need to change to ipv4
2016-08-03 15:59:10.377 White Calling[1363:589121] void pjsua_log_cb(int, const char *, int) line 300 $ 4: 15:59:10.374 pj-nat64.c ....******_Outgoing INVITE or 200 with IPv6 address_**********
2016-08-03 15:59:10.380 White Calling[1363:589121] void pjsua_log_cb(int, const char *, int) line 300 $ 4: 15:59:10.377 pj-nat64.c ....Scanner syntax error at
2016-08-03 15:59:10.383 White Calling[1363:589121] void pjsua_log_cb(int, const char *, int) line 300 $ 1: 15:59:10.380 pj-nat64.c ....Error: Parsing of the outgoing INVITE/200 OK failed at . Leave incoming buffer as is
Hi ,
I checked with this steps https://stackoverflow.com/questions/43915256/pjsip-registration-to-ipv4-server-from-nat64-network-in-ios
I had done :
Download the pj-nat64 source from above link.
Unzip the file and copy pj-nat64.c file paste into the pjproject (means pjsip source) (path is: pjsip/src/pjsua-lib)
Copy pj-nat64.h file paste into the pjproject (means pjsip source) (path is: pjsip/include/pjsua-lib)
Need to add the pj-nat64.o in the makefile of pjsip (Make file path is: pjsip/build) -- I am confused about this step. How should I add this into makefile in my objective C code.
Hi
I'm trying to activate the nat64 module the way you recommend it, by checking the transport type in registration callback.
However, I cannot get pjsua to connect to IPv6 without explicitly specifying the IPv6 transport to the account
doing like the pjsip wiki, acc_cfg.transport_id = tcp6_tp_id before adding account
Do you manage to get pjsip to smart automatically select the IPv6 (or IPv4) transport ?
Hi.
I integrate your code with my pjsip project, but I have a issue.
I register module, but it doesn't work! And I need do some other setting? Here is my code.
status = pjsua_start();
if (status != PJ_SUCCESS) {
CLog(@"pjsua_start error...");
return ;
}
pj_nat64_enable_rewrite_module();
pjsua_acc_config acc_cfg;
pjsua_acc_config_default(&acc_cfg);
acc_cfg.reg_retry_interval = 10;
acc_cfg.id = pj_str((char *)[NSString stringWithFormat:@"sip:%@@%@", username, server].UTF8String);
acc_cfg.reg_uri = pj_str((char *)[NSString stringWithFormat:@"sip:%@", server].UTF8String);
acc_cfg.cred_count = 1;
acc_cfg.cred_info[0].scheme = pj_str("digest");
acc_cfg.cred_info[0].realm = pj_str("*");
acc_cfg.cred_info[0].username = pj_str((char *)username.UTF8String);
acc_cfg.cred_info[0].data_type = PJSIP_CRED_DATA_PLAIN_PASSWD;
acc_cfg.cred_info[0].data = pj_str((char *)password.UTF8String);
acc_cfg.transport_id = tp_id;
acc_cfg.ipv6_media_use = PJSUA_IPV6_ENABLED;
pjsua_acc_add(&acc_cfg, PJ_TRUE, &acc_id);
Hi
Many thanks for your code I'm trying to integrate !
I'm facing a first issue. I will go deeper by myself but here it is:
When receiving an incoming call
replace_sdp_ipv4_with_ipv6 is called,
-ipv4 addresses are correctly parsed detected
-IP4 gets replaced by IP6
but the ipv4 addresses are not replaced, ie I have in the modified message:
o=FreeSWITCH 1466244684 1466244685 IN IP6 192.168.1.124
s=FreeSWITCH
c=IN IP6 192.168.1.124
t=0 0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.