Author Topic: outgoing sip call unauth error  (Read 8359 times)

h4ckerm4n

  • Newbie
  • *
  • Posts: 2
    • View Profile
outgoing sip call unauth error
« on: February 01, 2019, 11:10:22 AM »
I am having trouble with making an outbound call to an external non yate sip server as it results in hanging up the call with reason noauth although I successfully registered to the sip server. However, making an call from a zoiper sip client to the internal ms via the external sip server works perfectly fine. Moreover, when I replace this external non yate sip server with a sip server running on another raspberry pi, I CAN make calls in both direction. Therefore, I assume there is some sip parameter mismatch, but how am i able to debug that (if this assumption is correct)? My log is down below which contains the successful sip registration and the call that hangs up immediately. All help is appreciated!

https://we.tl/t-3ps9VpknR5

Monica Tepelus

  • Administrator
  • Full Member
  • *****
  • Posts: 198
    • View Profile
Re: outgoing sip call unauth error
« Reply #1 on: February 04, 2019, 02:57:55 AM »
Hi,

I assume you didn't route the call correctly. If you route the call to a gateway to which you previously registered you need to route to: line/$called_nr and add parameter line=name_of_sip_account_from_accfile

https://docs.yate.ro/wiki/Accfile#Example_how_to_define_a_line

h4ckerm4n

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: outgoing sip call unauth error
« Reply #2 on: February 04, 2019, 05:58:21 AM »
I am using javascript based routing, the code of the external routing is below. Should I do the config you mentioned as well or is it not necessary?

Code: [Select]
function routeExternally(msg) {
   var server = "zzz";
   var called = "xxx";
   var caller = "yyy";
   Engine.output("OUTGOING CALL TO: "+ called +" command: "+"sip/sip:" + called + "@" + server + ":5060");
   Channel.callTo("sip/sip:" + called + "@" + server + ":5060", {"caller":caller});
   Engine.output("Performed!");
}

if(message.called == "1234"){
   routeExternally(message);
}