Infactum / tg2sip

Telegram <-> SIP voice gateway
GNU General Public License v2.0
273 stars 104 forks source link

Could you please provide an example of minimal PJSIP configuration? #42

Closed sergei-mironov closed 3 years ago

sergei-mironov commented 3 years ago

Hi, I'm not an Asterisk neither a SIP expert, but still want to setup a simple voice-telegram relay. Could you please provide an example PJSIP configuration?

sergei-mironov commented 3 years ago

The related issue is https://github.com/Infactum/tg2sip/issues/15. AFAIK the manual mentioned there provides the configuration for SIP Asterisk module, while I'm asking for PJSIP one. BR

Infactum commented 3 years ago

I'm also not an Asterisk expert. You could try to ask help in some VoIP related telegram groups - here for example.

sergei-mironov commented 3 years ago

Got it, thanks. Will ask Asterisk guys.

sergei-mironov commented 3 years ago

Updated I've sketched a configuration prototype and tried to run it. Tg2sip does show some reaction, but the communication is not yet establised. The error from tg2sip's side is Request verification failed: Not Acceptable Here [status=170488] and I also see a warning mentioning codecs. @Infactum could you please have a look at https://community.asterisk.org/t/help-translating-a-simple-peer-config-to-pjsip/86601/4 ? What should I possibly change in configs?

Infactum commented 3 years ago

I think you should comapre INVITE SDP between pjsip and old asterisk sip config.

sergei-mironov commented 3 years ago

So here is the log of the connection using older chan_sip of Asterisk. Unfortunately, the problem is the same Request verification failed: Not Acceptable Here [status=170488], plus codec warning.

https://gist.github.com/grwlf/cd78f2581c71125fa8b026fb66bb6ae5

Also I've noticed that someone mentioned the same error in the comments to the original setup guide. Do you have any ideas? https://voxlink.ru/kb/asterisk-configuration/ustanovka-i-nastrojka-sip-shljuza-dlja-telegram/#comment-908

sergei-mironov commented 3 years ago

Does tg2sip use codec directly or relies to pjsip instead?

sergei-mironov commented 3 years ago

Update: So it looks like the problem was related to my PJSIP installation which had opus codec disabled. After enabling it the 'not acceptable here' problem seems gone.

But I see next issue, which is

[15:00:03.039][t:13070][p:13064][pjsip][trace] State changed from Trying to Proceeding, event=TX_MSG                                                                                                                                                 
[15:00:03.039][t:13070][p:13064][pjsip][trace] Transaction tsx0x7fc734005e28 state changed to Proceeding                                                                                                                                             
[15:00:03.039][t:13064][p:13064][core][debug] [13064-1] associated with SIP#0                                                                                                                                                                        
[15:00:03.046][t:13064][p:13064][core][warning] [13064-1] called invalid extension  

Update2: called invalid extension problem is also sovled. It was the wrong sip address format.

Finally, I now have working Asterisk+tg2sip configuration which is based on chan_sip, but setting up chan_pjsip is yet to be done..

sergei-mironov commented 3 years ago

Finally I came to this config https://community.asterisk.org/t/help-translating-a-simple-peer-config-to-pjsip/86601/5?u=grwlf