X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=sip.cpp;h=fa351bbccdb7ff647bb820424cfdef493a90850d;hp=a385988caf5f7270372d7af076a193e602b23616;hb=3e1c6a9f43301783ef2f517a0ce7d6204c987145;hpb=863e741714652a1b6610e8d84b42f49ca4b680ca diff --git a/sip.cpp b/sip.cpp index a385988..fa351bb 100644 --- a/sip.cpp +++ b/sip.cpp @@ -62,6 +62,8 @@ Psip::Psip(int type, char *portname, struct port_settings *settings, struct inte p_s_rtp_tx_action = 0; PDEBUG(DEBUG_SIP, "Created new Psip(%s).\n", portname); + if (!p_s_sip_inst) + FATAL("No SIP instance for interface\n"); } @@ -283,7 +285,8 @@ static int rtp_sock_callback(struct lcr_fd *fd, unsigned int what, void *instanc // psip->rtp_shutdown(); return len; } - rc = rtp_decode(psip, buffer, len); + if (psip->p_s_rtp_is_connected) + rc = rtp_decode(psip, buffer, len); } return rc; @@ -1823,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); @@ -1837,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);