From: Andreas Eversberg Date: Sun, 20 May 2012 15:45:56 +0000 (+0200) Subject: [SIP] Allow setting local port for SIP interface X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=commitdiff_plain;h=3e1c6a9f43301783ef2f517a0ce7d6204c987145 [SIP] Allow setting local port for SIP interface --- diff --git a/default/interface.conf b/default/interface.conf index 1a465ad..24ec3b2 100644 --- a/default/interface.conf +++ b/default/interface.conf @@ -192,7 +192,7 @@ # Use Sofia-SIP as SIP point-to-point interface #[sip] -#sip [:] +#sip [:] [:] #sip 10.0.0.12 10.0.0.34 #earlyb no #tones no diff --git a/sip.cpp b/sip.cpp index ee455a8..fa351bb 100644 --- a/sip.cpp +++ b/sip.cpp @@ -1826,6 +1826,7 @@ void Psip::rtp_shutdown(void) int sip_init_inst(struct interface *interface) { struct sip_inst *inst = (struct sip_inst *) MALLOC(sizeof(*inst)); + char local[64]; interface->sip_inst = inst; SCPY(inst->interface_name, interface->name); @@ -1840,7 +1841,10 @@ int sip_init_inst(struct interface *interface) return -EINVAL; } - inst->nua = nua_create(inst->root, sip_callback, inst, TAG_NULL()); + SPRINT(local, "sip:%s",inst->local_peer); + if (!strchr(inst->local_peer, ':')) + SCAT(local, ":5060"); + inst->nua = nua_create(inst->root, sip_callback, inst, NUTAG_URL(local), TAG_END()); if (!inst->nua) { PERROR("Failed to create SIP stack object\n"); sip_exit_inst(interface);